edges.alanmode.alanio

Functions for writing/reading to/from file formats used in the C pipeline.

edges.alanmode.alanio.read_alan_calibrated_temp(fname: str | Path) ndarray[source]

Read calibrated_{load}.txt from edges3.c.

This gives uncalibrated and calibrated temperatures.

edges.alanmode.alanio.read_all_spec_txt(direc: Path, flow, fhigh)[source]

Read all spe_*r.txt files from a directory into a dict of spectra.

edges.alanmode.alanio.read_modelled_s11s(pth: Path) QTable[source]

Read modelled S11s from a csv file.

edges.alanmode.alanio.read_raul_s11_format(fname: str | Path) dict[str, ndarray][source]

Read files containing S11’s for all loads, LNA, and rigid cable, for EDGES-2.

These files are outputs from Raul’s pipeline, and were used as inputs for the C-code in EDGES-2 in some cases.

edges.alanmode.alanio.read_s11_csv(fname) tuple[ndarray, ndarray][source]

Read a CSV file containing S11 data in Alan’s output format.

edges.alanmode.alanio.read_spe_file(filename: str | ~pathlib.Path, time: ~astropy.time.core.Time = <Time object: scale='utc' format='datetime' value=2026-01-05 22:51:19.186582>, telescope: str = 'edges-low', name: str = '')[source]

Read Alan’s spectrum files with formats like those of spe0.txt.

edges.alanmode.alanio.read_spec_txt(fname: str | Path, time: Time | None = None, telescope: str = 'edges-low', name: str = '') GSData[source]

Read an averaged-spectrum file, like the ones output by acqplot7amoon.

edges.alanmode.alanio.read_specal(fname: str | Path, t_load: float, t_load_ns: float) Calibrator[source]

Read a specal file, like the ones output by edges3(k).

edges.alanmode.alanio.read_specal_iter(fname: str | Path) ndarray[source]

Read a specal file, like the ones output by edges3(k).

The outputs are from an intermediate iteration of NW modeling step.

edges.alanmode.alanio.write_modelled_s11s(calobs: CalibrationObservation, fname: str | Path, hot_loss_model=None)[source]

Write all modelled S11’s in a calobs object to file, in the same format as C.

If a HotLoadCorrection exists, also write the rigid cable S-parameters, as edges2k.c does, otherwise assume the edges3.c format.

edges.alanmode.alanio.write_s11_csv(freq, s11, fname)[source]

Write a standard S11 CSV file.

edges.alanmode.alanio.write_spec_txt(freq: ndarray | Annotated[Quantity, PhysicalType('frequency')], n: int | float, spec: ndarray, fname: str | Path)[source]

Write an averaged-spectrum file, like spe_<load>r.txt files from edges2k.c.

edges.alanmode.alanio.write_spec_txt_gsd(gsd: GSData, fname: str | Path)[source]

Write a standard spe.txt file given a GSData object.

edges.alanmode.alanio.write_specal(calibrator: Calibrator, outfile: str | Path, t_load: float, t_load_ns: float, precision='10.6f')[source]

Write a specal file in the same format as those output by the C-code edges3.c.