{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/3453","labels_url":"https://api.github.com/repos/astropy/astropy/issues/3453/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/3453/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/3453/events","html_url":"https://github.com/astropy/astropy/pull/3453","id":56848780,"number":3453,"title":"Add downsample and upsample functions","user":{"login":"larrybradley","id":4992897,"avatar_url":"https://avatars.githubusercontent.com/u/4992897?v=3","gravatar_id":"","url":"https://api.github.com/users/larrybradley","html_url":"https://github.com/larrybradley","followers_url":"https://api.github.com/users/larrybradley/followers","following_url":"https://api.github.com/users/larrybradley/following{/other_user}","gists_url":"https://api.github.com/users/larrybradley/gists{/gist_id}","starred_url":"https://api.github.com/users/larrybradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larrybradley/subscriptions","organizations_url":"https://api.github.com/users/larrybradley/orgs","repos_url":"https://api.github.com/users/larrybradley/repos","events_url":"https://api.github.com/users/larrybradley/events{/privacy}","received_events_url":"https://api.github.com/users/larrybradley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astropy/labels/nddata","name":"nddata","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-06T18:29:14Z","updated_at":"2015-02-08T12:55:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/3453","html_url":"https://github.com/astropy/astropy/pull/3453","diff_url":"https://github.com/astropy/astropy/pull/3453.diff","patch_url":"https://github.com/astropy/astropy/pull/3453.patch"},"body":"The `downsample` and `upsample` (`Cython`) functions weren't merged as part of the large `imageutils` PR (https://github.com/astropy/astropy/pull/3201) because they could be accomplished using `ndarray` tricks (which are a bit slower than the `Cython`-based functions).  This PR implements `downsample` and `upsample` using the `ndarray` tricks, which are likely too obscure for most users.  Both functions can handle 1D or 2D data, and `downsample` will trim the input array if necessary."},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/73409663","html_url":"https://github.com/astropy/astropy/pull/3453#issuecomment-73409663","issue_url":"https://api.github.com/repos/astropy/astropy/issues/3453","id":73409663,"user":{"login":"hamogu","id":498688,"avatar_url":"https://avatars.githubusercontent.com/u/498688?v=3","gravatar_id":"","url":"https://api.github.com/users/hamogu","html_url":"https://github.com/hamogu","followers_url":"https://api.github.com/users/hamogu/followers","following_url":"https://api.github.com/users/hamogu/following{/other_user}","gists_url":"https://api.github.com/users/hamogu/gists{/gist_id}","starred_url":"https://api.github.com/users/hamogu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamogu/subscriptions","organizations_url":"https://api.github.com/users/hamogu/orgs","repos_url":"https://api.github.com/users/hamogu/repos","events_url":"https://api.github.com/users/hamogu/events{/privacy}","received_events_url":"https://api.github.com/users/hamogu/received_events","type":"User","site_admin":false},"created_at":"2015-02-08T12:55:13Z","updated_at":"2015-02-08T12:55:13Z","body":"I think this is more restricted that necessary. It basically offers two function that can be used: sum and mean. At least for downsampling there could be a parameter that defaults to`function=np.sum`. For the mean you would set `function=np.mean`, but I've used the same trick with the standard deviation in the past and it could also be used with min or max.\r\nThis would also make the implementation simpler - see inline comment."}}