TUW-GEO / ascat

Read and visualize data from the Advanced Scatterometer (ASCAT) on-board the series of Metop satellites
https://ascat.readthedocs.io/
MIT License
23 stars 16 forks source link

Add `Filenames` base class for subclassing by readers; convert level 1&2 readers to use it #70

Closed claytharrison closed 2 weeks ago

claytharrison commented 3 weeks ago

This PR adds a base class ascat.file_handling.Filenames which handles operations on filenames that are passed to it. It assumes child classes implement the needed methods out of: _read (for reading a single file), _write (for writing data to a single file), and _merge (for merging a list of data objects into a single one). It then handles the reading, writing, and merging of >=1 files using the subclass methods.

The PR also converts all the level 1 and 2 readers to Filenames subclasses along these lines. In fact, they are subclasses of a more general ascat.read_native.AscatFile subclass, which overrides the Filenames read method with some extra logic for spatio-temporal subsetting.

Some things I'm not sure on yet -

claytharrison commented 2 weeks ago

This also includes a few fixes for nan masking in the native readers that I caught while working on them.