edges.io.calobsdef3

Methods for dealing with EDGES-3 files and structures.

class edges.io.calobsdef3.CalObsDefEDGES3(*, open: LoadDefEDGES3, short: LoadDefEDGES3, ambient: LoadDefEDGES3, hot_load: LoadDefEDGES3, receiver_s11: ReceiverS11)[source]

A class for holding calibration observation definitions for EDGES3.

This class holds specifications for where all the data required for the EDGES-3 receiver calibration is located on disk. That is, it holds only paths to files, rather than actual data.

It is convenient in that it also has methods for finding this files in standard situations.

Parameters:
  • open (edges.io.calobsdef3.LoadDefEDGES3) – The loading definition for the open load.

  • short (edges.io.calobsdef3.LoadDefEDGES3) – The loading definition for the short load.

  • ambient (edges.io.calobsdef3.LoadDefEDGES3) – The loading definition for the ambient load.

  • hot_load (edges.io.calobsdef3.LoadDefEDGES3) – The loading definition for the hot load.

  • receiver – The definition for the Receiver S11.

classmethod from_standard_layout(rootdir: str | Path, year: int, day: int, s11_year: int | None = None, s11_day: int | None = None, s11_hour: int | str = 'first', allow_closest_s11_within: int = 5, specfmt: Literal['acq', 'gsh5'] = 'acq', receiver_metadata: dict | None = None) Self[source]

Create a CalObsDefEDGES3 instance from the standard directory layout.

This method locates and loads all required calibration and observation files for the specified date and configuration.

Parameters:
  • rootdir – The root directory containing the data.

  • year – The year of the observation.

  • day (int) – The day of the year for the observation.

  • s11_year (int or None, optional) – The year to use for S11 calibration files. Defaults to year if not provided.

  • s11_day (int or None, optional) – The day to use for S11 calibration files. Defaults to day if not provided.

  • s11_hour (int or str, optional) – The hour to use for S11 calibration files, or “first”/”last” for automatic selection.

  • allow_closest_s11_within (int, optional) – Maximum number of days to search for the closest S11 file.

  • specfmt ({‘acq’, ‘gsh5’}, optional) – The file format for spectrum files.

Returns:

CalObsDefEDGES3 – A CalObsDefEDGES3 instance with all loads and receiver S11 populated.

Raises:
property loads: dict[str, LoadDefEDGES3]

A dictionary of all loads.

class edges.io.calobsdef3.LoadDefEDGES3(*, name: str, s11: LoadS11, spectra: Sequence[str | Path], templog)[source]

File-specification for an EDGES-3 Calibration Load.

Parameters:
  • name (str) – The name of the load.

  • s11 (edges.io.calobsdef.LoadS11) – The S11 measurement files.

  • spectra (list[pathlib.Path]) – The spectrum measurement files.

  • templog (pathlib.Path | None) – The temperature logger file.

classmethod from_standard_layout(root: Path, loadname: Literal['amb', 'hot', 'open', 'short'], year: int, day: int, s11_year: int | None = None, s11_day: int | None = None, s11_hour: int | str = 'first', allow_closest_s11_within: int = 5, specfmt: Literal['acq', 'gsh5'] = 'acq') Self[source]

Create a LoadDefEDGES3 instance from a standard directory layout.

This method locates and loads all required calibration and observation files for the specified date and configuration.

Parameters:
  • root (PathLike) – The root directory containing the data.

  • loadname – The name of the load to gather files for.

  • year (int) – The year of the observation.

  • day (int) – The day of the year for the observation.

  • s11_year (int or None, optional) – The year to use for S11 calibration files. Defaults to year if not provided.

  • s11_day (int or None, optional) – The day to use for S11 calibration files. Defaults to day if not provided.

  • s11_hour (int or str, optional) – The hour to use for S11 calibration files, or “first”/”last” for automatic selection.

  • allow_closest_s11_within (int, optional) – Maximum number of days to search for the closest S11 file.

  • specfmt ({‘acq’, ‘gsh5’}, optional) – The file format for spectrum files.

Returns:

LoadDefEDGES3 – A LoadDefEDGES3 instance with all loads and receiver S11 populated.

Raises:
edges.io.calobsdef3.from_edges3_layout(cls, root_dir: Path | str, load: Literal['amb', 'ant', 'hot', 'open', 'short', 'lna'], year: int, day: int, hour: int | str = 'first', allow_closest_s11_within: int = 5) Self[source]

Create a CalkitEdges3 object from a standard directory layout.

Parameters:
  • root_dir – The root directory to search in

  • load – The name of the load for which the calkit observations were taken.

  • year – The year of observation.

  • day – The day of observation

  • hour – The hour of observation, or “first” for automaic search.

  • allow_closest_s11_within – The number of surrounding days to search for S11.

edges.io.calobsdef3.get_s1p_files(load: Literal['amb', 'ant', 'hot', 'open', 'short', 'lna'], year: int, day: int, root_dir: Path | str, hour: int | str = 'first', allow_closest_s11_within: int = 5) dict[str, Path][source]

Take the load and return a list of .s1p files for that load.

edges.io.calobsdef3.get_spectrum_files(load: Literal['amb', 'hot', 'short', 'open'], root: Path, year: int, day: int, fmt: Literal['acq', 'gsh5'] = 'acq') Path[source]

Get the ACQ files for a particular load.