Skip to content

Instantly share code, notes, and snippets.

@willirath
Last active December 20, 2020 16:52
Show Gist options
  • Save willirath/992aed88cd24800d83a0097f6f0e9ded to your computer and use it in GitHub Desktop.
Save willirath/992aed88cd24800d83a0097f6f0e9ded to your computer and use it in GitHub Desktop.
Lagrangian experiment with Xoak
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@willirath
Copy link
Author

@benbovy Fun with Xoak.

@benbovy
Copy link

benbovy commented Dec 19, 2020

Nice! We should add more concrete examples like that in the docs.

@willirath
Copy link
Author

I think this example can also serve as a tool for thinking about possible additions to the Xoak API:

  1. The nearest-neighbor-lookup I've used here is not very realistic as we'd usually like to go for different ways of interpolating the data. While offering different interpolation schemes is beyond the scope of Xoak (I think), looking up the indices of nearest neighbours (possibly with multiple neighbours and their distances?) would fit into Xoak.

  2. The Lagrangian simulations usually chose small time steps that ensure only very little movement. Hence, there's two possible routes for optimization: (A) Many of the queries would be unnecessary as the nearest neighbours of many of the particles would not have changed. (B) If the underlying index provides a way of doing this, starting from the formerly known nearest neighbour could greatly speed up the query.

For more context, point 3. from @rabernat's comment on how Parcels could benefit from Xarray integration is also relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment