{"action":"created","comment":{"url":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments/219863551","pull_request_review_id":158138959,"id":219863551,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTg2MzU1MQ==","diff_hunk":"@@ -28,8 +29,10 @@\n import scipy\n \n \n-def fit_flat(flat, mstilts, thismask, slit_left, slit_righ, inmask = None,spec_samp_fine = 1.2,  spec_samp_coarse = 50.0,\n-             spat_samp = 5.0, spat_illum_thresh = 0.01, npoly = None, trim_edg = (3.0,3.0),debug = False):\n+\n+def fit_flat(flat, tilts_dict, thismask_in, slit_left_in, slit_righ_in, inmask = None,spec_samp_fine = 1.2, spec_samp_coarse = 50.0,","path":"pypeit/core/flat.py","position":null,"original_position":15,"commit_id":"b79bb2f914254e27bd188ff333f59ca5f01f6aae","original_commit_id":"599569d10b643e8177ab289e8ff18c5a0fcc52bf","user":{"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},"body":"I broke our the slit tweaking. I'm leaving the debug/QA stuff where it is because this may end up being subprocess plot in interactive mode. If that is the case, it needs to be defined in the function as with the other interactive subprocess plots. If we dump this out to QA and don't plot to the screen then it could go into a separate function later. ","created_at":"2018-09-24T14:45:03Z","updated_at":"2018-09-24T14:45:03Z","html_url":"https://github.com/pypeit/PypeIt/pull/508#discussion_r219863551","pull_request_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/508","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments/219863551"},"html":{"href":"https://github.com/pypeit/PypeIt/pull/508#discussion_r219863551"},"pull_request":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/508"}},"in_reply_to_id":219705854},"pull_request":{"url":"https://api.github.com/repos/pypeit/PypeIt/pulls/508","id":217517983,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NTE3OTgz","html_url":"https://github.com/pypeit/PypeIt/pull/508","diff_url":"https://github.com/pypeit/PypeIt/pull/508.diff","patch_url":"https://github.com/pypeit/PypeIt/pull/508.patch","issue_url":"https://api.github.com/repos/pypeit/PypeIt/issues/508","number":508,"state":"open","locked":false,"title":"slit boundary tweaks","user":{"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},"body":"This PR implements changes to the flat field routine to allow the slit/order boundaries to be tweaked. The TraceSlits class does a nice job of finding slits, but the boundaries are too liberal. This is typical when one is tracing a sawtooth filtered image. The flat field routines create a slit/order illumination profile, which can then be used to determine a more meaningful set of slit boundaries. This dramatically improves the quality of the reductions. \r\n\r\nThis was not a trivial thing to implement. The actual tweaks are easy, but the point is that the flat field code runs downstream in calibrations from the codes that generate slits and tilts. As such, the previous slits and tilts need to be updated by the flat routine, as do the master files etc. I've implemented this in a sensible way, but it required that I touch many different parts of the calibration routines. \r\n\r\nThere are some other things in here related to X-shoote development. They probably don't belong in this PR, but X-shooter is still under development so this does not break anything.\r\n\r\nI also need to pull in PR #503 because I needed to check that NIRES was working properly and that PR was a fix to NIRES. So this PR should be merged after 503 clears. \r\n","created_at":"2018-09-23T16:27:38Z","updated_at":"2018-09-24T14:45:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7559540957b1e3b430c8ff3952415564936b46c4","assignee":null,"assignees":[],"requested_reviewers":[{"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}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/508/commits","review_comments_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/508/comments","review_comment_url":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypeit/PypeIt/issues/508/comments","statuses_url":"https://api.github.com/repos/pypeit/PypeIt/statuses/b79bb2f914254e27bd188ff333f59ca5f01f6aae","head":{"label":"pypeit:slit_edg_japan","ref":"slit_edg_japan","sha":"b79bb2f914254e27bd188ff333f59ca5f01f6aae","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","private":false,"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},"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-09-15T21:47:09Z","pushed_at":"2018-09-24T14:31:26Z","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":33617,"stargazers_count":16,"watchers_count":16,"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":98,"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":98,"watchers":16,"default_branch":"master"}},"base":{"label":"pypeit:master","ref":"master","sha":"570a20c833a97c944d0094db9cb5d6c691999517","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","private":false,"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},"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-09-15T21:47:09Z","pushed_at":"2018-09-24T14:31:26Z","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":33617,"stargazers_count":16,"watchers_count":16,"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":98,"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":98,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/508"},"html":{"href":"https://github.com/pypeit/PypeIt/pull/508"},"issue":{"href":"https://api.github.com/repos/pypeit/PypeIt/issues/508"},"comments":{"href":"https://api.github.com/repos/pypeit/PypeIt/issues/508/comments"},"review_comments":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/508/comments"},"review_comment":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypeit/PypeIt/pulls/508/commits"},"statuses":{"href":"https://api.github.com/repos/pypeit/PypeIt/statuses/b79bb2f914254e27bd188ff333f59ca5f01f6aae"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jhennawi"}}