{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/ip_isr/pulls/comments/65410010","id":65410010,"diff_hunk":"@@ -0,0 +1,228 @@\n+#\n+# LSST Data Management System\n+# Copyright 2016 AURA/LSST.\n+#\n+# This product includes software developed by the\n+# LSST Project (http://www.lsst.org/).\n+#\n+# This program is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the LSST License Statement and\n+# the GNU General Public License along with this program.  If not,\n+# see <http://www.lsstcorp.org/LegalNotices/>.\n+#\n+import abc\n+from itertools import izip\n+\n+import numpy as np\n+\n+from lsst.pipe.base import Struct\n+from .isrLib import applyLookupTable\n+\n+__all__ = [\"LinearizeBase\", \"LinearizeLookupTable\", \"LinearizeSquared\"]\n+\n+class LinearizeBase(object):\n+    \"\"\"Abstract base class functor for correcting non-linearity\n+    \"\"\"\n+    __metaclass__ = abc.ABCMeta\n+    LinearityType = None\n+\n+    @abc.abstractmethod\n+    def __call__(self, image, detector, log=None):\n+        \"\"\"Correct non-linearity\n+\n+        @param[in] image  image to be corrected (an lsst.afw.image.Image)\n+        @param[in] detector  detector information (an instance of lsst::afw::cameraGeom::Detector)\n+        @param[in] log  logger (an lsst.pex.logging.Log), or None to disable logging;\n+                    a warning is logged if amplifiers are skipped or other worrisome events occur\n+\n+        @return an lsst.pipe.base.Struct containing at least the following fields:\n+        - numAmps number of amplifiers found\n+        - numLinearized  number of amplifiers linearized","path":"python/lsst/ip/isr/linearize.py","position":49,"original_position":49,"commit_id":"3ba8393214272f98bd0129da3002c52755b85a9b","original_commit_id":"360892416cfdfeec3614ab4847fdc6cb1e47402f","user":{"login":"r-owen","id":874176,"avatar_url":"https://avatars.githubusercontent.com/u/874176?v=3","gravatar_id":"","url":"https://api.github.com/users/r-owen","html_url":"https://github.com/r-owen","followers_url":"https://api.github.com/users/r-owen/followers","following_url":"https://api.github.com/users/r-owen/following{/other_user}","gists_url":"https://api.github.com/users/r-owen/gists{/gist_id}","starred_url":"https://api.github.com/users/r-owen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-owen/subscriptions","organizations_url":"https://api.github.com/users/r-owen/orgs","repos_url":"https://api.github.com/users/r-owen/repos","events_url":"https://api.github.com/users/r-owen/events{/privacy}","received_events_url":"https://api.github.com/users/r-owen/received_events","type":"User","site_admin":false},"body":"You raise a good point, but I respectfully disagree with your conclusion. The heart of the problem is that there ought to be only one linearity type for the whole detector, but I know of no good way to represent table-wide properties in a catalog. A bad way is to use the table's metadata, but that is not type safe. Another alternative is to make linearity type a property of `Detector` instead of `AmpInfoCatalog`, but that separates related data. Of these three options, I prefer the one I chose.\r\n\r\nGetting back to the linearizer...I want to persist a whole detector's worth of lookup table for each linearizer. This feels logical to me, since the whole detector will be corrected in one pass through the ISR task, and strikes a good balance between persisting too much information in one blob (the whole focal plane worth of lookup tables) and too little (one amplifier's lookup table). Having done this, as a functor, I think it is logical for `__call__` to correct the whole CCD image. Finally, `Detector` contains some information that is useful, and it would be annoying to have to pass in both a detector and an amp info catalog.","created_at":"2016-06-01T17:52:55Z","updated_at":"2016-06-01T17:52:55Z","html_url":"https://github.com/lsst/ip_isr/pull/14#discussion_r65410010","pull_request_url":"https://api.github.com/repos/lsst/ip_isr/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/comments/65410010"},"html":{"href":"https://github.com/lsst/ip_isr/pull/14#discussion_r65410010"},"pull_request":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/ip_isr/pulls/14","id":71484239,"html_url":"https://github.com/lsst/ip_isr/pull/14","diff_url":"https://github.com/lsst/ip_isr/pull/14.diff","patch_url":"https://github.com/lsst/ip_isr/pull/14.patch","issue_url":"https://api.github.com/repos/lsst/ip_isr/issues/14","number":14,"state":"open","locked":false,"title":"Tickets/dm 5462","user":{"login":"r-owen","id":874176,"avatar_url":"https://avatars.githubusercontent.com/u/874176?v=3","gravatar_id":"","url":"https://api.github.com/users/r-owen","html_url":"https://github.com/r-owen","followers_url":"https://api.github.com/users/r-owen/followers","following_url":"https://api.github.com/users/r-owen/following{/other_user}","gists_url":"https://api.github.com/users/r-owen/gists{/gist_id}","starred_url":"https://api.github.com/users/r-owen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-owen/subscriptions","organizations_url":"https://api.github.com/users/r-owen/orgs","repos_url":"https://api.github.com/users/r-owen/repos","events_url":"https://api.github.com/users/r-owen/events{/privacy}","received_events_url":"https://api.github.com/users/r-owen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-26T00:31:16Z","updated_at":"2016-06-01T17:52:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"791f74f3b434a17ca202764c626f5cdb5677dd2a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lsst/ip_isr/pulls/14/commits","review_comments_url":"https://api.github.com/repos/lsst/ip_isr/pulls/14/comments","review_comment_url":"https://api.github.com/repos/lsst/ip_isr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/ip_isr/issues/14/comments","statuses_url":"https://api.github.com/repos/lsst/ip_isr/statuses/3ba8393214272f98bd0129da3002c52755b85a9b","head":{"label":"lsst:tickets/DM-5462","ref":"tickets/DM-5462","sha":"3ba8393214272f98bd0129da3002c52755b85a9b","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":23013323,"name":"ip_isr","full_name":"lsst/ip_isr","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/ip_isr","description":"LSST data management: instrument signature removal (detrending) for astronomical images","fork":false,"url":"https://api.github.com/repos/lsst/ip_isr","forks_url":"https://api.github.com/repos/lsst/ip_isr/forks","keys_url":"https://api.github.com/repos/lsst/ip_isr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/ip_isr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/ip_isr/teams","hooks_url":"https://api.github.com/repos/lsst/ip_isr/hooks","issue_events_url":"https://api.github.com/repos/lsst/ip_isr/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/ip_isr/events","assignees_url":"https://api.github.com/repos/lsst/ip_isr/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/ip_isr/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/ip_isr/tags","blobs_url":"https://api.github.com/repos/lsst/ip_isr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/ip_isr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/ip_isr/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/ip_isr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/ip_isr/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/ip_isr/languages","stargazers_url":"https://api.github.com/repos/lsst/ip_isr/stargazers","contributors_url":"https://api.github.com/repos/lsst/ip_isr/contributors","subscribers_url":"https://api.github.com/repos/lsst/ip_isr/subscribers","subscription_url":"https://api.github.com/repos/lsst/ip_isr/subscription","commits_url":"https://api.github.com/repos/lsst/ip_isr/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/ip_isr/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/ip_isr/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/ip_isr/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/ip_isr/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/ip_isr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/ip_isr/merges","archive_url":"https://api.github.com/repos/lsst/ip_isr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/ip_isr/downloads","issues_url":"https://api.github.com/repos/lsst/ip_isr/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/ip_isr/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/ip_isr/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/ip_isr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/ip_isr/labels{/name}","releases_url":"https://api.github.com/repos/lsst/ip_isr/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/ip_isr/deployments","created_at":"2014-08-16T07:44:21Z","updated_at":"2016-01-11T18:52:54Z","pushed_at":"2016-05-31T17:30:17Z","git_url":"git://github.com/lsst/ip_isr.git","ssh_url":"git@github.com:lsst/ip_isr.git","clone_url":"https://github.com/lsst/ip_isr.git","svn_url":"https://github.com/lsst/ip_isr","homepage":"http://dm.lsst.org/","size":2423,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"395f45557033baba5bc72ad42483856f98251aca","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":23013323,"name":"ip_isr","full_name":"lsst/ip_isr","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/ip_isr","description":"LSST data management: instrument signature removal (detrending) for astronomical images","fork":false,"url":"https://api.github.com/repos/lsst/ip_isr","forks_url":"https://api.github.com/repos/lsst/ip_isr/forks","keys_url":"https://api.github.com/repos/lsst/ip_isr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/ip_isr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/ip_isr/teams","hooks_url":"https://api.github.com/repos/lsst/ip_isr/hooks","issue_events_url":"https://api.github.com/repos/lsst/ip_isr/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/ip_isr/events","assignees_url":"https://api.github.com/repos/lsst/ip_isr/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/ip_isr/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/ip_isr/tags","blobs_url":"https://api.github.com/repos/lsst/ip_isr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/ip_isr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/ip_isr/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/ip_isr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/ip_isr/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/ip_isr/languages","stargazers_url":"https://api.github.com/repos/lsst/ip_isr/stargazers","contributors_url":"https://api.github.com/repos/lsst/ip_isr/contributors","subscribers_url":"https://api.github.com/repos/lsst/ip_isr/subscribers","subscription_url":"https://api.github.com/repos/lsst/ip_isr/subscription","commits_url":"https://api.github.com/repos/lsst/ip_isr/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/ip_isr/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/ip_isr/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/ip_isr/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/ip_isr/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/ip_isr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/ip_isr/merges","archive_url":"https://api.github.com/repos/lsst/ip_isr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/ip_isr/downloads","issues_url":"https://api.github.com/repos/lsst/ip_isr/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/ip_isr/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/ip_isr/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/ip_isr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/ip_isr/labels{/name}","releases_url":"https://api.github.com/repos/lsst/ip_isr/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/ip_isr/deployments","created_at":"2014-08-16T07:44:21Z","updated_at":"2016-01-11T18:52:54Z","pushed_at":"2016-05-31T17:30:17Z","git_url":"git://github.com/lsst/ip_isr.git","ssh_url":"git@github.com:lsst/ip_isr.git","clone_url":"https://github.com/lsst/ip_isr.git","svn_url":"https://github.com/lsst/ip_isr","homepage":"http://dm.lsst.org/","size":2423,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/14"},"html":{"href":"https://github.com/lsst/ip_isr/pull/14"},"issue":{"href":"https://api.github.com/repos/lsst/ip_isr/issues/14"},"comments":{"href":"https://api.github.com/repos/lsst/ip_isr/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/ip_isr/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/ip_isr/statuses/3ba8393214272f98bd0129da3002c52755b85a9b"}}}}
{"actor":{"display_login":"r-owen"}}