Skip to main content

hera_cal

codecov

The hera_cal package includes modules and scripts for the calibration and LST-binning of Hydrogen 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 using hera_opm.

This package only officially supports python 3, though most functionality will still work in python 2.

Package Details

Modules

I/O and Data Handling

  • hera_cal.io: contains HERACal and HERAData that wrap pyuvdata equivalents and enable easy I/O of data and calibration files.

  • hera_cal.datacontainer: contains the DataContainer object, a dictionary-like container for visibility data with various useful abstractions

Calibration

  • hera_cal.redcal: redundant calibration module, with firstcal, logcal, lincal, and omnical and helper functions for finding and manipulating sets of redundant baselines.

  • hera_cal.abscal: absolute calibration module, largely used to calibrate out redcal degeneraices post-redundant calibration using an externally calibrated data set.

  • hera_cal.skycal: staged sky-model-based calibration (firstcal-style delays and offsets, autocorrelation-based amplitudes, and per-channel complex gain refinement on inter-SNAP cross baselines), designed so that per-SNAP cross-correlation-only signal loss lands only in the refined gains — plus estimate_SNAP_decoherence, which measures that loss per SNAP and per X-engine block from the refined gains' spectral structure.

  • hera_cal.apply_cal: functions to apply calibration solutions (and flags) to data in memory or on disk

  • hera_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 data

LST-Binning

  • hera_cal.lstbin: module for LST-binning, including aligning, rephasing, and MAD clipping, and associated I/O

Filtering and Smoothing

  • hera_cal.smooth_cal: utilities for smoothing calibration solutions in frequency, time, or both

  • hera_cal.vis_clean: base module interface to aipy CLEAN for low- and high-pass filtering visibility data along the time or frequency axis

  • hera_cal.delay_filter: specialization of vis_clean for performing delay filtering (e.g. wedge filtering) of visibility data

  • hera_cal.frf: specialization of vis_clean for performing fringe-rate (e.g. time) filtering of visibility data

Other Utilities

  • hera_cal.noise: utilities for calculating visibility noise from interleaved differences and for predicting visibility noise from autocorrelations

  • hera_cal.autos: module for extracting and saving autocorrelation data

  • hera_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 flags

Scripts

  • apply_cal.py: apply calibration solutions (as associated antenna-based flags) to data
  • auto_reflection_run.py: estimate cable reflection gains from autocorrelations
  • delay_filter_run.py: perform delay filtering outside the wedge
  • extract_autos.py: extract autocorrelation visibilities and save them
  • extract_hh.py: extract data only from the core HERA Hex
  • lstbin_run.py: run the LST-binner
  • noise_from_autos.py: infer noise on visibilities and save as per-antenna noise standard deviation
  • post_redcal_abscal_run.py: run abscal post-redundant calibration and save updated calibration solutions
  • redcal_run.py: run redundant calibration and save firstcal and omnical visibility abd calibration solutions
  • smooth_cal_run.py: smooth calibration solutions in time, frequency, or both

Documentation

The only guaranteed up-to-date documentation of individual functions and classes are their docstrings.

The IDR2.2 Release Memo is a jupyter notebook that can run at NRAO and contains useful examples of data access and visualization.

Many modules have instructional notebooks avaible here, though some of those are out of date.

While hera_cal has a Read the Docs, it is wildly out of date.

Installation

Preferred installation method is pip install . in top-level directory. Alternatively, one can use python setup.py install. This will attempt to install all dependencies. If you prefer to explicitly manage dependencies, see below.

Dependencies

Those who use conda (preferred) may wish to install the following manually before installing hera_cal:

conda install -c conda-forge "numpy>=1.10" scipy scikit-learn h5py astropy pyuvdata

(note that h5py is a dependency of hera_qm, not hera_cal).

Other dependencies that will be installed from PyPI on-the-fly are:

hera_cal also has the optional dependency of aipy, and some functions will not work without this dependency. To install all optional dependencies, use pip install .[all] or pip install git+git://github.com/HERA-Team/hera_cal.git[all].

Development Environment

To install a full development environment for hera_cal, it can be useful to work with a fresh conda environment. 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 use hera_cal, including hera_sim and pytest.

If you are developing hera_cal please install pre-commit: pip install pre-commit and then pre-commit install in the top-level directory. This will check your style before you make commits.

Running tests

Tests use the pytest framework. To run all tests, call pytest or python -m pytest from the base directory of the repo.

Issues and Contribution

Issues are 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 of hera_cal is @jsdillon. Other maintiners who can update the master branch include @AaronParsons, @nkern, @adampbeardsley, and @plaplant.

Metadata

Release files for hera-calibration 3.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hera-calibration 3.8.0
File Size Uploaded
hera_calibration-3.8.0.tar.gz 66.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hera-calibration 3.8.0
File Interpreter ABI Platform
hera_calibration-3.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 131.1 MB

Release files / hera_calibration-3.8.0.tar.gz

Download URL hera_calibration-3.8.0.tar.gz
Size 66.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9dba7885aa303149cca9f617674b8b5781418086fdcfbe70667c4a66502bfdc7
BLAKE2b-256 checksum
How to use checksums
873126458435d7e295c1a6fad3e0347dcbc8acdea2c5d0a8092099e7acd02651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / hera_calibration-3.8.0-py3-none-any.whl

Download URL hera_calibration-3.8.0-py3-none-any.whl
Size 64.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
60ce7129be66730189e43f5502e044a3168cb6d25bd2a0b8426e3d533cf444be
BLAKE2b-256 checksum
How to use checksums
22d6d42a4b1d6e6062b5c4baa2c8da3527cd7d5b5b5debf702a9b555de3ce9db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.8.0 This release

2 release files

3.7.7

2 release files

3.7.6

2 release files

3.7.5

2 release files

3.7.4

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.5

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page