swxsoc_reach.util.util#

Functions

create_reach_filename(time, level, version)

Generate the REACH filename based on the provided parameters.

parse_science_filename(filepath)

Parses a science filename into its constituent properties.

swxsoc_reach.util.util.create_reach_filename(time: str, level: str, version: str, mode: str = '', descriptor: str = '')[source]#

Generate the REACH filename based on the provided parameters.

Parameters:
  • time (str) – The time associated with the data.

  • level (str) – The data level (e.g., “L1”, “L2”).

  • version (str) – The version string (e.g., “0.0.1”). This should be in the format major.minor.patch. This should come from the global attribute Data_version.

  • mode (str) – The instrument mode (e.g., “all”). This should come from the global attribute Instrument_mode.

  • descriptor (str) – The dataset descriptor (e.g., “prelim”). This should come from the global attribute Data_type.

Returns:

str – The generated REACH filename.

swxsoc_reach.util.util.parse_science_filename(filepath: str) dict[source]#

Parses a science filename into its constituent properties.

Parameters:

filepath (str) – Fully qualified filepath of an input file.

Returns:

dict – Parsed fields such as instrument, mode, test, time, level, version, and descriptor.

Raises:

ValueError – If mission name or instrument is not recognized, or time format is invalid.