Open ortk95 opened 1 month ago
Would probably want to add two new public methods to the API:
interpolate_xy
). If the user requires other coordinate systems, this can easily be combined with e.g. radec2xy
etc.interpolate_lonlat
). Internally, this would just be a call to interpolate_xy
, with some additional check to return NaN
if the lon/lat isn't visible.These methods should ideally accept arrays of coordinates, like we can currently do with _maybe_transform_as_arrays
in coordinate conversions. As stuff like constructing the interpolator can potentially be costly, we'll probably want to only do this once for each call, rather than simply vectorising with _maybe_transform_as_arrays
.
For DRY and consistency purposes, we'll also probably want to re-write map_img
to use interpolate_lonlat
/interpolate_xy
internally. This will mean that map_img
will only need to think about constructing the x and y maps, then the new interpolate methods will handle all the actual logic.
Also, for consistency with map_img
, we want to be able to natively support cubes in these new interpolation methods.
Sometimes, we are only interested in a single point of interest on the target body, rather than the full mapped image, so it would be useful to have some method to interpolate values for a single location. This would effectively be equivalent to performing a mapping for a single lon/lat coordinate with
but would be much easier to use.