Open vincelhx opened 1 year ago
@vincelhx I need clarifications,
do you suggest modifications in https://github.com/umr-lops/xsar/blob/b0d5951f6125262eda252642c3dbbf085a415c0b/src/xsar/base_dataset.py#L711 ?
Your suggestion is to use https://numpy.org/doc/stable/reference/generated/numpy.interp.html instead of https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectBivariateSpline.html ?
Which raster products would use interp
and which RectBivariateSpline
?
What is the point about Level-2 ? xsar
is dealing only with Level-1 SAR products (and especially GRD).
The NaN in raster products is causing the artifact you described? It seems to me that it is an extrapolation.
@agrouaze i was thinking to make map_raster a standalone function since we regularly copy it to use it in another context (LEVEL2)
I agree https://github.com/umr-lops/xsar/blob/b0d5951f6125262eda252642c3dbbf085a415c0b/src/xsar/base_dataset.py#L711 could be removed from xsar
to be versioned in a separate repository. The new repository would be a dependency for xsar
sphinx documentation compilation (especially projections.ipynb
)
I'm using hwrf as a raster with
hwrf_0015_3h(fname, **kwargs)
from raster_readers.py. However map_raster - which is used to map the raster on the SAR grid - is defined to be used only with a L1. It's a problem since anyone would use this function for a L2 product. It's the case for me, i need to map hwrf on the new L2-GRD.So first suggestion : addapt the code to make map_raster usable for any dataset.
To use it on my L2-GRD dataset I adapted the map_raster function. I pointed an 'issue' using the interpolation of hwrf. It happened on these lines :
As written, RectBiVariateSpline can't handle Nans. But the upper condition to not use RectBivariateSpline is not enough for a local model like ecmwf;
Using RectBiVariateSpline :
with the NaN problem we got wrong values (on the right) instead of Nans
Using interp :![image](https://github.com/umr-lops/xsar/assets/38355798/a102f220-2684-4ba9-908e-a0e610fe2ecc)
I suggest to change the code of map_raster to force the use of "interp" for some rasters
here are my inputs :