{"action":"opened","number":24,"pull_request":{"url":"https://api.github.com/repos/rmjarvis/Piff/pulls/24","id":74536683,"html_url":"https://github.com/rmjarvis/Piff/pull/24","diff_url":"https://github.com/rmjarvis/Piff/pull/24.diff","patch_url":"https://github.com/rmjarvis/Piff/pull/24.patch","issue_url":"https://api.github.com/repos/rmjarvis/Piff/issues/24","number":24,"state":"open","locked":false,"title":"Nearest Neighbors Interpolation and DECam Wavefronts","user":{"login":"cpadavis","id":1781988,"avatar_url":"https://avatars.githubusercontent.com/u/1781988?v=3","gravatar_id":"","url":"https://api.github.com/users/cpadavis","html_url":"https://github.com/cpadavis","followers_url":"https://api.github.com/users/cpadavis/followers","following_url":"https://api.github.com/users/cpadavis/following{/other_user}","gists_url":"https://api.github.com/users/cpadavis/gists{/gist_id}","starred_url":"https://api.github.com/users/cpadavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpadavis/subscriptions","organizations_url":"https://api.github.com/users/cpadavis/orgs","repos_url":"https://api.github.com/users/cpadavis/repos","events_url":"https://api.github.com/users/cpadavis/events{/privacy}","received_events_url":"https://api.github.com/users/cpadavis/received_events","type":"User","site_admin":false},"body":"(Trying to do the optics model pull requests in a modular fashion. There will be a PR for the interpolation, a PR for the optics model itself, and a PR for fitting the wavefront.)\r\n\r\nIn order to to do the optics model, I need to be able to pull zernike coefficients from the wavefront data. The way we've done this in the past was with a k-nearest neighbors regression to a set of reference wavefronts. Therefore I have created two new classes:\r\n\r\n1. kNNInterp, which is a fairly generic interpolation class. It is set up so you can use it to perform nearest neighbors interpolation (via sklearn) for any starfit parameters. When initializing it, you specify attr_interp, which pulls from star.data.properties, and attr_target, which pulls from star.fit.params for the values which we interpolate to. I had some difficulty deciding how to go about the starfit parameters, since we specify that params are 1d arrays. \r\n\r\n2. DECamWavefront, for which you feed in a reference wavefront. When you feed stars, it looks for 'focal_x' and 'focal_y' and returns the params, which are the zernike coefficients such that params[0] = defocus.\r\n\r\nIn order to do the wavefront portion of this PR, I needed to add code that specifies how to go from pixel and ccdnum to focal plane position. This is encapsulated in pixel_to_focal and also required me adding the decaminfo object (which is in decamutil.py), which as several useful conversions from pixel to focal plane for ccdnum or extension name. That piece is pretty poorly coded, but I suspect we'll want to throw it out anyways and do any such conversions via wcs or something else a little more formal.\r\n\r\nI also have added some unit tests and a reference wavefront from 2012 to facilitate the tests.\r\n\r\n\r\nI am _very_ eager for your comments improving this!!","created_at":"2016-06-21T00:55:25Z","updated_at":"2016-06-21T00:55:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rmjarvis/Piff/pulls/24/commits","review_comments_url":"https://api.github.com/repos/rmjarvis/Piff/pulls/24/comments","review_comment_url":"https://api.github.com/repos/rmjarvis/Piff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rmjarvis/Piff/issues/24/comments","statuses_url":"https://api.github.com/repos/rmjarvis/Piff/statuses/1ba46de232bd4f074d12966bfcbf28a75638cf7d","head":{"label":"rmjarvis:knn_interpolation","ref":"knn_interpolation","sha":"1ba46de232bd4f074d12966bfcbf28a75638cf7d","user":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"repo":{"id":52539402,"name":"Piff","full_name":"rmjarvis/Piff","owner":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmjarvis/Piff","description":"PSFs In the Full FOV.  A software package for modeling the point-spread function (PSF) across the full field of view (FOV).  Documentation:","fork":false,"url":"https://api.github.com/repos/rmjarvis/Piff","forks_url":"https://api.github.com/repos/rmjarvis/Piff/forks","keys_url":"https://api.github.com/repos/rmjarvis/Piff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmjarvis/Piff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmjarvis/Piff/teams","hooks_url":"https://api.github.com/repos/rmjarvis/Piff/hooks","issue_events_url":"https://api.github.com/repos/rmjarvis/Piff/issues/events{/number}","events_url":"https://api.github.com/repos/rmjarvis/Piff/events","assignees_url":"https://api.github.com/repos/rmjarvis/Piff/assignees{/user}","branches_url":"https://api.github.com/repos/rmjarvis/Piff/branches{/branch}","tags_url":"https://api.github.com/repos/rmjarvis/Piff/tags","blobs_url":"https://api.github.com/repos/rmjarvis/Piff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmjarvis/Piff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmjarvis/Piff/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmjarvis/Piff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmjarvis/Piff/statuses/{sha}","languages_url":"https://api.github.com/repos/rmjarvis/Piff/languages","stargazers_url":"https://api.github.com/repos/rmjarvis/Piff/stargazers","contributors_url":"https://api.github.com/repos/rmjarvis/Piff/contributors","subscribers_url":"https://api.github.com/repos/rmjarvis/Piff/subscribers","subscription_url":"https://api.github.com/repos/rmjarvis/Piff/subscription","commits_url":"https://api.github.com/repos/rmjarvis/Piff/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmjarvis/Piff/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmjarvis/Piff/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmjarvis/Piff/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmjarvis/Piff/contents/{+path}","compare_url":"https://api.github.com/repos/rmjarvis/Piff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmjarvis/Piff/merges","archive_url":"https://api.github.com/repos/rmjarvis/Piff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmjarvis/Piff/downloads","issues_url":"https://api.github.com/repos/rmjarvis/Piff/issues{/number}","pulls_url":"https://api.github.com/repos/rmjarvis/Piff/pulls{/number}","milestones_url":"https://api.github.com/repos/rmjarvis/Piff/milestones{/number}","notifications_url":"https://api.github.com/repos/rmjarvis/Piff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmjarvis/Piff/labels{/name}","releases_url":"https://api.github.com/repos/rmjarvis/Piff/releases{/id}","deployments_url":"https://api.github.com/repos/rmjarvis/Piff/deployments","created_at":"2016-02-25T16:24:08Z","updated_at":"2016-04-28T06:37:56Z","pushed_at":"2016-06-21T00:42:35Z","git_url":"git://github.com/rmjarvis/Piff.git","ssh_url":"git@github.com:rmjarvis/Piff.git","clone_url":"https://github.com/rmjarvis/Piff.git","svn_url":"https://github.com/rmjarvis/Piff","homepage":"http://rmjarvis.github.io/Piff/html/index.html","size":28080,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":3,"default_branch":"master"}},"base":{"label":"rmjarvis:master","ref":"master","sha":"4c11d3607b23d354a6eec9c407cd306efc573dae","user":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"repo":{"id":52539402,"name":"Piff","full_name":"rmjarvis/Piff","owner":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmjarvis/Piff","description":"PSFs In the Full FOV.  A software package for modeling the point-spread function (PSF) across the full field of view (FOV).  Documentation:","fork":false,"url":"https://api.github.com/repos/rmjarvis/Piff","forks_url":"https://api.github.com/repos/rmjarvis/Piff/forks","keys_url":"https://api.github.com/repos/rmjarvis/Piff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmjarvis/Piff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmjarvis/Piff/teams","hooks_url":"https://api.github.com/repos/rmjarvis/Piff/hooks","issue_events_url":"https://api.github.com/repos/rmjarvis/Piff/issues/events{/number}","events_url":"https://api.github.com/repos/rmjarvis/Piff/events","assignees_url":"https://api.github.com/repos/rmjarvis/Piff/assignees{/user}","branches_url":"https://api.github.com/repos/rmjarvis/Piff/branches{/branch}","tags_url":"https://api.github.com/repos/rmjarvis/Piff/tags","blobs_url":"https://api.github.com/repos/rmjarvis/Piff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmjarvis/Piff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmjarvis/Piff/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmjarvis/Piff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmjarvis/Piff/statuses/{sha}","languages_url":"https://api.github.com/repos/rmjarvis/Piff/languages","stargazers_url":"https://api.github.com/repos/rmjarvis/Piff/stargazers","contributors_url":"https://api.github.com/repos/rmjarvis/Piff/contributors","subscribers_url":"https://api.github.com/repos/rmjarvis/Piff/subscribers","subscription_url":"https://api.github.com/repos/rmjarvis/Piff/subscription","commits_url":"https://api.github.com/repos/rmjarvis/Piff/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmjarvis/Piff/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmjarvis/Piff/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmjarvis/Piff/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmjarvis/Piff/contents/{+path}","compare_url":"https://api.github.com/repos/rmjarvis/Piff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmjarvis/Piff/merges","archive_url":"https://api.github.com/repos/rmjarvis/Piff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmjarvis/Piff/downloads","issues_url":"https://api.github.com/repos/rmjarvis/Piff/issues{/number}","pulls_url":"https://api.github.com/repos/rmjarvis/Piff/pulls{/number}","milestones_url":"https://api.github.com/repos/rmjarvis/Piff/milestones{/number}","notifications_url":"https://api.github.com/repos/rmjarvis/Piff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmjarvis/Piff/labels{/name}","releases_url":"https://api.github.com/repos/rmjarvis/Piff/releases{/id}","deployments_url":"https://api.github.com/repos/rmjarvis/Piff/deployments","created_at":"2016-02-25T16:24:08Z","updated_at":"2016-04-28T06:37:56Z","pushed_at":"2016-06-21T00:42:35Z","git_url":"git://github.com/rmjarvis/Piff.git","ssh_url":"git@github.com:rmjarvis/Piff.git","clone_url":"https://github.com/rmjarvis/Piff.git","svn_url":"https://github.com/rmjarvis/Piff","homepage":"http://rmjarvis.github.io/Piff/html/index.html","size":28080,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rmjarvis/Piff/pulls/24"},"html":{"href":"https://github.com/rmjarvis/Piff/pull/24"},"issue":{"href":"https://api.github.com/repos/rmjarvis/Piff/issues/24"},"comments":{"href":"https://api.github.com/repos/rmjarvis/Piff/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/rmjarvis/Piff/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/rmjarvis/Piff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rmjarvis/Piff/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/rmjarvis/Piff/statuses/1ba46de232bd4f074d12966bfcbf28a75638cf7d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":43824,"deletions":0,"changed_files":6}}
{"actor":{"display_login":"cpadavis"}}