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

Resampling of long passes of metop l1b eps data gives strange results #1002

Closed
TAlonglong opened this issue Dec 6, 2019 · 10 comments
Closed

Comments

@TAlonglong
Copy link
Collaborator

TAlonglong commented Dec 6, 2019

When resampling a long pass of global metop l1b eps data with compute_optimal_bb_area some strange results appear.

The image below is a small capture of the resampled data showing the strange results.

Screenshot from 2019-12-06 10-03-28

https://drive.google.com/open?id=1jNxMLVe0bXXEfUJ0QBcq4_8HdLNEovCb

When eg. displayed in DIANA, and DIANA itself resample the image to eg. a stere projection results like this shows up ( this time over the Antarctic)

metop-c-global3
https://drive.google.com/open?id=1pSN-o5ZV-1Z0g7pqVJMmUFgBVSyl_nEM

with a close up:

metop-c-global4
https://drive.google.com/open?id=1_vVzLUwV2dt7FoxRAcZVJ-F59kvhSLwD

It looks like the feature starts at the south pole


from satpy import Scene, find_files_and_readers
from pyresample import geometry

from satpy.utils import debug_on
debug_on()

files = find_files_and_readers(start_time=datetime.datetime(2019, 12, 6, 7, 7, 3),
                               end_time=datetime.datetime(2019, 12, 6, 7, 22, 3),
                               base_dir='/data/pytroll/testdata',
                               reader='avhrr_l1b_eps',
                               filter_parameters={'platform_short_name': 'M03'})
ql = Scene(filenames=files)

ql.load(['overview', 'latitude', 'longitude'])

sd = geometry.SwathDefinition(ql['longitude'], ql['latitude'], nprocs=4)
bb_area = sd.compute_optimal_bb_area()
local_scene = ql.resample(bb_area, nprocs=16, radius_of_influence=5000)

local_scene.save_dataset('overview', 'test.png')

The code uses the simple image writer to save to a png. But the images above is produced with the mitiff writer. The feature exists using both writers.

Environment Info:

  • OS: linux
  • Satpy Version: 0.16.1 and 0.18.1
  • PyResample Version: 1.12.3 and 1.13.1
@mraspaud
Copy link
Member

mraspaud commented Dec 6, 2019

Thanks for reporting this. You mention here that the problem appears with long passes, so do I understand correctly that short passes don't exhibit this problem ?

@TAlonglong
Copy link
Collaborator Author

Oh, I forgot to test that. Just a few minutes.

@TAlonglong
Copy link
Collaborator Author

TAlonglong commented Dec 6, 2019

Testing with 3 segments of data gives good results. These are the segments where the feature appear. So the original data must be fine.

[DEBUG: 2019-12-06 10:55:45 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071603Z_20191206071903Z_N_O_20191206082758Z
[DEBUG: 2019-12-06 10:55:45 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071903Z_20191206072203Z_N_O_20191206082825Z
[DEBUG: 2019-12-06 10:55:46 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206072203Z_20191206072503Z_N_O_20191206082851Z

Testing now with one more segment closer to the South Pole

@TAlonglong
Copy link
Collaborator Author

4 segments still ok.

[DEBUG: 2019-12-06 11:00:50 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071303Z_20191206071603Z_N_O_20191206082728Z
[DEBUG: 2019-12-06 11:00:51 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071603Z_20191206071903Z_N_O_20191206082758Z
[DEBUG: 2019-12-06 11:00:51 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071903Z_20191206072203Z_N_O_20191206082825Z
[DEBUG: 2019-12-06 11:00:52 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206072203Z_20191206072503Z_N_O_20191206082851Z

@TAlonglong
Copy link
Collaborator Author

With 5 segments the feature reappeared

[DEBUG: 2019-12-06 11:04:30 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071003Z_20191206071303Z_N_O_20191206082627Z
[DEBUG: 2019-12-06 11:04:30 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071303Z_20191206071603Z_N_O_20191206082728Z
[DEBUG: 2019-12-06 11:04:31 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071603Z_20191206071903Z_N_O_20191206082758Z
[DEBUG: 2019-12-06 11:04:31 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206071903Z_20191206072203Z_N_O_20191206082825Z
[DEBUG: 2019-12-06 11:04:32 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/AVHR_xxx_1B_M03_20191206072203Z_20191206072503Z_N_O_20191206082851Z

@mraspaud
Copy link
Member

mraspaud commented Dec 6, 2019

Thank you for checking this. I got the data locally, I will have a look a it.

@mraspaud
Copy link
Member

mraspaud commented Dec 6, 2019

Reproduced. I'll look into it.

@mraspaud
Copy link
Member

I've looked a bit, and I'm pretty sure this isn't a satpy/pyresample bug, but something in proj. I got some strange behaviour to show up, and reported the issue to proj, let's see what they say:
OSGeo/PROJ#1922

@mraspaud
Copy link
Member

@TAlonglong We got an answer in the issue above, and this can be fixed by setting the ellipsoid of omerc_bb to sphere. I'll change the default in satpy.
(the calls you perform in your script are equivalent to using the omerc_bb area to resample to)

@mraspaud
Copy link
Member

This should be solved with pytroll/pyresample#252

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

No branches or pull requests

2 participants