Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Datasource coordinates boundaries (in interpolation) #422

Open
jmilloy opened this issue Aug 21, 2020 · 0 comments
Open

Handle Datasource coordinates boundaries (in interpolation) #422

jmilloy opened this issue Aug 21, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jmilloy
Copy link
Collaborator

jmilloy commented Aug 21, 2020

Description
The interpolation may need to behave differently depending on the datasource coordinates boundaries, e.g. for off-center points.

For example, nearest interpolation for "left-aligned" time coordinates should potentially behave differently than nearest interpolation for "centered" time coordinates. should behave differently for time coordinates.

Describe the solution you'd like

The boundaries spec and attribute is already implemented, but using any non-standard boundary raise a NotImplementedError. The interpolators should inspect the boundaries of the source coordinates and adjust their calculation as needed. We still need to develop the spec for some specific needed source coordinate boundaries cases and how the interpolation is affected.

Sample Code

data = np.random.random((100, 100))
coords = Coordinates([np.linspace(0, 10, 100), np.linspace(0, 10, 100)], dims=['lat', 'lon'])
node1 = Array(source=data, coordinates=coords)
node2 = Array(source=data, coordinates=coords, boundary={'lat': [0, 1], 'lon': [0, 1]})
node3 = Array(source=data, coordinates=coords, boundary={'lat': [-1, 0], 'lon': [-1, 0]})

c = Coordinates([np.linspace(1, 2, 20), np.linspace(1, 2, 20)], dims=['lat', 'lon'])

o1 = node1.eval(c)
o2 = node2.eval(c)
o3 = node3.eval(c)
@jmilloy jmilloy added the enhancement New feature or request label Aug 21, 2020
@jmilloy jmilloy self-assigned this Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant