Skip to content

Update dataset loader to handle the potential of many asdf files for a single dataset due to naming suffix changes #496

@Cadair

Description

@Cadair

Over the last while the data centre has made ASDF files with two different naming conventions:

  • f"{instrument}_L1_{start_time:%Y%m%dT%H%M%S}_{dataset_id}..asdf"
  • f"{instrument}_L1_{start_time:%Y%m%dT%H%M%S}_{dataset_id}_user_tools..asdf"

In the future this suffix will be changed to:

  • f"{instrument}_L1_{start_time:%Y%m%dT%H%M%S}_{dataset_id}_metadata.asdf"

Therefore we need to adapt the directory loader to handle picking the most applicable of these patterns if more than one is detected in the folder. I think the algorithm should be as follows:

  • Glob the directory for all ASDF files
  • Group all results by the dataset id in the filename
  • Pick the ASDF file to use with the following priority: (_metadata, _user_tools, <nothing>)
  • Throw a warning to the user if any ASDF files with older suffixes are found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions