HERA Data Quality Metrics.
Project description
# HERA Quality Metrics
[![](https://github.com/HERA-Team/hera_qm/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/HERA-Team/hera_qm/actions) [![codecov](https://codecov.io/gh/HERA-Team/hera_qm/branch/master/graph/badge.svg)](https://codecov.io/gh/HERA-Team/hera_qm)
hera_qm is a python package for calculating quality metrics of HERA data. It is integrated in the Real-Time Pipeline (RTP), automatically generating metrics for all HERA data as it is taken. But hera_qm can also be used offline for further analysis.
## Motivation Data quality metrics are useful and needed throughout the analysis of interferometric data. This repository is a centralized place for the HERA team to develop metrics to 1) run on data in the RTP and deliver to the wider collaboration; 2) store these metrics in the Monitor and Control database for easy access; and 3) use offline in individual analyses. As a consequence of the first two goals, contributions to hera_qm will be vetted by the community and require thorough unittests. However, the code base will also be flexible to enable the third goal, and we welcome contributions (see below).
## Installation Preferred method of installation for users is simply pip install . (or pip install git+https://github.com/HERA-Team/hera_qm). This will install required dependencies. See below for manual dependency management.
### Dependencies If you are using conda, you may wish to install the following dependencies manually to avoid them being installed automatically by pip:
$ conda install -c conda-forge "numpy>=1.23" "astropy>=5.0.4" "h5py>=3.1" "pyuvdata>=2.3" pyyaml
### Developing If you are developing hera_qm, it is preferred that you do so in a fresh conda environment. The following commands will install all relevant development packages:
$ git clone https://github.com/HERA-Team/hera_qm.git $ cd hera_qm $ conda create -n hera_qm python=3 $ conda activate hera_qm $ conda env update -n hera_qm -f environment.yml $ pip install -e .
This will install extra dependencies required for testing/development as well as the standard ones.
### Running Tests Uses the pytest package to execute test suite. From the source hera_qm directory run: `pytest` or `python -m pytest`.
## Package Details and Usage There are currently five primary modules which drive HERA quality metrics.
### ant_metrics A module to handle visibility-based metrics designed to identify misbehaving antennas. The module includes methods to calculate several metrics to identify cross-polarized antennas or dead antennas, based on either their redundancy with other antennas or their relative power. The primary class, AntennaMetrics, includes interfaces to these methods and functions for loading data, iteratively running metrics and removing misbehaving antennas, and saving the results of those metrics in a JSON. And example of using this moduleis in scripts/ant_metrics_example_notebook.ipynb.
### firstcal_metrics A module to calculate metrics based on firstcal delay solutions. These metrics identify large variations in delay solutions across time or across the array for a given time. Included are functions for plotting firstcal delay solutions, running the firstcal metrics, plotting the metrics, and writing them to file. An example of using this module is in scripts/firstcal_metrics.ipynb.
### omnical_metrics A module to calculate metrics based on omnical solutions. Currently, these metrics aim to identify discontinuities in the phase solutions of the gains and model visibilities, as well as outliers in the antenna-based chi-square output from omnical. Routines for calculating the metrics, writing them to file, and plotting the metrics (as well as the gain solutions and model visibilities) are included. For an example of how to use these metrics see scripts/omnical_metrics_example.ipynb. The metrics themselves are detailed there as well as in the doc-strings of the source code in hera_qm.Omnical_Metrics.run_metrics().
### xrfi This module contains the tools to for radio frequency interference (RFI) detection and flagging. Low-level preprocessing functions act on 2D arrays to filter data and/or calculate significance metrics. Flagging algorithms implement the low-level functions or flag in other ways (e.g. “watershed” around existing flags). “Pipelines” define the flagging strategy to apply to some data. For example, xrfi_h1c_pipe shows the flagging scheme we used for H1C observing season. Wrappers handle the file I/O, and call pipelines. xrfi_h1c_run is a wrapper we retroactively made to reflect what we did for H1C.
### UVFlag UVFlag has been moved to [pyuvdata](https://github.com/RadioAstronomySoftwareGroup/pyuvdata).
## Known Issues and Planned Improvements Issues are tracked in the [issue log](https://github.com/HERA-Team/hera_qm/issues). Major current issues and planned improvements include: * A unified metric class structure * Develop Tsys calculations into metrics (HERA Memos 16 and 34) * Develop closure quantities into metrics (HERA Memo 15)
## Contributing Contributions to this package to introduce new functionality or address any of the issues in the [issue log](https://github.com/HERA-Team/hera_qm/issues) are very welcome. Please submit improvements as pull requests against the repo after verifying that the existing tests pass and any new code is well covered by unit tests.
Bug reports or feature requests are also very welcome, please add them to the issue log after verifying that the issue does not already exist. Comments on existing issues are also welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hera_qm-2.2.0.tar.gz
.
File metadata
- Download URL: hera_qm-2.2.0.tar.gz
- Upload date:
- Size: 62.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a14125e6c89249f7856e83de00c8ff7b5d6f0484123d9ecfb286f495a1425a4 |
|
MD5 | a0e1f838c42a484dfbe004a661a3aa69 |
|
BLAKE2b-256 | 68d89c3700e5acdb99e98b84314318faa0f4fc3d939f8b0d756824fb94af9d6a |
File details
Details for the file hera_qm-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: hera_qm-2.2.0-py3-none-any.whl
- Upload date:
- Size: 62.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038bbd174db1e9cb6de06a771fc3ce39ae9c735ac91764fb1485526fc0b4d0f8 |
|
MD5 | 7cbd3374d12d0694ca665751711f3d84 |
|
BLAKE2b-256 | ea707e213af154605e838a24521041e729b06c44cfb6ef42459bd2fb7ec7040e |