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

Allow passing a list of filenames `eumetsat` readers #68

Closed claytharrison closed 3 weeks ago

claytharrison commented 1 month ago

RE: #67 Working on allowing eumetsat readers to be passed a list of filenames. Current implementation idea is to stop overriding the _merge_data method from ChronFiles, but instead add a merge method to each of the file classes (AscatL1bEpsFile, etc) that the default ChronFiles._merge_data method already leverages.

This just needs two modifications: 1) The file reader classes' read methods need to be able to accept a list of strings and handle the merging before returning the data if necessary.

2) A modification to somehow allow the merge method to know what product type is being merged (previously, the _merge_data method on the ChronFiles subclass could get this from its self attributes). At the moment I've modified read_eps_l1b and read_eps_l2 to accept a return_ptype bool that would add a "product_type" field to the returned metadata if true. This way a merge method can get the product type of a dataset it's passed by inspecting its metadata. I'm not in love with this approach though and would appreciate other ideas.

Eventually this would of course be applicable to BUFR and NC readers as well

claytharrison commented 3 weeks ago

Following discussion with @sebhahn , implemented this as a more significant change, see #70