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

Adapt avhrr_l1b_gaclac to recent pygac changes #935

Merged
merged 13 commits into from
Oct 25, 2019

Conversation

sfinkens
Copy link
Member

@sfinkens sfinkens commented Oct 11, 2019

Adapt the avhrr_l1b_gaclac reader to the changes introduced by pytroll/pygac#31. This will not be compatible with older pygac versions anymore.

  • Allow user to specify the scanline range to be processed
  • Allow user to specify TLE dir and name (no PYGAC_CONFIG_FILE needed anymore)
  • Make stripping of scanlines with invalid coordinates optional
  • Make coordinate interpolation optional
  • Make clock drift adjustment optional
  • Expose quality flags and some other metadata
  • Buffer channels, angles, etc in the file handler
  • Refine x dimensions:
    • x for channels, and if interpolate_coords=True also for angles/coordinates
    • num_flags for quality flags
    • x_every_eighth for coordinates/angles if interpolate_coords=False
  • Update start_time and end_time using actual scanline timestamps

Example usage:

import satpy
from satpy.utils import logging_on
import logging
logging_on(logging.DEBUG)


def load(filenames, channels):
    scene = satpy.Scene(filenames=filenames, reader='avhrr_l1b_gaclac',
                        reader_kwargs={'start_line': None,
                                       'end_line': None,
                                       'strip_invalid_coords': True,
                                       'adjust_clock_drift': False,
                                       'interpolate_coords': False,
                                       'tle_thresh': 5,
                                       'tle_dir': '/path/to/tle',
                                       'tle_name': 'TLE_%(satname)s.txt'})

    datasets = channels + [
        'solar_zenith_angle',
        'sensor_zenith_angle',
        'solar_azimuth_angle',
        'sensor_azimuth_angle',
        'sun_sensor_azimuth_difference_angle',
        'qual_flags',
        'latitude',
        'longitude'
    ]
    scene.load(datasets)
    for ds in channels:
        scene.show(ds)


filenames = ['input/NSS.GHRR.NJ.D01298.S0157.E0338.B3514748.GC']
channels = ['1', '2', '3', '4', '5']
load(filenames, channels)

channels = ['1', '2', '3a', '3b', '4', '5']
filenames = ['input/NSS.GHRR.NK.D01046.S0614.E0809.B1434546.WI']
load(filenames, channels)
  • Require new pygac release in setup.py
  • Tests added and test suite added to parent suite
  • Tests passed
  • Passes flake8 satpy
  • Fully documented

- Allow user defined scanline range
- Buffer channels, angles, etc
- Expose quality flags and some other metadata
@mraspaud mraspaud added component:readers enhancement code enhancements, features, improvements labels Oct 14, 2019
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link

coveralls commented Oct 16, 2019

Coverage Status

Coverage increased (+0.5%) to 85.934% when pulling 52e41e6 on sfinkens:feature-avhrr-for-pps into a6ce4df on pytroll:master.

@codecov
Copy link

codecov bot commented Oct 16, 2019

Codecov Report

Merging #935 into master will increase coverage by 0.52%.
The diff coverage is 97.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #935      +/-   ##
==========================================
+ Coverage   85.41%   85.93%   +0.52%     
==========================================
  Files         172      172              
  Lines       26046    26405     +359     
==========================================
+ Hits        22246    22691     +445     
+ Misses       3800     3714      -86
Impacted Files Coverage Δ
satpy/readers/avhrr_l1b_gaclac.py 94.85% <95.29%> (+4.71%) ⬆️
satpy/tests/reader_tests/test_avhrr_l1b_gaclac.py 97.97% <99.31%> (+2.97%) ⬆️
satpy/readers/nucaps.py 93.71% <0%> (-0.53%) ⬇️
satpy/scene.py 90.35% <0%> (-0.18%) ⬇️
satpy/tests/test_multiscene.py 97.84% <0%> (ø) ⬆️
satpy/multiscene.py 89.13% <0%> (ø) ⬆️
satpy/readers/modis_l2.py 98.52% <0%> (ø) ⬆️
satpy/readers/seviri_l1b_hrit.py 92.3% <0%> (ø) ⬆️
.../tests/reader_tests/test_viirs_edr_active_fires.py 98.75% <0%> (+0.01%) ⬆️
satpy/tests/reader_tests/test_olci_nc.py 95.6% <0%> (+1.31%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6ce4df...52e41e6. Read the comment docs.

@sfinkens sfinkens marked this pull request as ready for review October 16, 2019 08:03
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comprehensive work on this reader 👍

@mraspaud mraspaud merged commit 2442ed2 into pytroll:master Oct 25, 2019
@sfinkens
Copy link
Member Author

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants