You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code Sample, a minimal, complete, and verifiable piece of code
I have a temperature grib message and I want to resample it using cubic resampling. However, i get these warnings in the console. If i lower the radius value I no longer get the warnings but I get 0s in the interpolated data.
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
proj = self._crs.to_proj4(version=version)
RuntimeWarning: invalid value encountered in divide x_2 = (-b__ - np.sqrt(discriminant)) / (2 * a__)
Normally these types of "invalid value" warnings from numpy come from NaNs in the data or geolocation data. If you're getting this with your example code...then I'm not sure where it would be coming from, especially for large radii values since I would expect that to mean more valid pixels are involved not more invalid.
Maybe @pnuu has ideas since he originally wrote that resampler class.
The only weird thing is that there is no warning from the previous line which is identical other than there being a addition instead of subtraction. Most likely there are NaNs in a__ or b__ that cause the warning. Nothing to worry about.
And to clarfiy, the NaN values can be due to the four points used in bilinear calculation to form a paralellogram (opposite edges are parallel) or one/two of the edges being exactly vertical. These special casesare handled in the next steps. The third option forNaN`s is that there are no valid points for the interpolation at all, like if the target area extends beyond the source data coverage, or there are invalid coordinates..
Code Sample, a minimal, complete, and verifiable piece of code
I have a temperature grib message and I want to resample it using cubic resampling. However, i get these warnings in the console. If i lower the radius value I no longer get the warnings but I get 0s in the interpolated data.
Thank you!
The text was updated successfully, but these errors were encountered: