Package: hera-calibration
hera_calThe hera_cal package includes modules and scripts for the calibration and LST-binning ofHydrogen Epoch of Reionization Array (HERA)data, along with various helpful methods for filtering and smoothing of data and calibration solutions. These are meant for use interatively, as part of offline analysis (e.g.IDR 2.2), or as part of HERA's realtime analysis pipeline usinghera_opm.This package only officially supports python 3, though most functionality will still work in python 2.Package DetailsModulesI/O and Data Handlinghera_cal.io: containsHERACalandHERADatathat wrappyuvdataequivalents and enable easy I/O of data and calibration files.hera_cal.datacontainer: contains theDataContainerobject, a dictionary-like container for visibility data with various useful abstractionsCalibrationhera_cal.redcal: redundant calibration module, withfirstcal,logcal,lincal, andomnicaland helper functions for finding and manipulating sets of redundant baselines.hera_cal.abscal: absolute calibnration module, largely used to calibrate out redcal degeneraices post-redundant calibration using an externally calibrated data set.hera_cal.apply_cal: functions to apply calibration solutions (and flags) to data in memory or on diskhera_cal.reflections: functions for fitting per-antenna cable reflections and other per-baseline high-delay systematics (e.g. cross-talk)hera_cal.tempcal: functions for calibrating using external temperature dataLST-Binninghera_cal.lstbin: module for LST-binning, including aligning, rephasing, and MAD clipping, and associated I/OFiltering and Smoothinghera_cal.smooth_cal: utilities for smoothing calibration solutions in frequency, time, or bothhera_cal.vis_clean: base module interface to aipy CLEAN for low- and high-pass filtering visibility data along the time or frequency axishera_cal.delay_filter: specialization ofvis_cleanfor performing delay filtering (e.g. wedge filtering) of visibility datahera_cal.frf: specialization ofvis_cleanfor performing fringe-rate (e.g. time) filtering of visibility dataOther Utilitieshera_cal.noise: utilities for calculating visibility noise from interleaved differences and for predicting visibility noise from autocorrelationshera_cal.autos: module for extracting and saving autocorrelation datahera_cal.utils: grabbag of useful functions, including polarization string handling, FFT-based delay fitting, time and LST math, solar position calculation, chi^2 calculations, etc.hera_cal.flag_utils: utilities for applying, synthesizing, and factoring flagsScriptsapply_cal.py: apply calibration solutions (as associated antenna-based flags) to dataauto_reflection_run.py: estimate cable reflection gains from autocorrelationsdelay_filter_run.py: perform delay filtering outside the wedgeextract_autos.py: extract autocorrelation visibilities and save themextract_hh.py: extract data only from the core HERA Hexlstbin_run.py: run the LST-binnernoise_from_autos.py: infer noise on visibilities and save as per-antenna noise standard deviationpost_redcal_abscal_run.py: run abscal post-redundant calibration and save updated calibration solutionsredcal_run.py: run redundant calibration and save firstcal and omnical visibility abd calibration solutionssmooth_cal_run.py: smooth calibration solutions in time, frequency, or bothDocumentationThe only guaranteed up-to-date documentation of individual functions and classes are their docstrings.TheIDR2.2 Release Memois a jupyter notebook that can run at NRAO and contains useful examples of data access and visualization.Many modules haveinstructional notebooks avaible here, though some of those are out of date.Whilehera_calhas aRead the Docs, it is wildly out of date.InstallationPreferred installation method ispip install .in top-level directory. Alternatively,
one can usepython setup.py install. This will attempt to install all dependencies.
If you prefer to explicitly manage dependencies, see below.DependenciesThose who useconda(preferred) may wish to install the following manually before
installinghera_cal:conda install -c conda-forge "numpy>=1.10" scipy scikit-learn h5py astropy pyuvdata(note thath5pyis a dependency ofhera_qm, nothera_cal).Other dependencies that will be installed from PyPI on-the-fly are:linsolvehera_qmhera_filtershera_calalso has theoptionaldependency ofaipy, and some
functions will not work without this dependency. To install all optional dependencies, usepip install .[all]orpip install git+git://github.com/HERA-Team/hera_cal.git[all].Development EnvironmentTo install a full development environment forhera_cal, it can be useful to work with
a freshcondaenvironment. These steps will get you up and running::$ conda create -n hera_cal python=3
$ conda activate hera_cal
$ conda env update -n hera_cal -f environment.yml
$ pip install -e .This installs extra packages than those required to usehera_cal, includinghera_simandpytest.If you are developinghera_calplease install pre-commit:pip install pre-commitand
thenpre-commit installin the top-level directory. This will check your style before
you make commits.Running testsTests use thepytestframework. To run all tests, callpytestorpython -m pytestfrom the base directory of the repo.Issues and ContributionIssuesare tracked here. Please submit bugs, feature requests, etc. Contributions to this repo via pull request are welcome, though they require thorough peer review before merging into the master branch. To the best of our ability, all code should be covered with tests. The primary maintainer ofhera_calis@jsdillon. Other maintiners who can update the master branch include@AaronParsons,@nkern,@adampbeardsley, and@plaplant.