{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/obs_subaru/pulls/comments/66127933","id":66127933,"diff_hunk":"@@ -0,0 +1,97 @@\n+import os\n+import numbers\n+import unittest\n+\n+import lsst.utils.tests as utilsTests\n+import lsst.pipe.tasks.photoCal as photoCal\n+\n+class ColortermOverrideTestCase(unittest.TestCase):\n+    def setUp(self):\n+        \"\"\"Test that colorterms specific to HSC override correctly\"\"\"\n+        colortermsFile = os.path.join(os.environ[\"OBS_SUBARU_DIR\"],\"config\",\"hsc\",\"colorterms.py\")\n+        self.photoCalConf = photoCal.PhotoCalConfig()\n+        self.photoCalConf.colorterms.load(colortermsFile)\n+\n+    def testHSCColorterms(self):\n+        \"\"\"Test that the colorterm libraries are formatted correctly\"\"\"\n+        refBands = [\"g\",\"r\",\"i\",\"z\",\"y\"]\n+        hscBands = [\"g\",\"r\",\"i\",\"z\",\"y\"]\n+        for band in hscBands:\n+            ct = self.photoCalConf.colorterms.getColorterm(band, photoCatName=\"hsc\") # exact match\n+            self.assertTrue(ct.primary in refBands)\n+            self.assertTrue(ct.secondary in refBands)\n+            self.assertTrue(isinstance(ct.c0, numbers.Number))\n+            self.assertTrue(isinstance(ct.c1, numbers.Number))\n+            self.assertTrue(isinstance(ct.c2, numbers.Number))\n+\n+    def testHSCColortermG(self):\n+        \"\"\"Test that the 'g' colorterm matches the values in config/colorterms.py\"\"\" \n+        ctg = self.photoCalConf.colorterms.getColorterm(\"g\", photoCatName=\"hsc\") # exact match\n+        self.assertEqual(ctg.primary, \"g\")\n+        self.assertEqual(ctg.secondary, \"g\")\n+        self.assertEqual(ctg.c0, 0.0)\n+        self.assertEqual(ctg.c1, 0.0)\n+        self.assertEqual(ctg.c2, 0.0)\n+\n+    def testSDSSColorterms(self):\n+        \"\"\"Test that the colorterm libraries are formatted correctly\"\"\"\n+        sdssBands = [\"g\",\"r\",\"i\",\"z\",\"y\"]\n+        hscBands = [\"g\",\"r\",\"i\",\"i2\",\"z\",\"y\",\"N816\",\"N921\"]\n+        for band in hscBands:\n+            ct = self.photoCalConf.colorterms.getColorterm(band, photoCatName=\"sdss\") # exact match\n+            self.assertTrue(ct.primary in sdssBands)\n+            self.assertTrue(ct.secondary in sdssBands)\n+            self.assertTrue(isinstance(ct.c0, numbers.Number))\n+            self.assertTrue(isinstance(ct.c1, numbers.Number))\n+            self.assertTrue(isinstance(ct.c2, numbers.Number))\n+\n+    def testHSCColortermG(self):\n+        \"\"\"Test that the 'N816' colorterm matches the values in config/colorterms.py\"\"\" \n+        ctn816 = self.photoCalConf.colorterms.getColorterm(\"N816\", photoCatName=\"sdss\") # exact match\n+        self.assertEqual(ctn816.primary, \"i\")\n+        self.assertEqual(ctn816.secondary, \"z\")\n+        self.assertEqual(ctn816.c0, 0.00927133)\n+        self.assertEqual(ctn816.c1, -0.63558358)\n+        self.assertEqual(ctn816.c2, -0.05474862)\n+\n+    def testPS1Colorterms(self):\n+        \"\"\"Test that the colorterm libraries are formatted correctly\"\"\"\n+        ps1Bands = [\"g\",\"r\",\"i\",\"z\",\"y\"]\n+        hscBands = [\"g\",\"r\",\"i\",\"i2\",\"z\",\"y\",\"N816\",\"N921\"]\n+        for band in hscBands:\n+            ct = self.photoCalConf.colorterms.getColorterm(band, photoCatName=\"ps1\") # exact match\n+            self.assertTrue(ct.primary in ps1Bands)\n+            self.assertTrue(ct.secondary in ps1Bands)\n+            self.assertTrue(isinstance(ct.c0, numbers.Number))\n+            self.assertTrue(isinstance(ct.c1, numbers.Number))\n+            self.assertTrue(isinstance(ct.c2, numbers.Number))","path":"tests/testHSCColorterms.py","position":67,"original_position":67,"commit_id":"58051033da245844b8919c08a5d41ddd490bc056","original_commit_id":"58051033da245844b8919c08a5d41ddd490bc056","user":{"login":"pschella","id":211955,"avatar_url":"https://avatars.githubusercontent.com/u/211955?v=3","gravatar_id":"","url":"https://api.github.com/users/pschella","html_url":"https://github.com/pschella","followers_url":"https://api.github.com/users/pschella/followers","following_url":"https://api.github.com/users/pschella/following{/other_user}","gists_url":"https://api.github.com/users/pschella/gists{/gist_id}","starred_url":"https://api.github.com/users/pschella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschella/subscriptions","organizations_url":"https://api.github.com/users/pschella/orgs","repos_url":"https://api.github.com/users/pschella/repos","events_url":"https://api.github.com/users/pschella/events{/privacy}","received_events_url":"https://api.github.com/users/pschella/received_events","type":"User","site_admin":false},"body":"Use `assertIsInstance`","created_at":"2016-06-07T18:36:29Z","updated_at":"2016-06-07T18:36:29Z","html_url":"https://github.com/lsst/obs_subaru/pull/27#discussion_r66127933","pull_request_url":"https://api.github.com/repos/lsst/obs_subaru/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/comments/66127933"},"html":{"href":"https://github.com/lsst/obs_subaru/pull/27#discussion_r66127933"},"pull_request":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/obs_subaru/pulls/27","id":72912229,"html_url":"https://github.com/lsst/obs_subaru/pull/27","diff_url":"https://github.com/lsst/obs_subaru/pull/27.diff","patch_url":"https://github.com/lsst/obs_subaru/pull/27.patch","issue_url":"https://api.github.com/repos/lsst/obs_subaru/issues/27","number":27,"state":"open","locked":false,"title":"Review for DM-2837","user":{"login":"pschella","id":211955,"avatar_url":"https://avatars.githubusercontent.com/u/211955?v=3","gravatar_id":"","url":"https://api.github.com/users/pschella","html_url":"https://github.com/pschella","followers_url":"https://api.github.com/users/pschella/followers","following_url":"https://api.github.com/users/pschella/following{/other_user}","gists_url":"https://api.github.com/users/pschella/gists{/gist_id}","starred_url":"https://api.github.com/users/pschella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschella/subscriptions","organizations_url":"https://api.github.com/users/pschella/orgs","repos_url":"https://api.github.com/users/pschella/repos","events_url":"https://api.github.com/users/pschella/events{/privacy}","received_events_url":"https://api.github.com/users/pschella/received_events","type":"User","site_admin":false},"body":"HSC override correctly. The unittest ensures that\r\n1. The colorterms provided in config/colorterms.py are formatted\r\n   correctly, and\r\n2. The actual values read in match the values in config/colorterms.py\r\n   for a given filter.","created_at":"2016-06-07T17:03:28Z","updated_at":"2016-06-07T18:36:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60b0fd9a68ad7e15152ccaeab018857fa67fdbb2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lsst/obs_subaru/pulls/27/commits","review_comments_url":"https://api.github.com/repos/lsst/obs_subaru/pulls/27/comments","review_comment_url":"https://api.github.com/repos/lsst/obs_subaru/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/obs_subaru/issues/27/comments","statuses_url":"https://api.github.com/repos/lsst/obs_subaru/statuses/58051033da245844b8919c08a5d41ddd490bc056","head":{"label":"lsst:tickets/DM-2837","ref":"tickets/DM-2837","sha":"58051033da245844b8919c08a5d41ddd490bc056","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":23013426,"name":"obs_subaru","full_name":"lsst/obs_subaru","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/obs_subaru","description":"Subaru-specific (hsc,  hscSim, suprimecam) configuration and tasks for the LSST Data Management Stack","fork":false,"url":"https://api.github.com/repos/lsst/obs_subaru","forks_url":"https://api.github.com/repos/lsst/obs_subaru/forks","keys_url":"https://api.github.com/repos/lsst/obs_subaru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/obs_subaru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/obs_subaru/teams","hooks_url":"https://api.github.com/repos/lsst/obs_subaru/hooks","issue_events_url":"https://api.github.com/repos/lsst/obs_subaru/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/obs_subaru/events","assignees_url":"https://api.github.com/repos/lsst/obs_subaru/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/obs_subaru/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/obs_subaru/tags","blobs_url":"https://api.github.com/repos/lsst/obs_subaru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/obs_subaru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/obs_subaru/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/obs_subaru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/obs_subaru/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/obs_subaru/languages","stargazers_url":"https://api.github.com/repos/lsst/obs_subaru/stargazers","contributors_url":"https://api.github.com/repos/lsst/obs_subaru/contributors","subscribers_url":"https://api.github.com/repos/lsst/obs_subaru/subscribers","subscription_url":"https://api.github.com/repos/lsst/obs_subaru/subscription","commits_url":"https://api.github.com/repos/lsst/obs_subaru/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/obs_subaru/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/obs_subaru/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/obs_subaru/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/obs_subaru/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/obs_subaru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/obs_subaru/merges","archive_url":"https://api.github.com/repos/lsst/obs_subaru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/obs_subaru/downloads","issues_url":"https://api.github.com/repos/lsst/obs_subaru/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/obs_subaru/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/obs_subaru/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/obs_subaru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/obs_subaru/labels{/name}","releases_url":"https://api.github.com/repos/lsst/obs_subaru/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/obs_subaru/deployments","created_at":"2014-08-16T07:48:38Z","updated_at":"2016-01-29T18:04:11Z","pushed_at":"2016-06-07T18:27:06Z","git_url":"git://github.com/lsst/obs_subaru.git","ssh_url":"git@github.com:lsst/obs_subaru.git","clone_url":"https://github.com/lsst/obs_subaru.git","svn_url":"https://github.com/lsst/obs_subaru","homepage":"","size":72463,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"ff977a9a78fce26b95c6d8a8e23500fa458e083d","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":23013426,"name":"obs_subaru","full_name":"lsst/obs_subaru","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/obs_subaru","description":"Subaru-specific (hsc,  hscSim, suprimecam) configuration and tasks for the LSST Data Management Stack","fork":false,"url":"https://api.github.com/repos/lsst/obs_subaru","forks_url":"https://api.github.com/repos/lsst/obs_subaru/forks","keys_url":"https://api.github.com/repos/lsst/obs_subaru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/obs_subaru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/obs_subaru/teams","hooks_url":"https://api.github.com/repos/lsst/obs_subaru/hooks","issue_events_url":"https://api.github.com/repos/lsst/obs_subaru/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/obs_subaru/events","assignees_url":"https://api.github.com/repos/lsst/obs_subaru/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/obs_subaru/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/obs_subaru/tags","blobs_url":"https://api.github.com/repos/lsst/obs_subaru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/obs_subaru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/obs_subaru/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/obs_subaru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/obs_subaru/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/obs_subaru/languages","stargazers_url":"https://api.github.com/repos/lsst/obs_subaru/stargazers","contributors_url":"https://api.github.com/repos/lsst/obs_subaru/contributors","subscribers_url":"https://api.github.com/repos/lsst/obs_subaru/subscribers","subscription_url":"https://api.github.com/repos/lsst/obs_subaru/subscription","commits_url":"https://api.github.com/repos/lsst/obs_subaru/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/obs_subaru/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/obs_subaru/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/obs_subaru/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/obs_subaru/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/obs_subaru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/obs_subaru/merges","archive_url":"https://api.github.com/repos/lsst/obs_subaru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/obs_subaru/downloads","issues_url":"https://api.github.com/repos/lsst/obs_subaru/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/obs_subaru/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/obs_subaru/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/obs_subaru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/obs_subaru/labels{/name}","releases_url":"https://api.github.com/repos/lsst/obs_subaru/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/obs_subaru/deployments","created_at":"2014-08-16T07:48:38Z","updated_at":"2016-01-29T18:04:11Z","pushed_at":"2016-06-07T18:27:06Z","git_url":"git://github.com/lsst/obs_subaru.git","ssh_url":"git@github.com:lsst/obs_subaru.git","clone_url":"https://github.com/lsst/obs_subaru.git","svn_url":"https://github.com/lsst/obs_subaru","homepage":"","size":72463,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/27"},"html":{"href":"https://github.com/lsst/obs_subaru/pull/27"},"issue":{"href":"https://api.github.com/repos/lsst/obs_subaru/issues/27"},"comments":{"href":"https://api.github.com/repos/lsst/obs_subaru/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/obs_subaru/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/obs_subaru/statuses/58051033da245844b8919c08a5d41ddd490bc056"}}}}
{"actor":{"display_login":"pschella"}}