Closed simonrp84 closed 1 year ago
@simonrp84 thanks for reporting the issue.
It looks like pyresample complains that the source and destination areas are the same, which is actually true for some of the channels of the true color image I suppose, and probably not for others. My first reaction here is why not use the native resampler instead? Are you after the bilinear interpolation gradient search provides?
No, this is just a simple example to prove the bug. I'm actually trying to use the true_color_with_night_ir composite, which is unable to use native as it has non-geos data included. It produces the same error.
I understand. I suppose one solution will be to make this a warning rather than an error...
@mraspaud perhaps Satpy, if it doesn't already, should skip resampling data in these cases and instead do a .copy(deep=True)
on the DataArray? Why don't we see this issue with the kdtree version?
Wait...are we completely wasting time with all resamplers by asking to resample data to its same projection?!?!? No. I don't believe it.
Yeah, that was going to be my next question: If this is a warning rather than an error then what happens with the data? Sounds like it might still get 'resampled' even for the bands where there's no need...
So, looking at this I can see that in the case of the kdtree resampler, the resampling will take place even if source and target areas are identical. Native works around it by nature (sizes being the same, nothing is done). Gradient search atm raises an error. Working on a PR for the latter.
The
gradient_search
method is failing when trying to resample Himawari data from one resolution to another:Code Sample, a minimal, complete, and verifiable piece of code
Problem description
The above code produces the following error message:
If I comment out lines 202 and 203 then it runs fine, so presumably something is being incorrectly compared in that
if
statement. For Himawari true color, only one band has a different resolution to the others so my guess is that the comparison is being made between B01 and B02, which are the same resolution. Perhaps this should compare all input bands or something?Expected Output
A resampled image.
Versions of Python, package at hand and relevant dependencies
Python = 3.10 Pyresample = 1.26.1 (from conda-forge). OS: Windows 10