{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/photutils/pulls/comments/74813333","id":74813333,"diff_hunk":"@@ -376,6 +377,135 @@ def find_stars(self, data):\n         return tbl\n \n \n+class PeakFinder(StarFinderBase):\n+    \"\"\"\n+    Find local peaks in an image that are above above a specified\n+    threshold value.\n+\n+    Peaks are the maxima above the ``threshold`` within a local region.\n+    The regions are defined by either the ``box_size`` or ``footprint``\n+    parameters.  ``box_size`` defines the local region around each pixel\n+    as a square box.  ``footprint`` is a boolean array where `True`\n+    values specify the region shape.\n+\n+    If multiple pixels within a local region have identical intensities,\n+    then the coordinates of all such pixels are returned.  Otherwise,\n+    there will be only one peak pixel per local region.  Thus, the\n+    defined region effectively imposes a minimum separation between\n+    peaks (unless there are identical peaks within the region).\n+\n+    When using subpixel precision (``subpixel=True``), then a cutout of\n+    the specified ``box_size`` or ``footprint`` will be taken centered\n+    on each peak and fit with a 2D Gaussian (plus a constant).  In this\n+    case, the fitted local centroid and peak value (the Gaussian\n+    amplitude plus the background constant) will also be returned in the\n+    output table.\n+\n+    Parameters\n+    ----------\n+    threshold : float or array-like\n+        The data value or pixel-wise data values to be used for the\n+        detection threshold.  A 2D ``threshold`` must have the same\n+        shape as ``data``.  See `detect_threshold` for one way to create\n+        a ``threshold`` image.\n+\n+    box_size : scalar or tuple, optional\n+        The size of the local region to search for peaks at every point\n+        in ``data``.  If ``box_size`` is a scalar, then the region shape\n+        will be ``(box_size, box_size)``.  Either ``box_size`` or\n+        ``footprint`` must be defined.  If they are both defined, then\n+        ``footprint`` overrides ``box_size``.\n+\n+    footprint : `~numpy.ndarray` of bools, optional\n+        A boolean array where `True` values describe the local footprint\n+        region within which to search for peaks at every point in\n+        ``data``.  ``box_size=(n, m)`` is equivalent to\n+        ``footprint=np.ones((n, m))``.  Either ``box_size`` or\n+        ``footprint`` must be defined.  If they are both defined, then\n+        ``footprint`` overrides ``box_size``.\n+\n+    mask : array_like, bool, optional\n+        A boolean mask with the same shape as ``data``, where a `True`\n+        value indicates the corresponding element of ``data`` is masked.\n+\n+    border_width : bool, optional\n+        The width in pixels to exclude around the border of the\n+        ``data``.\n+\n+    npeaks : int, optional\n+        The maximum number of peaks to return.  When the number of\n+        detected peaks exceeds ``npeaks``, the peaks with the highest\n+        peak intensities will be returned.\n+\n+    subpixel : bool, optional\n+        If `True`, then a cutout of the specified ``box_size`` or\n+        ``footprint`` will be taken centered on each peak and fit with a\n+        2D Gaussian (plus a constant).  In this case, the fitted local\n+        centroid and peak value (the Gaussian amplitude plus the\n+        background constant) will also be returned in the output table.\n+\n+    error : array_like, optional\n+        The 2D array of the 1-sigma errors of the input ``data``.\n+        ``error`` is used only to weight the 2D Gaussian fit performed\n+        when ``subpixel=True``.\n+\n+    wcs : `~astropy.wcs.WCS`\n+        The WCS transformation to use to convert from pixel coordinates\n+        to ICRS world coordinates.  If `None`, then the world\n+        coordinates will not be returned in the output\n+        `~astropy.table.Table`.\n+    \"\"\"\n+\n+    def __init__(self, threshold, box_size=3, footprint=None, mask=None,\n+                 border_width=None, npeaks=np.inf, subpixel=True, error=None,\n+                 wcs=None):\n+        self.threshold = threshold\n+        self.box_size = box_size\n+        self.footprint = footprint\n+        self.mask = mask\n+        self.border_width = border_width\n+        self.npeaks = npeaks\n+        self.subpixel = subpixel\n+        self.error = error\n+        self.wcs = wcs\n+\n+    def __call__(self, data):\n+        return self.find_stars(data)\n+\n+    def find_stars(self, data):\n+        \"\"\"\n+        Parameters\n+        ----------\n+        data : array_like\n+            The 2D array of the image.\n+\n+        Returns\n+        -------\n+        output : `~astropy.table.Table`\n+            A table containing the x and y pixel location of the peaks and\n+            their values.  If ``subpixel=True``, then the table will also\n+            contain the local centroid and fitted peak value.\n+        \"\"\"\n+\n+        peaks = find_peaks(data, threshold=self.threshold,\n+                           box_size=self.box_size, footprint=self.footprint,\n+                           mask=self.mask, border_width=self.border_width,\n+                           npeaks=self.npeaks, subpixel=self.subpixel,\n+                           error=self.error, wcs=self.wcs)\n+\n+        if len(peaks) > 0:\n+            if self.subpixel:\n+                peaks['y_centroid'].name = 'ycentroid'\n+                peaks['x_centroid'].name = 'xcentroid'\n+            else:\n+                peaks['y_peak'].name = 'ycentroid'\n+                peaks['x_peak'].name = 'xcentroid'\n+\n+            peaks['id'] = np.arange(len(peaks)) + 1\n+","path":"photutils/detection/findstars.py","position":148,"original_position":148,"commit_id":"dac3c791def61bd72fb47e7a7dc1f91a3176e7b0","original_commit_id":"dac3c791def61bd72fb47e7a7dc1f91a3176e7b0","user":{"login":"eteq","id":346587,"avatar_url":"https://avatars.githubusercontent.com/u/346587?v=3","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"body":"Right, that's what I meant, @larrybradley, thanks!","created_at":"2016-08-15T18:53:09Z","updated_at":"2016-08-15T18:53:09Z","html_url":"https://github.com/astropy/photutils/pull/401#discussion_r74813333","pull_request_url":"https://api.github.com/repos/astropy/photutils/pulls/401","_links":{"self":{"href":"https://api.github.com/repos/astropy/photutils/pulls/comments/74813333"},"html":{"href":"https://github.com/astropy/photutils/pull/401#discussion_r74813333"},"pull_request":{"href":"https://api.github.com/repos/astropy/photutils/pulls/401"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/photutils/pulls/401","id":80943379,"html_url":"https://github.com/astropy/photutils/pull/401","diff_url":"https://github.com/astropy/photutils/pull/401.diff","patch_url":"https://github.com/astropy/photutils/pull/401.patch","issue_url":"https://api.github.com/repos/astropy/photutils/issues/401","number":401,"state":"open","locked":false,"title":"add PeakFinder class","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":"I added this class so that the function [find_peaks](http://photutils.readthedocs.io/en/latest/api/photutils.find_peaks.html#photutils.find_peaks) may be also used to perform the FIND step in psf photometry.","created_at":"2016-08-11T11:42:17Z","updated_at":"2016-08-15T18:53:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"901bf3bfbf4e02c839366f5f4a46da87a988b162","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/astropy/photutils/pulls/401/commits","review_comments_url":"https://api.github.com/repos/astropy/photutils/pulls/401/comments","review_comment_url":"https://api.github.com/repos/astropy/photutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/photutils/issues/401/comments","statuses_url":"https://api.github.com/repos/astropy/photutils/statuses/dac3c791def61bd72fb47e7a7dc1f91a3176e7b0","head":{"label":"mirca:find-peaks-oop","ref":"find-peaks-oop","sha":"dac3c791def61bd72fb47e7a7dc1f91a3176e7b0","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-15T09:50:27Z","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":4036,"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":"624bee4bd09e2f39c3a41fe2329007bf0a2c5c4a","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-15T09:50:27Z","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":7971,"stargazers_count":37,"watchers_count":37,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":39,"forks":54,"open_issues":39,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/photutils/pulls/401"},"html":{"href":"https://github.com/astropy/photutils/pull/401"},"issue":{"href":"https://api.github.com/repos/astropy/photutils/issues/401"},"comments":{"href":"https://api.github.com/repos/astropy/photutils/issues/401/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/photutils/pulls/401/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/photutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/photutils/pulls/401/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/photutils/statuses/dac3c791def61bd72fb47e7a7dc1f91a3176e7b0"}}}}
{"actor":{"display_login":"eteq"}}