Open djhoese opened 4 years ago
Given the small change in latitude bounds I wonder if this is a bug in the intersection code instead?
The user let me know that this particular box is outside the CONUS region (I haven't mapped it out). I'd still say this is pretty unexpected.
I'm wondering it that's not an expected behaviour. The user asks to crop the scene to match the ll box given. If the ll box is partly outside the scene, I expect crop to just return the intersection. From what you say, the "faulty" ll box is like that. Or am I missing something?
I thought it was outside the projection space, but from what I can tell that 52
latitude is in the space at both of those longitudes. So the box, at these corner points, should be valid. Maybe the boundary is choosing different points (in the middle of the "box") that aren't in the space?
Describe the bug A Geo2Grid user is cropping a GOES-17 ABI CONUS image with a ll_bbox using the
Scene.crop
method. When he uses the bounds[-130, 30, -113, 51]
everything is fine and he gets a good image. When he uses[-130, 30, -113, 52]
then he ends up with a strip of data (<150 rows when it should be ~3000).To Reproduce
Download some data: https://noaa-goes17.s3.amazonaws.com/ABI-L1b-RadC/2020/258/18/OR_ABI-L1b-RadC-M6C02_G17_s20202581801176_e20202581803549_c20202581803580.nc
Result:
Expected behavior A better estimation of the crop region so that I have about the same size region regardless of 1 degree of latitude.
Actual results See above.
Screenshots If applicable, add screenshots to help explain your problem.
Environment Info:
Additional context
So I've tracked this down to two parts: the size of the lon/lat AreaDefinition we create to perform
ll_bbox
slicing and the number of points used to estimate the boundary around this area.We create a lon/lat area of size 100 by 100:
https://github.com/pytroll/satpy/blob/5b45c32fe0600bd658ce74f75a67898e17fb202d/satpy/scene.py#L477-L479
We then have pyresample estimate the boundary of this by taking a coordinate for every 100 points:
https://github.com/pytroll/pyresample/blob/46de898ec00a6bae243af18ba34dd8f3e53d06f2/pyresample/geometry.py#L2036
Increasing the number of rows/columns in the AreaDefinition or decreasing the frequency of coordinates we take in the boundary improves the estimation here. However, that also decreases performance.
Options I see: