{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/meas_base/pulls/comments/46811539","id":46811539,"diff_hunk":"@@ -68,6 +71,103 @@\n                     TransformClass=bl.ApertureFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)\n \n # --- Single-Frame Measurement Plugins ---\n+class SingleFrameVarianceConfig(SingleFramePluginConfig):\n+        scale = lsst.pex.config.Field(dtype=float, default=5.0, optional=True,\n+                                      doc=\"scale factor to apply to shape for aperture\")\n+        mask = lsst.pex.config.ListField(doc=\"mask planes to ignore\", dtype=str,\n+                                         default=[\"DETECTED\", \"DETECTED_NEGATIVE\"])\n+\n+@register(\"base_Variance\")\n+class SingleFrameVariancePlugin(SingleFramePlugin):\n+    '''\n+    Calculate the median variance within a Footprint scaled from the object shape so\n+    the value is not terribly influenced by the object and instead represents the\n+    variance in the background near the object.\n+    '''\n+\n+    ConfigClass = SingleFrameVarianceConfig\n+\n+    @classmethod\n+    def getExecutionOrder(cls):\n+        return cls.FLUX_ORDER\n+\n+    def __init__(self, config, name, schema, metadata):\n+        SingleFramePlugin.__init__(self, config, name, schema, metadata)\n+        self.varValue = schema.addField(name + '_value', type=\"D\", doc=\"variance at object position\")\n+        self.varFlag = schema.addField(name + '_flag', type=\"Flag\", doc=\"Set to 1 for any fatal Failure\")\n+\n+    def measure(self, measRecord, exposure):\n+        # Promote the bounding box of the footprint to type D to ensure\n+        # the ability to compare (they may be of mixed types I and D)\n+        center = measRecord.getCentroid()\n+        fpBbox = lsst.afw.geom.Box2D(measRecord.getFootprint().getBBox())\n+        # check to insure that the center exists and that it is contained within the footprint\n+        # catch bad centroiding\n+        if not center or not fpBbox.contains(center):\n+            raise Exception(\"The measRecord has no center, or the center is outside the footprint\")","path":"python/lsst/meas/base/plugins.py","position":54,"original_position":54,"commit_id":"77ac22c2ecfd88e75f5fb6861ef79d441a71d7a9","original_commit_id":"77ac22c2ecfd88e75f5fb6861ef79d441a71d7a9","user":{"login":"jdswinbank","id":460854,"avatar_url":"https://avatars.githubusercontent.com/u/460854?v=3","gravatar_id":"","url":"https://api.github.com/users/jdswinbank","html_url":"https://github.com/jdswinbank","followers_url":"https://api.github.com/users/jdswinbank/followers","following_url":"https://api.github.com/users/jdswinbank/following{/other_user}","gists_url":"https://api.github.com/users/jdswinbank/gists{/gist_id}","starred_url":"https://api.github.com/users/jdswinbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdswinbank/subscriptions","organizations_url":"https://api.github.com/users/jdswinbank/orgs","repos_url":"https://api.github.com/users/jdswinbank/repos","events_url":"https://api.github.com/users/jdswinbank/events{/privacy}","received_events_url":"https://api.github.com/users/jdswinbank/received_events","type":"User","site_admin":false},"body":"measRecord is just a variable name -- it's an artefact of your implementation, and likely means nothing to the end user. Maybe better to refer to it just as a \"measurement\" or a \"source record\" or something?\r\n\r\nAlso: you can trivially tell if the problem is that the measurement has no centre or if the centre is outside the Footprint. The end user likely can't. Would it be worth being explicit about what has caused the failure?\r\n\r\nAlso also: capital-F-ootprint.","created_at":"2015-12-07T11:35:45Z","updated_at":"2015-12-07T11:35:45Z","html_url":"https://github.com/lsst/meas_base/pull/28#discussion_r46811539","pull_request_url":"https://api.github.com/repos/lsst/meas_base/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/comments/46811539"},"html":{"href":"https://github.com/lsst/meas_base/pull/28#discussion_r46811539"},"pull_request":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/meas_base/pulls/28","id":52797111,"html_url":"https://github.com/lsst/meas_base/pull/28","diff_url":"https://github.com/lsst/meas_base/pull/28.diff","patch_url":"https://github.com/lsst/meas_base/pull/28.patch","issue_url":"https://api.github.com/repos/lsst/meas_base/issues/28","number":28,"state":"open","locked":false,"title":"Review for DM-4235: countInputs and per object variance functions","user":{"login":"jdswinbank","id":460854,"avatar_url":"https://avatars.githubusercontent.com/u/460854?v=3","gravatar_id":"","url":"https://api.github.com/users/jdswinbank","html_url":"https://github.com/jdswinbank","followers_url":"https://api.github.com/users/jdswinbank/followers","following_url":"https://api.github.com/users/jdswinbank/following{/other_user}","gists_url":"https://api.github.com/users/jdswinbank/gists{/gist_id}","starred_url":"https://api.github.com/users/jdswinbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdswinbank/subscriptions","organizations_url":"https://api.github.com/users/jdswinbank/orgs","repos_url":"https://api.github.com/users/jdswinbank/repos","events_url":"https://api.github.com/users/jdswinbank/events{/privacy}","received_events_url":"https://api.github.com/users/jdswinbank/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-07T01:14:16Z","updated_at":"2015-12-07T11:35:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53e3434bfb26fb6051b6774e580ed1387797a7af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lsst/meas_base/pulls/28/commits","review_comments_url":"https://api.github.com/repos/lsst/meas_base/pulls/28/comments","review_comment_url":"https://api.github.com/repos/lsst/meas_base/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/meas_base/issues/28/comments","statuses_url":"https://api.github.com/repos/lsst/meas_base/statuses/77ac22c2ecfd88e75f5fb6861ef79d441a71d7a9","head":{"label":"lsst:tickets/DM-4235","ref":"tickets/DM-4235","sha":"77ac22c2ecfd88e75f5fb6861ef79d441a71d7a9","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013356,"name":"meas_base","full_name":"lsst/meas_base","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/meas_base","description":"LSST Data Management: core astronomical measurement algorithms","fork":false,"url":"https://api.github.com/repos/lsst/meas_base","forks_url":"https://api.github.com/repos/lsst/meas_base/forks","keys_url":"https://api.github.com/repos/lsst/meas_base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/meas_base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/meas_base/teams","hooks_url":"https://api.github.com/repos/lsst/meas_base/hooks","issue_events_url":"https://api.github.com/repos/lsst/meas_base/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/meas_base/events","assignees_url":"https://api.github.com/repos/lsst/meas_base/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/meas_base/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/meas_base/tags","blobs_url":"https://api.github.com/repos/lsst/meas_base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/meas_base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/meas_base/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/meas_base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/meas_base/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/meas_base/languages","stargazers_url":"https://api.github.com/repos/lsst/meas_base/stargazers","contributors_url":"https://api.github.com/repos/lsst/meas_base/contributors","subscribers_url":"https://api.github.com/repos/lsst/meas_base/subscribers","subscription_url":"https://api.github.com/repos/lsst/meas_base/subscription","commits_url":"https://api.github.com/repos/lsst/meas_base/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/meas_base/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/meas_base/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/meas_base/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/meas_base/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/meas_base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/meas_base/merges","archive_url":"https://api.github.com/repos/lsst/meas_base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/meas_base/downloads","issues_url":"https://api.github.com/repos/lsst/meas_base/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/meas_base/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/meas_base/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/meas_base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/meas_base/labels{/name}","releases_url":"https://api.github.com/repos/lsst/meas_base/releases{/id}","created_at":"2014-08-16T07:45:37Z","updated_at":"2015-04-21T20:29:36Z","pushed_at":"2015-12-07T01:14:16Z","git_url":"git://github.com/lsst/meas_base.git","ssh_url":"git@github.com:lsst/meas_base.git","clone_url":"https://github.com/lsst/meas_base.git","svn_url":"https://github.com/lsst/meas_base","homepage":"http://dm.lsst.org/","size":2422,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"87d2c31961e21ce41ce43fecb5122a01efeb93ad","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":23013356,"name":"meas_base","full_name":"lsst/meas_base","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars.githubusercontent.com/u/1134504?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/meas_base","description":"LSST Data Management: core astronomical measurement algorithms","fork":false,"url":"https://api.github.com/repos/lsst/meas_base","forks_url":"https://api.github.com/repos/lsst/meas_base/forks","keys_url":"https://api.github.com/repos/lsst/meas_base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/meas_base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/meas_base/teams","hooks_url":"https://api.github.com/repos/lsst/meas_base/hooks","issue_events_url":"https://api.github.com/repos/lsst/meas_base/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/meas_base/events","assignees_url":"https://api.github.com/repos/lsst/meas_base/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/meas_base/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/meas_base/tags","blobs_url":"https://api.github.com/repos/lsst/meas_base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/meas_base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/meas_base/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/meas_base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/meas_base/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/meas_base/languages","stargazers_url":"https://api.github.com/repos/lsst/meas_base/stargazers","contributors_url":"https://api.github.com/repos/lsst/meas_base/contributors","subscribers_url":"https://api.github.com/repos/lsst/meas_base/subscribers","subscription_url":"https://api.github.com/repos/lsst/meas_base/subscription","commits_url":"https://api.github.com/repos/lsst/meas_base/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/meas_base/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/meas_base/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/meas_base/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/meas_base/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/meas_base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/meas_base/merges","archive_url":"https://api.github.com/repos/lsst/meas_base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/meas_base/downloads","issues_url":"https://api.github.com/repos/lsst/meas_base/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/meas_base/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/meas_base/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/meas_base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/meas_base/labels{/name}","releases_url":"https://api.github.com/repos/lsst/meas_base/releases{/id}","created_at":"2014-08-16T07:45:37Z","updated_at":"2015-04-21T20:29:36Z","pushed_at":"2015-12-07T01:14:16Z","git_url":"git://github.com/lsst/meas_base.git","ssh_url":"git@github.com:lsst/meas_base.git","clone_url":"https://github.com/lsst/meas_base.git","svn_url":"https://github.com/lsst/meas_base","homepage":"http://dm.lsst.org/","size":2422,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/28"},"html":{"href":"https://github.com/lsst/meas_base/pull/28"},"issue":{"href":"https://api.github.com/repos/lsst/meas_base/issues/28"},"comments":{"href":"https://api.github.com/repos/lsst/meas_base/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/meas_base/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/meas_base/statuses/77ac22c2ecfd88e75f5fb6861ef79d441a71d7a9"}}}}