Skip to content
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

Image produced by gradient_search has slightly different extent to native #444

Open
simonrp84 opened this issue Jul 12, 2022 · 1 comment
Assignees
Labels

Comments

@simonrp84
Copy link
Member

When I crop a GOES-16 image and then resample using gradient_search, the resulting image appears to be missing pixels on the bottom and right-hand side compared to the native resampler.
Gradient:
test_gradient_search
Native:
test_native

You probably have to load the two images in separate tabs and then quickly flick between them to notice the difference.

Here's the code I'm using:

from satpy import Scene, resample
from satpy.readers import FSFile

the_files = fsspec.open_files("filecache::s3://noaa-goes16/ABI-L1b-RadF/2022/185/17/*_s20221851700*", s3={'anon': True})
fs_files = [FSFile(open_file) for open_file in the_files]
scn = Scene(filenames=fs_files, reader='abi_l1b')

c_lat = 14.4747
c_lon = -90.8806
dell = 1.0

bbox = (c_lon - dell, c_lat - dell, c_lon + dell, c_lat + dell)

scn.load(['true_color_nocorr'])

scn2 = scn.crop(ll_bbox=bbox)
scn3 = scn2.resample(scn2.finest_area(), resampler='native')
scn3.save_dataset('true_color_nocorr', filename='./test_native.png')
print(scn3['true_color_nocorr'].attrs['area'])

scn = Scene(filenames=fs_files, reader='abi_l1b')
scn.load(['true_color_nocorr'])

scn2 = scn.crop(ll_bbox=bbox)
scn3 = scn2.resample(scn2.finest_area(), resampler='gradient_search')
scn3.save_dataset('true_color_nocorr', filename='./test_gradient_search.png')
print(scn3['true_color_nocorr'].attrs['area'])

The printed area definitions are identical, it's just the output images that vary.

@djhoese
Copy link
Member

djhoese commented Jul 12, 2022

Looks like an off-by-one type of error (a > that should be an >= or something)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants