{"action":"created","comment":{"url":"https://api.github.com/repos/sgrid/pysgrid/pulls/comments/55510457","id":55510457,"diff_hunk":"@@ -7,14 +7,16 @@\n from __future__ import (absolute_import, division, print_function)\n \n from netCDF4 import Dataset\n+import numpy as np\n \n from .read_netcdf import NetCDFDataset, parse_padding, find_grid_topology_var\n-from .utils import calculate_angle_from_true_east, pair_arrays\n+from .utils import calculate_angle_from_true_east, pair_arrays, points_in_polys\n from .variables import SGridVariable\n \n \n class SGrid(object):\n \n+    grid_names = ['node', 'face', 'edge1', 'edge2']","path":"pysgrid/sgrid.py","position":14,"original_position":14,"commit_id":"6883764bf074a20f4f01e86a300c725b712db5de","original_commit_id":"6883764bf074a20f4f01e86a300c725b712db5de","user":{"login":"ocefpaf","id":950575,"avatar_url":"https://avatars.githubusercontent.com/u/950575?v=3","gravatar_id":"","url":"https://api.github.com/users/ocefpaf","html_url":"https://github.com/ocefpaf","followers_url":"https://api.github.com/users/ocefpaf/followers","following_url":"https://api.github.com/users/ocefpaf/following{/other_user}","gists_url":"https://api.github.com/users/ocefpaf/gists{/gist_id}","starred_url":"https://api.github.com/users/ocefpaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocefpaf/subscriptions","organizations_url":"https://api.github.com/users/ocefpaf/orgs","repos_url":"https://api.github.com/users/ocefpaf/repos","events_url":"https://api.github.com/users/ocefpaf/events{/privacy}","received_events_url":"https://api.github.com/users/ocefpaf/received_events","type":"User","site_admin":false},"body":"Ping @hrajagers, @rsignell-usgs, and @ayan-usgs. I see these as grid components of 1 grid. Not sure if calling it grid names is the way to go. Might be confusing for people that known the SGRID conventions to read the code.","created_at":"2016-03-09T12:20:38Z","updated_at":"2016-03-09T12:20:38Z","html_url":"https://github.com/sgrid/pysgrid/pull/85#discussion_r55510457","pull_request_url":"https://api.github.com/repos/sgrid/pysgrid/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/comments/55510457"},"html":{"href":"https://github.com/sgrid/pysgrid/pull/85#discussion_r55510457"},"pull_request":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/sgrid/pysgrid/pulls/85","id":60757922,"html_url":"https://github.com/sgrid/pysgrid/pull/85","diff_url":"https://github.com/sgrid/pysgrid/pull/85.diff","patch_url":"https://github.com/sgrid/pysgrid/pull/85.patch","issue_url":"https://api.github.com/repos/sgrid/pysgrid/issues/85","number":85,"state":"open","locked":false,"title":"Interpolation update","user":{"login":"jay-hennen","id":14843789,"avatar_url":"https://avatars.githubusercontent.com/u/14843789?v=3","gravatar_id":"","url":"https://api.github.com/users/jay-hennen","html_url":"https://github.com/jay-hennen","followers_url":"https://api.github.com/users/jay-hennen/followers","following_url":"https://api.github.com/users/jay-hennen/following{/other_user}","gists_url":"https://api.github.com/users/jay-hennen/gists{/gist_id}","starred_url":"https://api.github.com/users/jay-hennen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jay-hennen/subscriptions","organizations_url":"https://api.github.com/users/jay-hennen/orgs","repos_url":"https://api.github.com/users/jay-hennen/repos","events_url":"https://api.github.com/users/jay-hennen/events{/privacy}","received_events_url":"https://api.github.com/users/jay-hennen/received_events","type":"User","site_admin":false},"body":"Most of PR #78 can still describe this. However, there are a few important additions:\r\n\r\n1. Automatic slicing: When doing interpolation, only the data within the bounding box of the points will be requested, unless otherwise specified. This minimum request slicing applies to all variables and grid variables. Now, the ONLY information that needs to be 100% loaded before these interpolation routines can be run are the 'node' coordinates (for the cell tree)\r\n\r\n2. Highly flexible functions. Interpolation can be as simple as this: \r\n` sgrid.interpolate_var_to_points(points, sgrid.u, slices=[time_idx, v_idx])`\r\nThe variable in this case is lazy-loaded and sliced appropriately. There are a variety of other possible uses:  \r\n`sgrid.interpolate_var_to_points(points, sgrid.u[time_idx, v_idx])`\r\nThis pre-loads the whole variable slice  \r\n`sgrid.interpolate_var_to_points(points, nc.variables['u'], slices=[time_idx, depth_idx])`\r\nYou can use a raw variable or array-like of any kind, as long as it can be sliced, and has a shape that can fit on one of the grids.  \r\n`sgrid.interpolate_var_to_points(points, sgrid.u, indices=ind, alphas=alphas, slices=[time_idx, depth_idx])`\r\nConsiderable performance gains can be had by passing in pre-computed information, such as indices, alphas, or even translated indices (advanced). To see an example of this, you can see the interpolation function in demos/matlabanim.py.\r\n\r\nMuch of the code has stablilized. There are still improvements to be made, but no planned API or algorithm changes/additions.","created_at":"2016-02-25T22:22:27Z","updated_at":"2016-03-09T12:20:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a774063c57b3cda5d93a014aa61b90b3aceaad1","assignee":{"login":"ocefpaf","id":950575,"avatar_url":"https://avatars.githubusercontent.com/u/950575?v=3","gravatar_id":"","url":"https://api.github.com/users/ocefpaf","html_url":"https://github.com/ocefpaf","followers_url":"https://api.github.com/users/ocefpaf/followers","following_url":"https://api.github.com/users/ocefpaf/following{/other_user}","gists_url":"https://api.github.com/users/ocefpaf/gists{/gist_id}","starred_url":"https://api.github.com/users/ocefpaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocefpaf/subscriptions","organizations_url":"https://api.github.com/users/ocefpaf/orgs","repos_url":"https://api.github.com/users/ocefpaf/repos","events_url":"https://api.github.com/users/ocefpaf/events{/privacy}","received_events_url":"https://api.github.com/users/ocefpaf/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sgrid/pysgrid/pulls/85/commits","review_comments_url":"https://api.github.com/repos/sgrid/pysgrid/pulls/85/comments","review_comment_url":"https://api.github.com/repos/sgrid/pysgrid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgrid/pysgrid/issues/85/comments","statuses_url":"https://api.github.com/repos/sgrid/pysgrid/statuses/6883764bf074a20f4f01e86a300c725b712db5de","head":{"label":"jay-hennen:master","ref":"master","sha":"6883764bf074a20f4f01e86a300c725b712db5de","user":{"login":"jay-hennen","id":14843789,"avatar_url":"https://avatars.githubusercontent.com/u/14843789?v=3","gravatar_id":"","url":"https://api.github.com/users/jay-hennen","html_url":"https://github.com/jay-hennen","followers_url":"https://api.github.com/users/jay-hennen/followers","following_url":"https://api.github.com/users/jay-hennen/following{/other_user}","gists_url":"https://api.github.com/users/jay-hennen/gists{/gist_id}","starred_url":"https://api.github.com/users/jay-hennen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jay-hennen/subscriptions","organizations_url":"https://api.github.com/users/jay-hennen/orgs","repos_url":"https://api.github.com/users/jay-hennen/repos","events_url":"https://api.github.com/users/jay-hennen/events{/privacy}","received_events_url":"https://api.github.com/users/jay-hennen/received_events","type":"User","site_admin":false},"repo":{"id":50856215,"name":"pysgrid","full_name":"jay-hennen/pysgrid","owner":{"login":"jay-hennen","id":14843789,"avatar_url":"https://avatars.githubusercontent.com/u/14843789?v=3","gravatar_id":"","url":"https://api.github.com/users/jay-hennen","html_url":"https://github.com/jay-hennen","followers_url":"https://api.github.com/users/jay-hennen/followers","following_url":"https://api.github.com/users/jay-hennen/following{/other_user}","gists_url":"https://api.github.com/users/jay-hennen/gists{/gist_id}","starred_url":"https://api.github.com/users/jay-hennen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jay-hennen/subscriptions","organizations_url":"https://api.github.com/users/jay-hennen/orgs","repos_url":"https://api.github.com/users/jay-hennen/repos","events_url":"https://api.github.com/users/jay-hennen/events{/privacy}","received_events_url":"https://api.github.com/users/jay-hennen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jay-hennen/pysgrid","description":"Python tools for sgrid","fork":true,"url":"https://api.github.com/repos/jay-hennen/pysgrid","forks_url":"https://api.github.com/repos/jay-hennen/pysgrid/forks","keys_url":"https://api.github.com/repos/jay-hennen/pysgrid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jay-hennen/pysgrid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jay-hennen/pysgrid/teams","hooks_url":"https://api.github.com/repos/jay-hennen/pysgrid/hooks","issue_events_url":"https://api.github.com/repos/jay-hennen/pysgrid/issues/events{/number}","events_url":"https://api.github.com/repos/jay-hennen/pysgrid/events","assignees_url":"https://api.github.com/repos/jay-hennen/pysgrid/assignees{/user}","branches_url":"https://api.github.com/repos/jay-hennen/pysgrid/branches{/branch}","tags_url":"https://api.github.com/repos/jay-hennen/pysgrid/tags","blobs_url":"https://api.github.com/repos/jay-hennen/pysgrid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jay-hennen/pysgrid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jay-hennen/pysgrid/git/refs{/sha}","trees_url":"https://api.github.com/repos/jay-hennen/pysgrid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jay-hennen/pysgrid/statuses/{sha}","languages_url":"https://api.github.com/repos/jay-hennen/pysgrid/languages","stargazers_url":"https://api.github.com/repos/jay-hennen/pysgrid/stargazers","contributors_url":"https://api.github.com/repos/jay-hennen/pysgrid/contributors","subscribers_url":"https://api.github.com/repos/jay-hennen/pysgrid/subscribers","subscription_url":"https://api.github.com/repos/jay-hennen/pysgrid/subscription","commits_url":"https://api.github.com/repos/jay-hennen/pysgrid/commits{/sha}","git_commits_url":"https://api.github.com/repos/jay-hennen/pysgrid/git/commits{/sha}","comments_url":"https://api.github.com/repos/jay-hennen/pysgrid/comments{/number}","issue_comment_url":"https://api.github.com/repos/jay-hennen/pysgrid/issues/comments{/number}","contents_url":"https://api.github.com/repos/jay-hennen/pysgrid/contents/{+path}","compare_url":"https://api.github.com/repos/jay-hennen/pysgrid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jay-hennen/pysgrid/merges","archive_url":"https://api.github.com/repos/jay-hennen/pysgrid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jay-hennen/pysgrid/downloads","issues_url":"https://api.github.com/repos/jay-hennen/pysgrid/issues{/number}","pulls_url":"https://api.github.com/repos/jay-hennen/pysgrid/pulls{/number}","milestones_url":"https://api.github.com/repos/jay-hennen/pysgrid/milestones{/number}","notifications_url":"https://api.github.com/repos/jay-hennen/pysgrid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jay-hennen/pysgrid/labels{/name}","releases_url":"https://api.github.com/repos/jay-hennen/pysgrid/releases{/id}","deployments_url":"https://api.github.com/repos/jay-hennen/pysgrid/deployments","created_at":"2016-02-01T17:14:22Z","updated_at":"2016-02-01T17:14:23Z","pushed_at":"2016-02-29T22:32:53Z","git_url":"git://github.com/jay-hennen/pysgrid.git","ssh_url":"git@github.com:jay-hennen/pysgrid.git","clone_url":"https://github.com/jay-hennen/pysgrid.git","svn_url":"https://github.com/jay-hennen/pysgrid","homepage":null,"size":96321,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sgrid:master","ref":"master","sha":"8a1566fb47b1140f13a8a29e5ecf3f728172ae7b","user":{"login":"sgrid","id":10886425,"avatar_url":"https://avatars.githubusercontent.com/u/10886425?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrid","html_url":"https://github.com/sgrid","followers_url":"https://api.github.com/users/sgrid/followers","following_url":"https://api.github.com/users/sgrid/following{/other_user}","gists_url":"https://api.github.com/users/sgrid/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrid/subscriptions","organizations_url":"https://api.github.com/users/sgrid/orgs","repos_url":"https://api.github.com/users/sgrid/repos","events_url":"https://api.github.com/users/sgrid/events{/privacy}","received_events_url":"https://api.github.com/users/sgrid/received_events","type":"Organization","site_admin":false},"repo":{"id":30425660,"name":"pysgrid","full_name":"sgrid/pysgrid","owner":{"login":"sgrid","id":10886425,"avatar_url":"https://avatars.githubusercontent.com/u/10886425?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrid","html_url":"https://github.com/sgrid","followers_url":"https://api.github.com/users/sgrid/followers","following_url":"https://api.github.com/users/sgrid/following{/other_user}","gists_url":"https://api.github.com/users/sgrid/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrid/subscriptions","organizations_url":"https://api.github.com/users/sgrid/orgs","repos_url":"https://api.github.com/users/sgrid/repos","events_url":"https://api.github.com/users/sgrid/events{/privacy}","received_events_url":"https://api.github.com/users/sgrid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgrid/pysgrid","description":"Python tools for sgrid","fork":false,"url":"https://api.github.com/repos/sgrid/pysgrid","forks_url":"https://api.github.com/repos/sgrid/pysgrid/forks","keys_url":"https://api.github.com/repos/sgrid/pysgrid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgrid/pysgrid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgrid/pysgrid/teams","hooks_url":"https://api.github.com/repos/sgrid/pysgrid/hooks","issue_events_url":"https://api.github.com/repos/sgrid/pysgrid/issues/events{/number}","events_url":"https://api.github.com/repos/sgrid/pysgrid/events","assignees_url":"https://api.github.com/repos/sgrid/pysgrid/assignees{/user}","branches_url":"https://api.github.com/repos/sgrid/pysgrid/branches{/branch}","tags_url":"https://api.github.com/repos/sgrid/pysgrid/tags","blobs_url":"https://api.github.com/repos/sgrid/pysgrid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgrid/pysgrid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgrid/pysgrid/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgrid/pysgrid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgrid/pysgrid/statuses/{sha}","languages_url":"https://api.github.com/repos/sgrid/pysgrid/languages","stargazers_url":"https://api.github.com/repos/sgrid/pysgrid/stargazers","contributors_url":"https://api.github.com/repos/sgrid/pysgrid/contributors","subscribers_url":"https://api.github.com/repos/sgrid/pysgrid/subscribers","subscription_url":"https://api.github.com/repos/sgrid/pysgrid/subscription","commits_url":"https://api.github.com/repos/sgrid/pysgrid/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgrid/pysgrid/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgrid/pysgrid/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgrid/pysgrid/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgrid/pysgrid/contents/{+path}","compare_url":"https://api.github.com/repos/sgrid/pysgrid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgrid/pysgrid/merges","archive_url":"https://api.github.com/repos/sgrid/pysgrid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgrid/pysgrid/downloads","issues_url":"https://api.github.com/repos/sgrid/pysgrid/issues{/number}","pulls_url":"https://api.github.com/repos/sgrid/pysgrid/pulls{/number}","milestones_url":"https://api.github.com/repos/sgrid/pysgrid/milestones{/number}","notifications_url":"https://api.github.com/repos/sgrid/pysgrid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgrid/pysgrid/labels{/name}","releases_url":"https://api.github.com/repos/sgrid/pysgrid/releases{/id}","deployments_url":"https://api.github.com/repos/sgrid/pysgrid/deployments","created_at":"2015-02-06T18:02:49Z","updated_at":"2016-01-22T14:00:35Z","pushed_at":"2016-02-29T22:32:54Z","git_url":"git://github.com/sgrid/pysgrid.git","ssh_url":"git@github.com:sgrid/pysgrid.git","clone_url":"https://github.com/sgrid/pysgrid.git","svn_url":"https://github.com/sgrid/pysgrid","homepage":null,"size":140076,"stargazers_count":3,"watchers_count":3,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":15,"forks":7,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/85"},"html":{"href":"https://github.com/sgrid/pysgrid/pull/85"},"issue":{"href":"https://api.github.com/repos/sgrid/pysgrid/issues/85"},"comments":{"href":"https://api.github.com/repos/sgrid/pysgrid/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgrid/pysgrid/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/sgrid/pysgrid/statuses/6883764bf074a20f4f01e86a300c725b712db5de"}}}}