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

Add xarray_kwargs capability to the geocat reader #2506

Closed
joleenf opened this issue Jun 9, 2023 · 0 comments · Fixed by #2507
Closed

Add xarray_kwargs capability to the geocat reader #2506

joleenf opened this issue Jun 9, 2023 · 0 comments · Fixed by #2507

Comments

@joleenf
Copy link
Contributor

joleenf commented Jun 9, 2023

Feature Request

Problem:
The geocat reader is cannot load the hdf geocat files for 2 reasons:

  1. The netcdf4 engine currently needs to be specified for xarray so that geocat hdf files currently being generated can read with xarray.
  2. The time units (for example, the metadata for the variable scan_line_time) are not cf compliant. They are currently
    units="seconds_since_jan_1_"

Solution (to assist in reading data from current geocat files):
Add an __init__ to the GEOCATFileHandler so that xarray_kwargs can be passed through the reader_kwargs when the scene is loaded:

scene = satpy.Scene(filenames, reader='geocat', reader_kwargs={'decode_times': True})

Set the defaults of these arguments to {"engine": "netcdf4", "decode_times": False} which will still allow users to set decode_times and engines as needed if the units are changed in the geocat software.

Workflow Changes
As I understand this, it will not affect backward compatibility. It might force the addition of future reader_kwargs if the geocat software package is updated.

Additional context
The question of updating the metadata for the units has been presented to the geocat team. However, this software is already in use by many teams and it appears that this bug in the metadata has not been reported. In the end, it would be nice if this reader could work regardless of the final decision by the team concerning the units metadata. Old files will have this unit specification and the software has been in use for a while.

joleenf added a commit to joleenf/satpy that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant