I am currently reprojecting SLSTR and OLCI data and exporting them to geotiffs but running into two issues while re-projecting.
I would like to use the bicubic resampling instead of nearest neighbor, however when doing so NoData values (-327680 for the S1_radiacne for example) are being interpolated to nearby reprojected pixels causing the data to not get masked out and become extremely negative.
Is there any alternative to just using nearest neighbor that will yield nicely resampled image while somehow preventing pixels neighboring NoData values from being interpolated?
Also if I use NaN as the NoData value I can interpolate and everything seems to work as intended, but I do not want to do this for bands which are integer based such as S1-6 radiance since the integer values get converted to float.
I would like the preserve the datatype of the bands during the process of reprojecting -> writing as a geotiff. However the geotiff output seems to be float32 by default. Is there some implicit casting happening during reproject, and can I prevent this from happening?
The data type float32 is used because we have to. In Tiff it is necessary to use a common data type. So we have to use the one which can hold the data of all bands.
If you write each band into a single tiff file, the type of the band will be used.
Regarding the interpolation issue you have mention. I’ currently investigating this.
The problem is a bit different.
Here the problem is that integer bands have no dedicated no-data value.
For float bands there is NaN.
If you use -1, it’s the no-data value of the band in your case, as no-data value for the reprojection, then the result should be good.
I have to admit, we should handle this better.