Package: edges-cal
Calculate calibration coefficients for EDGES Calibration
ObservationsInstallationDownload/clone the repo and dopip install .in the top-level directory (optionally add an-efor develop-mode).
Preferably, do this in an isolated python/conda environment.UsageCLIThere is a very basic CLI set up for running a full calibration pipeline
over a set of data. To use it, do$ edges-cal run --helpMultiple options exist, but the only ones required areCONFIGandPATH. The first should point to a YAML configuration for the run,
and the second should point to a directory in which existsS11,ResistanceandSpectrafolders. Thus:$ edges-cal run ~/config.yaml .will work if you are in such a directory.Theconfig.yamlconsists of a set of parameters passed toedges_cal.CalibrationObservation. See its docstring for more
details.In addition, you can run a “term sweep” over a given calibration,
iterating over number of Cterms and Wterms until some threshold is met.
This uses the same configuration asedges-calrun, but you can pass
a maximum number of C and W-terms, along with a threshold at which to
stop the sweep (this is a threshold in absolute RMS over degrees of
freedom). This will write out aCalibrationfile for the “best” set
of parameters.You can also create full Jupyter notebook reports (and convert them to
PDF!) using the CLI. To get this to work, you must installedges-calwithpip installedges-cal[report]. Then you must do the following:Activate the environment you wish to use to generate the reports
(usuallyconda activate edges)Runpython-mipykernel install--user--nameedges--display-name"edges"Note that in the second command, calling it “edges” is necessary
(regardless of the name of your environment!).Now you can run$ edges-cal report PATH --config ~/config.yaml(obviously there are other parameters – useedges-calreport--helpfor help). ThePATHshould again be a calibration observation
directory. The config can be the same file as inedges-calrun, and
is optional. By default, both a notebook and a PDF will be produced, in
theoutputs/directory of the observation. You can turn off the PDF
production with a-Rflag.Similarly, you cancomparetwo observations as a report notebook with$ edges-cal compare PATH COMPARE --config ~/config.yaml --config-cmp ~/config.yamlThis is intended to more easily show up what might be wrong in an
observation, when compared to a “golden” observation, for example.Using the LibraryTo import:import edges_cal as ecMost of the functionality is highly object-oriented, and objects exist
for each kind of data/measurement. However, there is a container object
for all of these, which manages them. Thus you will typically use>>> calobs = ec.CalibrationObservation(path="path/to/top/level")Several other options exist, and they have documentation that you can
access interactively by using>>> help(ec.CalibrationObservation)The most relevant attributes are the (lazily-evaluated) calibration
coefficient models:>>> plt.plot(calobs.freq.freq, calobs.C1())the various plotting routines, eg.>>> calobs.plot_coefficients()and the calibrate/decalibrate methods:>>> calibrated_temp = calobs.calibrate("ambient")Note that this final method can be applied to anyLoadSpectrum–
i.e. you can pass in field observations, or an antenna simulator.