{"action":"created","comment":{"url":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments/209454059","pull_request_review_id":145473407,"id":209454059,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTQ1NDA1OQ==","diff_hunk":"@@ -426,6 +439,255 @@ def setup_arcparam(self, arcparam, disperser=None, fitstbl=None, arc_idx=None,\n         else:\n             msgs.error('Not ready for this disperser {:s}!'.format(disperser))\n \n+    def get_slitmask(self, filename):\n+        hdu = fits.open(filename)\n+        corners = np.array([hdu['BluSlits'].data['slitX1'],\n+                            hdu['BluSlits'].data['slitY1'],\n+                            hdu['BluSlits'].data['slitX2'],\n+                            hdu['BluSlits'].data['slitY2'],\n+                            hdu['BluSlits'].data['slitX3'],\n+                            hdu['BluSlits'].data['slitY3'],\n+                            hdu['BluSlits'].data['slitX4'],\n+                            hdu['BluSlits'].data['slitY4']]).T.reshape(-1,4,2)\n+        self.slitmask = SlitMask(corners, slitid=hdu['BluSlits'].data['dSlitId'])\n+        return self.slitmask\n+\n+    def get_grating(self, filename):\n+        \"\"\"\n+        Take from xidl/DEEP2/spec2d/pro/deimos_omodel.pro and\n+        xidl/DEEP2/spec2d/pro/deimos_grating.pro\n+        \"\"\"\n+        hdu = fits.open(filename)\n+\n+        # Grating slider\n+        slider = hdu[0].header['GRATEPOS']\n+        # TODO: Add test for slider\n+\n+        # Central wavelength, grating angle, and tilt position\n+        if slider == 3:\n+            central_wave = hdu[0].header['G3TLTWAV']\n+            # Not used\n+            #angle = (hdu[0].header['G3TLTRAW'] + 29094)/2500\n+            tilt = hdu[0].header['G3TLTVAL']\n+        else:","path":"pypeit/spectrographs/keck_deimos.py","position":69,"original_position":69,"commit_id":"5685affd873e08c7be8e803887274648e2916651","original_commit_id":"5685affd873e08c7be8e803887274648e2916651","user":{"login":"profxj","id":3998093,"node_id":"MDQ6VXNlcjM5OTgwOTM=","avatar_url":"https://avatars2.githubusercontent.com/u/3998093?v=4","gravatar_id":"","url":"https://api.github.com/users/profxj","html_url":"https://github.com/profxj","followers_url":"https://api.github.com/users/profxj/followers","following_url":"https://api.github.com/users/profxj/following{/other_user}","gists_url":"https://api.github.com/users/profxj/gists{/gist_id}","starred_url":"https://api.github.com/users/profxj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/profxj/subscriptions","organizations_url":"https://api.github.com/users/profxj/orgs","repos_url":"https://api.github.com/users/profxj/repos","events_url":"https://api.github.com/users/profxj/events{/privacy}","received_events_url":"https://api.github.com/users/profxj/received_events","type":"User","site_admin":false},"body":"should we make this \r\n\r\n``` \r\nelif slider in [2,4]:\r\n```\r\n\r\nand than have an `else` catching any unexpected value?","created_at":"2018-08-12T12:46:55Z","updated_at":"2018-08-12T12:51:21Z","html_url":"https://github.com/pypeit/PypeIt/pull/437#discussion_r209454059","pull_request_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/437","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments/209454059"},"html":{"href":"https://github.com/pypeit/PypeIt/pull/437#discussion_r209454059"},"pull_request":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/437"}}},"pull_request":{"url":"https://api.github.com/repos/pypeit/PypeIt/pulls/437","id":207667852,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NjY3ODUy","html_url":"https://github.com/pypeit/PypeIt/pull/437","diff_url":"https://github.com/pypeit/PypeIt/pull/437.diff","patch_url":"https://github.com/pypeit/PypeIt/pull/437.patch","issue_url":"https://api.github.com/repos/pypeit/PypeIt/issues/437","number":437,"state":"open","locked":false,"title":"DEIMOS Optical Model","user":{"login":"kbwestfall","id":15785898,"node_id":"MDQ6VXNlcjE1Nzg1ODk4","avatar_url":"https://avatars2.githubusercontent.com/u/15785898?v=4","gravatar_id":"","url":"https://api.github.com/users/kbwestfall","html_url":"https://github.com/kbwestfall","followers_url":"https://api.github.com/users/kbwestfall/followers","following_url":"https://api.github.com/users/kbwestfall/following{/other_user}","gists_url":"https://api.github.com/users/kbwestfall/gists{/gist_id}","starred_url":"https://api.github.com/users/kbwestfall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbwestfall/subscriptions","organizations_url":"https://api.github.com/users/kbwestfall/orgs","repos_url":"https://api.github.com/users/kbwestfall/repos","events_url":"https://api.github.com/users/kbwestfall/events{/privacy}","received_events_url":"https://api.github.com/users/kbwestfall/received_events","type":"User","site_admin":false},"body":"This may have been more trouble than it's worth, but I've finished transcribing the IDL code with the DEIMOS optical model.  This was the first step in checking the slit locations found by pypeit against their expected positions from the slit mask.  I'll be working on the details of that checking toward the end of next week.  This PR doesn't actually touch anything executed in PypeIt yet, it just introduces the abstract classes and the specific classes used for DEIMOS.  Changes are largely confined to files in the `pypeit/spectrographs` directory.  I should spend some more time documenting the classes/functions, but the code is ready to go.\r\n\r\nChanges include:\r\n\r\n - Implementation of `SlitMask` class\r\n - Implementation of `DetectorMap` class\r\n - Implementation of `OpticalModel` class\r\n - Changes to `KeckDEIMOSSpectrograph` class to use the above\r\n - Includes unit tests for all of the above\r\n - Adds the notebook [here](https://github.com/pypeit/PypeIt/blob/match_mask/doc/nb/DEIMOSOpticalModel.ipynb) that demos how these can be used\r\n\r\nTests pass.","created_at":"2018-08-10T16:52:12Z","updated_at":"2018-08-12T12:51:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"181975ee872c7293ecc3eeab6025db27556df4c8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jhennawi","id":8774563,"node_id":"MDQ6VXNlcjg3NzQ1NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8774563?v=4","gravatar_id":"","url":"https://api.github.com/users/jhennawi","html_url":"https://github.com/jhennawi","followers_url":"https://api.github.com/users/jhennawi/followers","following_url":"https://api.github.com/users/jhennawi/following{/other_user}","gists_url":"https://api.github.com/users/jhennawi/gists{/gist_id}","starred_url":"https://api.github.com/users/jhennawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhennawi/subscriptions","organizations_url":"https://api.github.com/users/jhennawi/orgs","repos_url":"https://api.github.com/users/jhennawi/repos","events_url":"https://api.github.com/users/jhennawi/events{/privacy}","received_events_url":"https://api.github.com/users/jhennawi/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/437/commits","review_comments_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/437/comments","review_comment_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypeit/PypeIt/issues/437/comments","statuses_url":"https://api.github.com/repos/pypeit/PypeIt/statuses/5685affd873e08c7be8e803887274648e2916651","head":{"label":"pypeit:match_mask","ref":"match_mask","sha":"5685affd873e08c7be8e803887274648e2916651","user":{"login":"pypeit","id":41153172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTUzMTcy","avatar_url":"https://avatars1.githubusercontent.com/u/41153172?v=4","gravatar_id":"","url":"https://api.github.com/users/pypeit","html_url":"https://github.com/pypeit","followers_url":"https://api.github.com/users/pypeit/followers","following_url":"https://api.github.com/users/pypeit/following{/other_user}","gists_url":"https://api.github.com/users/pypeit/gists{/gist_id}","starred_url":"https://api.github.com/users/pypeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypeit/subscriptions","organizations_url":"https://api.github.com/users/pypeit/orgs","repos_url":"https://api.github.com/users/pypeit/repos","events_url":"https://api.github.com/users/pypeit/events{/privacy}","received_events_url":"https://api.github.com/users/pypeit/received_events","type":"Organization","site_admin":false},"repo":{"id":36958428,"node_id":"MDEwOlJlcG9zaXRvcnkzNjk1ODQyOA==","name":"PypeIt","full_name":"pypeit/PypeIt","owner":{"login":"pypeit","id":41153172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTUzMTcy","avatar_url":"https://avatars1.githubusercontent.com/u/41153172?v=4","gravatar_id":"","url":"https://api.github.com/users/pypeit","html_url":"https://github.com/pypeit","followers_url":"https://api.github.com/users/pypeit/followers","following_url":"https://api.github.com/users/pypeit/following{/other_user}","gists_url":"https://api.github.com/users/pypeit/gists{/gist_id}","starred_url":"https://api.github.com/users/pypeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypeit/subscriptions","organizations_url":"https://api.github.com/users/pypeit/orgs","repos_url":"https://api.github.com/users/pypeit/repos","events_url":"https://api.github.com/users/pypeit/events{/privacy}","received_events_url":"https://api.github.com/users/pypeit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypeit/PypeIt","description":"The Python Spectroscopic Data Reduction Pipeline","fork":false,"url":"https://api.github.com/repos/pypeit/PypeIt","forks_url":"https://api.github.com/repos/pypeit/PypeIt/forks","keys_url":"https://api.github.com/repos/pypeit/PypeIt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypeit/PypeIt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypeit/PypeIt/teams","hooks_url":"https://api.github.com/repos/pypeit/PypeIt/hooks","issue_events_url":"https://api.github.com/repos/pypeit/PypeIt/issues/events{/number}","events_url":"https://api.github.com/repos/pypeit/PypeIt/events","assignees_url":"https://api.github.com/repos/pypeit/PypeIt/assignees{/user}","branches_url":"https://api.github.com/repos/pypeit/PypeIt/branches{/branch}","tags_url":"https://api.github.com/repos/pypeit/PypeIt/tags","blobs_url":"https://api.github.com/repos/pypeit/PypeIt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypeit/PypeIt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypeit/PypeIt/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypeit/PypeIt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypeit/PypeIt/statuses/{sha}","languages_url":"https://api.github.com/repos/pypeit/PypeIt/languages","stargazers_url":"https://api.github.com/repos/pypeit/PypeIt/stargazers","contributors_url":"https://api.github.com/repos/pypeit/PypeIt/contributors","subscribers_url":"https://api.github.com/repos/pypeit/PypeIt/subscribers","subscription_url":"https://api.github.com/repos/pypeit/PypeIt/subscription","commits_url":"https://api.github.com/repos/pypeit/PypeIt/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypeit/PypeIt/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypeit/PypeIt/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypeit/PypeIt/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypeit/PypeIt/contents/{+path}","compare_url":"https://api.github.com/repos/pypeit/PypeIt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypeit/PypeIt/merges","archive_url":"https://api.github.com/repos/pypeit/PypeIt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypeit/PypeIt/downloads","issues_url":"https://api.github.com/repos/pypeit/PypeIt/issues{/number}","pulls_url":"https://api.github.com/repos/pypeit/PypeIt/pulls{/number}","milestones_url":"https://api.github.com/repos/pypeit/PypeIt/milestones{/number}","notifications_url":"https://api.github.com/repos/pypeit/PypeIt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypeit/PypeIt/labels{/name}","releases_url":"https://api.github.com/repos/pypeit/PypeIt/releases{/id}","deployments_url":"https://api.github.com/repos/pypeit/PypeIt/deployments","created_at":"2015-06-05T22:25:37Z","updated_at":"2018-08-08T14:52:00Z","pushed_at":"2018-08-11T12:49:41Z","git_url":"git://github.com/pypeit/PypeIt.git","ssh_url":"git@github.com:pypeit/PypeIt.git","clone_url":"https://github.com/pypeit/PypeIt.git","svn_url":"https://github.com/pypeit/PypeIt","homepage":null,"size":31749,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":89,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":12,"open_issues":89,"watchers":13,"default_branch":"master"}},"base":{"label":"pypeit:master","ref":"master","sha":"1deed73e89bc0c94b29d8e00bc910cbeec301007","user":{"login":"pypeit","id":41153172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTUzMTcy","avatar_url":"https://avatars1.githubusercontent.com/u/41153172?v=4","gravatar_id":"","url":"https://api.github.com/users/pypeit","html_url":"https://github.com/pypeit","followers_url":"https://api.github.com/users/pypeit/followers","following_url":"https://api.github.com/users/pypeit/following{/other_user}","gists_url":"https://api.github.com/users/pypeit/gists{/gist_id}","starred_url":"https://api.github.com/users/pypeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypeit/subscriptions","organizations_url":"https://api.github.com/users/pypeit/orgs","repos_url":"https://api.github.com/users/pypeit/repos","events_url":"https://api.github.com/users/pypeit/events{/privacy}","received_events_url":"https://api.github.com/users/pypeit/received_events","type":"Organization","site_admin":false},"repo":{"id":36958428,"node_id":"MDEwOlJlcG9zaXRvcnkzNjk1ODQyOA==","name":"PypeIt","full_name":"pypeit/PypeIt","owner":{"login":"pypeit","id":41153172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMTUzMTcy","avatar_url":"https://avatars1.githubusercontent.com/u/41153172?v=4","gravatar_id":"","url":"https://api.github.com/users/pypeit","html_url":"https://github.com/pypeit","followers_url":"https://api.github.com/users/pypeit/followers","following_url":"https://api.github.com/users/pypeit/following{/other_user}","gists_url":"https://api.github.com/users/pypeit/gists{/gist_id}","starred_url":"https://api.github.com/users/pypeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypeit/subscriptions","organizations_url":"https://api.github.com/users/pypeit/orgs","repos_url":"https://api.github.com/users/pypeit/repos","events_url":"https://api.github.com/users/pypeit/events{/privacy}","received_events_url":"https://api.github.com/users/pypeit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypeit/PypeIt","description":"The Python Spectroscopic Data Reduction Pipeline","fork":false,"url":"https://api.github.com/repos/pypeit/PypeIt","forks_url":"https://api.github.com/repos/pypeit/PypeIt/forks","keys_url":"https://api.github.com/repos/pypeit/PypeIt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypeit/PypeIt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypeit/PypeIt/teams","hooks_url":"https://api.github.com/repos/pypeit/PypeIt/hooks","issue_events_url":"https://api.github.com/repos/pypeit/PypeIt/issues/events{/number}","events_url":"https://api.github.com/repos/pypeit/PypeIt/events","assignees_url":"https://api.github.com/repos/pypeit/PypeIt/assignees{/user}","branches_url":"https://api.github.com/repos/pypeit/PypeIt/branches{/branch}","tags_url":"https://api.github.com/repos/pypeit/PypeIt/tags","blobs_url":"https://api.github.com/repos/pypeit/PypeIt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypeit/PypeIt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypeit/PypeIt/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypeit/PypeIt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypeit/PypeIt/statuses/{sha}","languages_url":"https://api.github.com/repos/pypeit/PypeIt/languages","stargazers_url":"https://api.github.com/repos/pypeit/PypeIt/stargazers","contributors_url":"https://api.github.com/repos/pypeit/PypeIt/contributors","subscribers_url":"https://api.github.com/repos/pypeit/PypeIt/subscribers","subscription_url":"https://api.github.com/repos/pypeit/PypeIt/subscription","commits_url":"https://api.github.com/repos/pypeit/PypeIt/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypeit/PypeIt/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypeit/PypeIt/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypeit/PypeIt/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypeit/PypeIt/contents/{+path}","compare_url":"https://api.github.com/repos/pypeit/PypeIt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypeit/PypeIt/merges","archive_url":"https://api.github.com/repos/pypeit/PypeIt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypeit/PypeIt/downloads","issues_url":"https://api.github.com/repos/pypeit/PypeIt/issues{/number}","pulls_url":"https://api.github.com/repos/pypeit/PypeIt/pulls{/number}","milestones_url":"https://api.github.com/repos/pypeit/PypeIt/milestones{/number}","notifications_url":"https://api.github.com/repos/pypeit/PypeIt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypeit/PypeIt/labels{/name}","releases_url":"https://api.github.com/repos/pypeit/PypeIt/releases{/id}","deployments_url":"https://api.github.com/repos/pypeit/PypeIt/deployments","created_at":"2015-06-05T22:25:37Z","updated_at":"2018-08-08T14:52:00Z","pushed_at":"2018-08-11T12:49:41Z","git_url":"git://github.com/pypeit/PypeIt.git","ssh_url":"git@github.com:pypeit/PypeIt.git","clone_url":"https://github.com/pypeit/PypeIt.git","svn_url":"https://github.com/pypeit/PypeIt","homepage":null,"size":31749,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":89,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":12,"open_issues":89,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/437"},"html":{"href":"https://github.com/pypeit/PypeIt/pull/437"},"issue":{"href":"https://api.github.com/repos/pypeit/PypeIt/issues/437"},"comments":{"href":"https://api.github.com/repos/pypeit/PypeIt/issues/437/comments"},"review_comments":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/437/comments"},"review_comment":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/437/commits"},"statuses":{"href":"https://api.github.com/repos/pypeit/PypeIt/statuses/5685affd873e08c7be8e803887274648e2916651"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"profxj"}}