edges.io.calobsdef

A module defining the overall file structure and internal contents of cal obs.

This module defines the overall file structure and internal contents of the calibration observations. It does not implement any algorithms/methods on that data, making it easier to separate the algorithms from the data checking/reading.

class edges.io.calobsdef.CalObsDefEDGES2(*, open: LoadDefEDGES2, short: LoadDefEDGES2, ambient: LoadDefEDGES2, hot_load: LoadDefEDGES2, internal_switch: InternalSwitch | list[InternalSwitch], receiver_s11: ReceiverS11 | list[ReceiverS11], run_num: int = None)[source]

File-specification for a full calibration observation with EDGES-2.

Parameters:
  • open (edges.io.calobsdef.LoadDefEDGES2) – The open load definition.

  • short (edges.io.calobsdef.LoadDefEDGES2) – The short load definition.

  • ambient (edges.io.calobsdef.LoadDefEDGES2) – The ambient load definition.

  • hot_load (edges.io.calobsdef.LoadDefEDGES2) – The hot load definition.

  • internal_switch (edges.io.calobsdef.InternalSwitch | list[edges.io.calobsdef.InternalSwitch]) – The internal switch definition.

  • receiver_s11 (edges.io.calobsdef.ReceiverS11 | list[edges.io.calobsdef.ReceiverS11]) – The receiver S11 definition.

  • run_num (int) – The run number used throughout the files.

  • receiver_female_resistance – The female resistance of the receiver, used in calibrating the calkit standards measurements.

  • male_resistance – The male resistance.

classmethod from_standard_layout(rootdir: str | Path, run_num: int = 1, repeat_num: int = 1) Self[source]

Create a CalObsDefEDGES2 object from a standard directory layout.

Parameters:
  • rootdir – The root directory of the observation.

  • run_num – The run number to search for (often there is only one run).

  • repeat_num – The repeat number to search for (generally, repeats are taken closer together than “runs”).

property loads: dict[str, LoadDefEDGES2]

A dictionary of the loads.

class edges.io.calobsdef.CalkitFileSpec(*, match, open, short)[source]

File-specification for calkit S11 measurements.

Parameters:
  • match (pathlib.Path) – The S11 measurements of the match standard.

  • open (pathlib.Path) – The S11 measurements of the open standard.

  • short (pathlib.Path) – The S11 measurements of the short standard.

classmethod from_edges2_layout(direc: str | Path, repeat_num: int = 1, allow_other: bool = True, prefix: str = '') Self[source]

Create a CalkitEdges2 object from a standard directory layout.

Parameters:
  • direc – The directory to search.

  • repeat_num – The repeat num to use.

  • allow_other – Whether to allow other repeat numbers if the one specified is not found.

  • prefix – A prefix for the files. Sometimes this is necessary to find, e.g. External<load>.s1p

classmethod from_edges3_layout(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

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.

class edges.io.calobsdef.HotLoadSemiRigidCable(*, osl: CalkitFileSpec, metadata: Path | str | dict = NOTHING)[source]

File specification for the hot-load semi-rigid cable S-parameters.

property calkit: str

The model name of the calkit used for the calkit measurements.

property calkit_match_resistance: Quantity, PhysicalType({'electrical impedance', 'electrical reactance', 'electrical resistance'})]

The measured resistance of the match standard in the calkit.

class edges.io.calobsdef.InternalSwitch(*, internal: CalkitFileSpec, external: CalkitFileSpec, metadata: Path | str | dict = NOTHING)[source]

File-specification for VNA measurements to compute Sparams of internal switch.

Parameters:
  • internal (edges.io.calobsdef.CalkitFileSpec) – Measurements of the internal calkit loads.

  • external (edges.io.calobsdef.CalkitFileSpec) – Measurements of the external calkit loads (plugged in at the source input).

property calkit_match_resistance: Annotated[Quantity, Unit('Ohm')]

The measured resistance of the match standard in the calkit.

property external_calkit

The name of the calkit used for the calkit measurements.

property temperature: Annotated[Quantity, PhysicalType('temperature')] | None

The temperature at which the internal switch measurements were made.

class edges.io.calobsdef.LoadDefEDGES2(*, name: str, thermistor, s11: LoadS11, spectra: Sequence[str | Path], sparams_file: Path | None = None)[source]

File-specification for an EDGES2 calibration load.

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

  • thermistor (pathlib.Path) – The thermistor measurements of the load.

  • s11 (edges.io.calobsdef.LoadS11) – The S11 measurements of the load.

  • spectra (list[pathlib.Path]) – The spectra measurements of the load.

  • sparams_file (pathlib.Path | None) – This file, if given, contains the S-parameters of the load device (e.g. the semi-rigid cable for a hot load).

classmethod from_standard_layout(root: str | Path, loadname: str, run_num: int = 1, rep_num: int = 1, sparams_file: Path | None = None) Self[source]

Createa a LoadDefEDGES2 object from a standard directory layout.

Parameters:
  • root – The root directory of the observation.

  • loadname – The name of the load to search for.

  • run_num – The run number to search for.

  • rep_num – The repeat number to search for.

  • sparams_file – An optional file containing S-parameters of the load device (e.g. the semi-rigid cable for a hot load).

class edges.io.calobsdef.LoadS11(calkit: CalkitFileSpec, external)[source]

File-specification for the S11 measurements of a calibration load.

Parameters:
  • calkit (edges.io.calobsdef.CalkitFileSpec) – The calkit measurements of the load.

  • external (pathlib.Path) – The external S11 measurement of the load.

class edges.io.calobsdef.ReceiverS11(*, calkit: CalkitFileSpec, device, metadata: Path | str | dict = NOTHING)[source]

File-specification for the receiver S11 measurement.

Parameters:
  • calkit (edges.io.calobsdef.CalkitFileSpec) – The calkit measurements of the receiver S11.

  • device (pathlib.Path) – The external measurements of the receiver S11.

property calkit_match_resistance

The measured resistance of the match standard in the calkit.

property calkit_name

The name of the calkit used for the calkit measurements.

property external: Path

Alias for the ‘device’ measurement.