pyresample icon indicating copy to clipboard operation
pyresample copied to clipboard

EWA Resampler hardcodes fill value to NaN

Open djhoese opened this issue 2 months ago • 3 comments

A colleague tried to use EWA resampling on regular (non-dask) numpy arrays that were integers. She got errors about NaN not being able to be converted to an integer so she then specified the fill value with fill=0 and still got the same error. Turns out I have the fill value hardcoded to NaN:

https://github.com/pytroll/pyresample/blob/1f4c7fbe3985be068b4130fac7898f71eb7b5987/pyresample/ewa/ewa.py#L170-L171

This means integer data isn't actually handled. I need to create some tests for this to prove that there isn't some other reason I hardcoded this.

djhoese avatar Nov 13 '25 16:11 djhoese

Doesn't look like I'm doing this in the dask version of the EWA resampling code:

https://github.com/pytroll/pyresample/blob/1f4c7fbe3985be068b4130fac7898f71eb7b5987/pyresample/ewa/dask_ewa.py#L400-L410

djhoese avatar Nov 13 '25 16:11 djhoese

Does it make sense to allow ewa on integer data? Because averaging is happening...

mraspaud avatar Nov 19 '25 10:11 mraspaud

Yes it has a maximum weight mode that is similar to nearest neighbor.

djhoese avatar Nov 19 '25 14:11 djhoese