{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/photutils/issues/370","repository_url":"https://api.github.com/repos/astropy/photutils","labels_url":"https://api.github.com/repos/astropy/photutils/issues/370/labels{/name}","comments_url":"https://api.github.com/repos/astropy/photutils/issues/370/comments","events_url":"https://api.github.com/repos/astropy/photutils/issues/370/events","html_url":"https://github.com/astropy/photutils/pull/370","id":159676856,"number":370,"title":"Add general Background classes","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/photutils/labels/background","name":"background","color":"c5def5"},{"url":"https://api.github.com/repos/astropy/photutils/labels/enhancement","name":"enhancement","color":"bfdadc"}],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/astropy/photutils/milestones/5","html_url":"https://github.com/astropy/photutils/milestones/0.3","labels_url":"https://api.github.com/repos/astropy/photutils/milestones/5/labels","id":1505008,"number":5,"title":"0.3","description":"","creator":{"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},"open_issues":1,"closed_issues":19,"state":"open","created_at":"2016-01-13T17:46:36Z","updated_at":"2016-06-14T22:58:27Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-06-10T16:49:52Z","updated_at":"2016-06-17T03:03:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/astropy/photutils/pulls/370","html_url":"https://github.com/astropy/photutils/pull/370","diff_url":"https://github.com/astropy/photutils/pull/370.diff","patch_url":"https://github.com/astropy/photutils/pull/370.patch"},"body":"This large PR contains the following changes:\r\n\r\n1.  Turns the `background.py` module into a `background` subpackage.\r\n\r\n2.  Adds many new classes for computing a (scalar) background value or background rms value from a (possibly masked) array of any dimension:\r\n\r\n  * `MeanBackground`\r\n  * `MedianBackground`\r\n  * `MMMBackground`\r\n  * `SExtractorBackground`\r\n  * `BiweightLocationBackground`\r\n  * `StdBackgroundRMS`\r\n  * `MADStdBackgroundRMS`\r\n  * `BiweightMidvarianceBackgroundRMS`\r\n\r\n  Sigma-clipping is performed by default, but can be turned off by setting `sigclip = False`.\r\n\r\n3. The existing `BackgroundBase`, `Background` and `BackgroundIDW` classes are now called `BackgroundBase2D`, `Background2D`, and `BackgroundIDW2D`, respectively, since they return 2D background *images*.\r\n\r\nMy plan is to submit another PR to integrate the general background classes into the 2D background classes (with a similar interface).\r\n\r\nExample\r\n------------\r\n```\r\nfrom photutils import MMMBackground\r\nbkg = MMMBackground(sigma=3., iters=10)\r\nbkg_value = bkg.calc_background(data)\r\n``` \r\n\r\nThe classes are designed to be used as an object-oriented interface for other functions, e.g.:\r\n```\r\nbkg = MMMBackground(sigma_lower=5.5, sigma_upper=3., iters=10)\r\nresult = psf_photometry(data, ... , background_sub=bkg)\r\n```\r\n\r\nin function form (requires `calc_background` -> `__call__`):\r\n```\r\nresult = psf_photometry(data, ... , background_sub=np.ma.mean)\r\n```\r\nwhere the user can define custom background classes if desired.\r\n\r\ncc: @eteq, @hcferguson \r\n"},"comment":{"url":"https://api.github.com/repos/astropy/photutils/issues/comments/226669483","html_url":"https://github.com/astropy/photutils/pull/370#issuecomment-226669483","issue_url":"https://api.github.com/repos/astropy/photutils/issues/370","id":226669483,"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},"created_at":"2016-06-17T03:03:47Z","updated_at":"2016-06-17T03:03:47Z","body":"Thanks, @eteq!  Please review the updates."}}
{"actor":{"display_login":"larrybradley"}}