-
Notifications
You must be signed in to change notification settings - Fork 94
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
Make a Swath definition subclass for interpolated data #552
Comments
Related: #476 |
I've been thinking about this a lot during the last couple of days, and I think the approach presented here is actually not optimal. Here is why: So a simpler solution in my opinion is to let the developer/user use relevant interpolator for its use case, and provide the corresponding dask array. Hence, the solution I suggest now is:
|
I think the missed use case here is someone who wants to use numpy arrays without dask involved. Obviously that's not our use case anymore as Satpy developers/users. But I think it is still something to keep in mind. I haven't re-read the original post, but I remember it being mentioned somewhere that the swath definition could take a callback/interpolator. I guess this would be what you mentioned with:
But I mean anything can be a callback with two inputs (lons, lats), right? Not that I want to program this myself, but it would be an option that I'm not completely against if it provides something useful... I think a restructured SwathDefinition like the one I'd like in Pyresample 2.0 with defined interfaces (via Protocols) could mean that someone wanting to do what you originally requested wouldn't have that hard of a time doing it. If we broke down the use cases of the SwathDefinition into Bottom line: I'm OK not implementing a specialized class that does the interpolation. I just wanted to point out the solutions for it that I'm not completely against. |
Thanks for reminding me of that this use case. It is of course valid, but I think it will be a third subclass/mixin then. |
Feature description
A lot of data we use in our team has geolocation data provided as with tiepoints to interpolate. Python-geotiepoints works as expected for this and it's easy to create a swath definition base on dask arrays (so that the navigation data can be interpolated chunk-wise).
However, for some applications it would be preferable to be able to have access to the interpolation function directly in the swath definition. For example, for computing a granule ring or for getting just a few points out of the data, it would be desirable to interpolate on a case by case basis.
For this, I propose creating a subclass of the Swath definition that would take on initialisation the lower-resolution lon and lat arrays along with a function to call to get interpolated values for a given position in the array.
From there, re should be able have a custom
get_lonlat
method that does the interpolation itself if the number of requested points is smaller than say 100 points.The text was updated successfully, but these errors were encountered: