{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/photutils/pulls/comments/75524185","id":75524185,"diff_hunk":"@@ -28,20 +28,383 @@ model-fitting analysis, regardless to exactly what kind of model is actually\n being fit.  We take this road, using \"PSF photometry\" as shorthand for the\n general approach.\n \n+PSF Photometry in Crowded Fields\n+--------------------------------\n+\n+Photutils provides an implementation of the DAOPHOT algorithm\n+(`~photutils.psf.DAOPhotPSFPhotometry`) proposed by Stetson in his\n+seminal paper for crowded-field stellar photometry.\n+The DAOPHOT algorithm consists in applying the loop FIND, GROUP, NSTAR,\n+SUBTRACT, FIND until no more stars are detected or a given number of\n+iterations is reached.\n+\n+Basically, DAOPHOT works as follows. The first step is to estimate the sky\n+background. For this task, photutils provides several classes to compute\n+scalar and 2D backgrounds, see `~photutils.background` for details. The next\n+step is to find an initial estimate of the positions of potential sources.\n+This can be accomplished by using source detection algorithms,\n+which are implemented in `~photutils.detection`.\n+\n+After finding sources one would apply a clustering algorithm in order to label\n+the sources according to groups. Usually, those groups are formed by a\n+distance criterion, which is the case of the grouping algorithm proposed\n+by Stetson. In `~photutils.psf.DAOGroup`, we provide an implementation of\n+that algorithm.\n+\n+Provided that the groups are available, the next step is to fit the sources\n+simultaneously for each group. This task can be done using an astropy\n+fitter, for instance, `~astropy.modeling.fitting.LevMarLSQFitter`.\n+\n+After sources are fitted, they are subtracted from the given image\n+and, after fitting all sources, the residual image is analyzed by the finding\n+routine again in order to check if there exist any source which has not been\n+detected previously. This process goes on until no more sources are identified \n+by the finding routine.\n+\n Basic Usage\n------------\n+^^^^^^^^^^^\n+\n+The DAOPhotPSFPhotometry is the core class to implement the DAOPHOT algorithm\n+to perform PSF photometry in crowded fields.\n+\n+It basically encapsulates the loop \"FIND, GROUP, NSTAR, SUBTRACT\" in one place\n+so that one can easily perform PSF photometry just by setting up a\n+DAOPhotPSFPhotometry object.\n+\n+This class was implemented in such a way that it can be used as a callable\n+function. The basic idea is illustrated as follows::\n+\n+    >>> # create a DAOPhotPSFPhotometry object\n+    >>> from photutils.psf import DAOPhotPSFPhotometry \n+    >>> my_photometry = DAOPhotPSFPhotometry(find=my_finder, group=my_group,\n+                        bkg=my_bkg, psf=my_psf_model, fitter=my_fitter,\n+                        niters=5, fitshape=(7,7)) #doctest: +SKIP\n+    >>> # get photometry results\n+    >>> photometry_results, residual_image = my_photometry(image=my_image) # doctest: +SKIP\n+\n+Where ``my_finder``, ``my_group``, and ``my_bkg`` may be any suitable callable\n+function. This approach allows one to customize every part of the photometry\n+process provided that their input/output are compatible with the input/ouput\n+expected by DAOPhotPSFPhotometry. See the API documentation for details.\n+\n+Performing PSF Photometry\n+^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+Let's take a look in a simple example with simulated stars whose PSF is\n+assumed to be Gaussian.\n+\n+First let's create an image with four overlapping stars::\n+    \n+    >>> from photutils.datasets import make_random_gaussians\n+    >>> from photutils.datasets import make_noise_image\n+    >>> from photutils.datasets import make_gaussian_sources\n+    >>> from matplotlib import rcParams\n+    >>> import matplotlib.pyplot as plt\n+    >>> rcParams['image.cmap'] = 'viridis'\n+    >>> rcParams['image.aspect'] = 1  # to get images with square pixels\n+    >>> rcParams['figure.figsize'] = (20,10)\n+    >>> rcParams['image.interpolation'] = 'nearest'\n+    >>> rcParams['image.origin'] = 'lower'\n+    >>> rcParams['font.size'] = 14\n+\n+    >>> sigma_psf = 2.0\n+    >>> sources = Table()\n+    >>> sources['flux'] = [700, 800, 700, 800]\n+    >>> sources['x_mean'] = [12, 17, 12, 17]\n+    >>> sources['y_mean'] = [15, 15, 20, 20]\n+    >>> sources['x_stddev'] = sigma_psf*np.ones(4)\n+    >>> sources['y_stddev'] = sources['x_stddev']\n+    >>> sources['theta'] = [0, 0, 0, 0]\n+    >>> sources['id'] = [1, 2, 3, 4]\n+    >>> tshape = (32, 32)\n+    >>> image = (make_gaussian_sources(tshape, sources) +\n+                 make_noise_image(tshape, type='poisson', mean=6.,\n+                                  random_state=1) +\n+                 make_noise_image(tshape, type='gaussian', mean=0.,\n+                                  stddev=2., random_state=1))\n+    >>> plt.imshow(image)\n+    >>> plt.title('Simulated data')\n+    >>> plt.colorbar(orientation='horizontal', fraction=0.046, pad=0.04)\n+    >>> plt.show()\n+\n+\n+.. plot::\n+    ","path":"docs/photutils/psf.rst","position":122,"original_position":106,"commit_id":"9fe85f839b1daef678e8686551a1b0ef564fe6af","original_commit_id":"17a53b1de218fed84d0804ee30889eb67ef8d4b8","user":{"login":"mirca","id":13077051,"avatar_url":"https://avatars.githubusercontent.com/u/13077051?v=3","gravatar_id":"","url":"https://api.github.com/users/mirca","html_url":"https://github.com/mirca","followers_url":"https://api.github.com/users/mirca/followers","following_url":"https://api.github.com/users/mirca/following{/other_user}","gists_url":"https://api.github.com/users/mirca/gists{/gist_id}","starred_url":"https://api.github.com/users/mirca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirca/subscriptions","organizations_url":"https://api.github.com/users/mirca/orgs","repos_url":"https://api.github.com/users/mirca/repos","events_url":"https://api.github.com/users/mirca/events{/privacy}","received_events_url":"https://api.github.com/users/mirca/received_events","type":"User","site_admin":false},"body":"@bsipocz thanks!","created_at":"2016-08-19T17:52:58Z","updated_at":"2016-08-19T17:52:58Z","html_url":"https://github.com/astropy/photutils/pull/404#discussion_r75524185","pull_request_url":"https://api.github.com/repos/astropy/photutils/pulls/404","_links":{"self":{"href":"https://api.github.com/repos/astropy/photutils/pulls/comments/75524185"},"html":{"href":"https://github.com/astropy/photutils/pull/404#discussion_r75524185"},"pull_request":{"href":"https://api.github.com/repos/astropy/photutils/pulls/404"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/photutils/pulls/404","id":81486970,"html_url":"https://github.com/astropy/photutils/pull/404","diff_url":"https://github.com/astropy/photutils/pull/404.diff","patch_url":"https://github.com/astropy/photutils/pull/404.patch","issue_url":"https://api.github.com/repos/astropy/photutils/issues/404","number":404,"state":"open","locked":false,"title":"[DOC]: Narrative docs for PSF Photometry","user":{"login":"mirca","id":13077051,"avatar_url":"https://avatars.githubusercontent.com/u/13077051?v=3","gravatar_id":"","url":"https://api.github.com/users/mirca","html_url":"https://github.com/mirca","followers_url":"https://api.github.com/users/mirca/followers","following_url":"https://api.github.com/users/mirca/following{/other_user}","gists_url":"https://api.github.com/users/mirca/gists{/gist_id}","starred_url":"https://api.github.com/users/mirca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirca/subscriptions","organizations_url":"https://api.github.com/users/mirca/orgs","repos_url":"https://api.github.com/users/mirca/repos","events_url":"https://api.github.com/users/mirca/events{/privacy}","received_events_url":"https://api.github.com/users/mirca/received_events","type":"User","site_admin":false},"body":"Hi all,\r\n\r\nI'm writing narrative docs for the PSF photometry module.\r\n\r\nIs there anything else that you would like to see? @hamogu @bsipocz @eteq @larrybradley \r\n\r\nPS: the doctests depends on #385 ","created_at":"2016-08-16T14:58:29Z","updated_at":"2016-08-19T17:52:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18c926120ecc590bc1a8350a6f8a81d2fcd0f9e2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/astropy/photutils/pulls/404/commits","review_comments_url":"https://api.github.com/repos/astropy/photutils/pulls/404/comments","review_comment_url":"https://api.github.com/repos/astropy/photutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/photutils/issues/404/comments","statuses_url":"https://api.github.com/repos/astropy/photutils/statuses/9fe85f839b1daef678e8686551a1b0ef564fe6af","head":{"label":"mirca:psf_docs","ref":"psf_docs","sha":"9fe85f839b1daef678e8686551a1b0ef564fe6af","user":{"login":"mirca","id":13077051,"avatar_url":"https://avatars.githubusercontent.com/u/13077051?v=3","gravatar_id":"","url":"https://api.github.com/users/mirca","html_url":"https://github.com/mirca","followers_url":"https://api.github.com/users/mirca/followers","following_url":"https://api.github.com/users/mirca/following{/other_user}","gists_url":"https://api.github.com/users/mirca/gists{/gist_id}","starred_url":"https://api.github.com/users/mirca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirca/subscriptions","organizations_url":"https://api.github.com/users/mirca/orgs","repos_url":"https://api.github.com/users/mirca/repos","events_url":"https://api.github.com/users/mirca/events{/privacy}","received_events_url":"https://api.github.com/users/mirca/received_events","type":"User","site_admin":false},"repo":{"id":49218653,"name":"photutils","full_name":"mirca/photutils","owner":{"login":"mirca","id":13077051,"avatar_url":"https://avatars.githubusercontent.com/u/13077051?v=3","gravatar_id":"","url":"https://api.github.com/users/mirca","html_url":"https://github.com/mirca","followers_url":"https://api.github.com/users/mirca/followers","following_url":"https://api.github.com/users/mirca/following{/other_user}","gists_url":"https://api.github.com/users/mirca/gists{/gist_id}","starred_url":"https://api.github.com/users/mirca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirca/subscriptions","organizations_url":"https://api.github.com/users/mirca/orgs","repos_url":"https://api.github.com/users/mirca/repos","events_url":"https://api.github.com/users/mirca/events{/privacy}","received_events_url":"https://api.github.com/users/mirca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mirca/photutils","description":"Affiliated package for image photometry utilities. Maintainers: @larrybradley and @bsipocz","fork":true,"url":"https://api.github.com/repos/mirca/photutils","forks_url":"https://api.github.com/repos/mirca/photutils/forks","keys_url":"https://api.github.com/repos/mirca/photutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirca/photutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirca/photutils/teams","hooks_url":"https://api.github.com/repos/mirca/photutils/hooks","issue_events_url":"https://api.github.com/repos/mirca/photutils/issues/events{/number}","events_url":"https://api.github.com/repos/mirca/photutils/events","assignees_url":"https://api.github.com/repos/mirca/photutils/assignees{/user}","branches_url":"https://api.github.com/repos/mirca/photutils/branches{/branch}","tags_url":"https://api.github.com/repos/mirca/photutils/tags","blobs_url":"https://api.github.com/repos/mirca/photutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirca/photutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirca/photutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirca/photutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirca/photutils/statuses/{sha}","languages_url":"https://api.github.com/repos/mirca/photutils/languages","stargazers_url":"https://api.github.com/repos/mirca/photutils/stargazers","contributors_url":"https://api.github.com/repos/mirca/photutils/contributors","subscribers_url":"https://api.github.com/repos/mirca/photutils/subscribers","subscription_url":"https://api.github.com/repos/mirca/photutils/subscription","commits_url":"https://api.github.com/repos/mirca/photutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirca/photutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirca/photutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirca/photutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirca/photutils/contents/{+path}","compare_url":"https://api.github.com/repos/mirca/photutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirca/photutils/merges","archive_url":"https://api.github.com/repos/mirca/photutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirca/photutils/downloads","issues_url":"https://api.github.com/repos/mirca/photutils/issues{/number}","pulls_url":"https://api.github.com/repos/mirca/photutils/pulls{/number}","milestones_url":"https://api.github.com/repos/mirca/photutils/milestones{/number}","notifications_url":"https://api.github.com/repos/mirca/photutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirca/photutils/labels{/name}","releases_url":"https://api.github.com/repos/mirca/photutils/releases{/id}","deployments_url":"https://api.github.com/repos/mirca/photutils/deployments","created_at":"2016-01-07T17:13:17Z","updated_at":"2016-03-13T21:34:34Z","pushed_at":"2016-08-19T17:46:48Z","git_url":"git://github.com/mirca/photutils.git","ssh_url":"git@github.com:mirca/photutils.git","clone_url":"https://github.com/mirca/photutils.git","svn_url":"https://github.com/mirca/photutils","homepage":"http://photutils.readthedocs.org/en/latest/","size":4042,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"187fc8eafc31af4168e34730d7e6cd8641a3e0e2","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2640766,"name":"photutils","full_name":"astropy/photutils","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/photutils","description":"Affiliated package for image photometry utilities. Maintainers: @larrybradley and @bsipocz","fork":false,"url":"https://api.github.com/repos/astropy/photutils","forks_url":"https://api.github.com/repos/astropy/photutils/forks","keys_url":"https://api.github.com/repos/astropy/photutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/photutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/photutils/teams","hooks_url":"https://api.github.com/repos/astropy/photutils/hooks","issue_events_url":"https://api.github.com/repos/astropy/photutils/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/photutils/events","assignees_url":"https://api.github.com/repos/astropy/photutils/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/photutils/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/photutils/tags","blobs_url":"https://api.github.com/repos/astropy/photutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/photutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/photutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/photutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/photutils/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/photutils/languages","stargazers_url":"https://api.github.com/repos/astropy/photutils/stargazers","contributors_url":"https://api.github.com/repos/astropy/photutils/contributors","subscribers_url":"https://api.github.com/repos/astropy/photutils/subscribers","subscription_url":"https://api.github.com/repos/astropy/photutils/subscription","commits_url":"https://api.github.com/repos/astropy/photutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/photutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/photutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/photutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/photutils/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/photutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/photutils/merges","archive_url":"https://api.github.com/repos/astropy/photutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/photutils/downloads","issues_url":"https://api.github.com/repos/astropy/photutils/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/photutils/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/photutils/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/photutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/photutils/labels{/name}","releases_url":"https://api.github.com/repos/astropy/photutils/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/photutils/deployments","created_at":"2011-10-25T02:39:28Z","updated_at":"2016-08-13T02:30:50Z","pushed_at":"2016-08-19T17:46:49Z","git_url":"git://github.com/astropy/photutils.git","ssh_url":"git@github.com:astropy/photutils.git","clone_url":"https://github.com/astropy/photutils.git","svn_url":"https://github.com/astropy/photutils","homepage":"http://photutils.readthedocs.io","size":8021,"stargazers_count":37,"watchers_count":37,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":39,"forks":55,"open_issues":39,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/photutils/pulls/404"},"html":{"href":"https://github.com/astropy/photutils/pull/404"},"issue":{"href":"https://api.github.com/repos/astropy/photutils/issues/404"},"comments":{"href":"https://api.github.com/repos/astropy/photutils/issues/404/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/photutils/pulls/404/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/photutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/photutils/pulls/404/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/photutils/statuses/9fe85f839b1daef678e8686551a1b0ef564fe6af"}}}}
{"actor":{"display_login":"mirca"}}