-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyresample/geometry.py resampling error related to dask. #425
Comments
Could you provide:
|
Hi thanks for your response, here are what you need! C:\Users\Yu\PycharmProjects\LowResSatellitesService\venv\lib\site-packages\pyproj\crs\crs.py:1256: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems During handling of the above exception, another exception occurred: Traceback (most recent call last): pyresample/pyresample/geometry.py Line 1077 in 29d37a4
|
Sorry it should be this line, but I found the version I was using is different from what you have now. I think it has been fixed in current version. Thanks for checking it! pyresample/pyresample/geometry.py Line 1110 in 29d37a4
|
Ah ok, thanks @zhaoyutim. This work was done as part of #346. If you could upgrade your version of pyresample and let me know if it fixes your issue that'd be great. I'm going to assume it does so I'll close this. Thanks for reporting the problem either way. |
Code Sample, a minimal, complete, and verifiable piece of code
Problem description
Hi Team,
I was trying to resample a VIIRS image from VNPIMG02 and VNPIMG03, however I encounter this issue when I was doing the resample. It got an error related to dask like : "ValueError: zero-size array to reduction operation fmax which has no identity"
I located the problem and provided a quick fix as below, it seems related to dask computation for nanmax.
The example array I was using is extracted from longitude of my satellite image.
Thanks in advance!
Yu Zhao
Expected Output
Quick fix starts here
xarr = np.load('example.npy')
print(xarr)
my implementation
xarr = da.from_array(xarr)
xmin = np.nanmin(xarr[xarr >= 0].compute())
xmax = np.nanmax(xarr[xarr < 0].compute()) + 360
print(xmin, xmax)
implementation in the package (this implementation would report error)
xmin2 = np.nanmin(xarr[xarr >= 0])
xmax2 = np.nanmax(xarr[xarr < 0]) + 360
xmin2, xmax2 = da.compute(xmin2, xmax2)
print(xmin2, xmax2)
Actual Result, Traceback if applicable
Versions of Python, package at hand and relevant dependencies
satpy 0.27 pyresample 1.19
The text was updated successfully, but these errors were encountered: