Skip to main content

A pythonic interface for radio astronomy interferometry data

Project description

pyuvdata

CircleCI codecov DOI

pyuvdata defines a pythonic interface to interferometric data sets. Currently pyuvdata supports reading and writing of miriad, uvfits, CASA measurement sets and uvh5 files and reading of FHD (Fast Holographic Deconvolution) visibility save files, SMA Mir files and MWA correlator FITS files.

API documentation and a tutorial is hosted on ReadTheDocs.

Motivation

The main goals are:

  1. To provide a high quality, well documented path to convert between data formats
  2. Support the direct use of datasets from python with minimal software
  3. Provide precise data definition via both human readable code and high quality online documentation

Package Details

pyuvdata has four major user classes:

  • UVData: supports interferometric data (visibilities) and associated metadata
  • UVCal: supports interferometric calibration solutions (antenna-based) and associated metadata (Note that this is a fairly new object, consider it to be a beta version)
  • UVBeam: supports primary beams (E-field or power) and associated metadata (Note that this is a fairly new object, consider it to be a beta version)
  • UVFlag: A class to handle the manipulation and combination of flags for data sets. Also can convert raw data quality metrics into flags using thresholding. (This object is very new and experimental. Consider it to be a beta version)

UVData File standard notes

  • miriad has been thoroughly tested with aipy-style miriad files and minimally tested with ATCA files
  • uvfits conforms to AIPS memo 117 (as of March 2020). It is tested against FHD, CASA, and AIPS. However AIPS is limited to <80 antennas and CASA uvfits import does not seem to support >255 antennas. Users with data sets containing > 255 antennas should use the measurement set writer instead.
  • CASA measurement sets, primarily conforming to CASA Memo 229, with some elements taken from the proposed v3.0 format documented in CASA Memo 264. Measurement sets are tested against VLA and MWA data sets, (the latter filled via cotter), with some manual verification haven been performed against ALMA and SMA data sets, the latter filled using the importuvfits task of CASA. tested against ALMA-filled datasets and with SMA datasets
  • uvh5 is an HDF5-based file format defined by the HERA collaboration, details in the uvh5 memo. Note that this is a somewhat new format, so it may evolve a bit but we will strive to make future versions backwards compatible with the current format. It is probably not compatible with other interferometric HDF5 files defined by other groups.
  • FHD (read-only support, tested against MWA and PAPER data)
  • MIR (read-only support, though experimental write functions are available, tested against SMA data)
  • MWA correlator FITS files (read-only support, tested against Cotter outputs and FHD)

UVCal file formats

  • calh5: a new format defined in pyuvdata, details to come in a forthcoming memo.
  • Measurement Set calibration files (read and write, gains/delay/bandpass supported, beta version). Tested against a limited set of SMA, LWA, and VLA calibration files generated in CASA.
  • calfits: a custom format defined in pyuvdata, details in the calfits_memo. Note that this format was recently defined and may change in coming versions, based on user needs. Consider it to be a beta version, but we will strive to make future versions backwards compatible with the current format.
  • FHD calibration files (read-only support)

UVBeam file formats

  • regularly gridded fits for both E-field and power beams
  • non-standard HEALPix fits for both E-field and power beams (in an ImageHDU rather than a binary table to support frequency, polarization and E-field vector axes)
  • read support for CST beam text files, with a defined yaml file format for metadata, details here: cst settings file

Under Development

  • UVCal: object and calfits file format (beta version)
  • UVBeam: object and beamfits file format (beta version)
  • UVFlag: object and HDF5 file format. (beta version)
  • Mir: object (part of UVData class) (beta version)
  • MirParser: object and python interface for MIR file format (beta version)

Known Issues and Planned Improvements

  • UVBeam: support phased-array antenna beams (e.g. MWA beams).
  • UVFlag: Adding requires a high level knowledge of individual objects. (see issue #653)

For details see the issue log.

Community Guidelines

Contributions to this package to add new file formats or address any of the issues in the issue log are very welcome, as are bug reports and feature requests. Please see our guide on contributing

Telescopes

pyuvdata has been used with data from the following telescopes. If you use it on data from a telescope we don't have listed here please let us know how it went via an issue! We would like to make pyuvdata generally useful to the community for as many telescopes as possible.

  • MWA
  • HERA
  • PAPER
  • LWA
  • ALMA
  • VLA
  • ATCA
  • SMA

Versioning

We use a generation.major.minor version number format. We use the generation number for very significant improvements or major rewrites, the major number to indicate substantial package changes (intended to be released every 3-4 months) and the minor number to release smaller incremental updates (intended to be released approximately monthly and which usually do not include breaking API changes). We do our best to provide a significant period (usually 2 major generations) of deprecation warnings for all breaking changes to the API. We track all changes in our changelog.

History

pyuvdata was originally developed in the low frequency 21cm community to support the development of and interchange of data between calibration and foreground subtraction pipelines. Particular focus has been paid to supporting drift and phased array modes.

Citation

Please cite pyuvdata by citing our JOSS paper:

Hazelton et al, (2017), pyuvdata: an interface for astronomical interferometeric datasets in python, Journal of Open Source Software, 2(10), 140, doi:10.21105/joss.00140

ADS Link; Bibtex entry

Installation

Simple installation via conda is available for users, developers should follow the directions under Developer Installation below.

For simple installation, the latest stable version is available via conda (preferred: conda install -c conda-forge pyuvdata) or pip (pip install pyuvdata).

There are some optional dependencies that are required for specific functionality, which will not be installed automatically by conda or pip. See Dependencies for details on installing optional dependencies.

Dependencies

Required:

  • astropy >= 6.0
  • docstring_parser>=0.15
  • h5py >= 3.4
  • numpy >= 1.23
  • pyerfa >= 2.0.1.1
  • python >= 3.10
  • pyyaml >= 5.4.1
  • scipy >= 1.8
  • setuptools_scm >= 8.1

Optional:

  • astropy-healpix >= 1.0.2 (for working with beams in HEALPix formats)
  • astroquery >= 0.4.4 (for enabling phasing to ephemeris objects using JPL-Horizons)
  • hdf5plugin >= 3.2.0 (for enabling bitshuffle and other hdf5 compression filters in uvh5 files)
  • lunarsky >=0.2.5 (for working with simulated datasets for lunar telescopes)
  • novas and novas_de405 (for using the NOVAS library for astrometry)
  • python-casacore >= 3.5.2 (for working with CASA measurement sets)

The numpy and astropy versions are important, so make sure these are up to date.

We suggest using conda to install all the dependencies. If you want to install python-casacore and astropy-healpix, you'll need to add conda-forge as a channel (conda config --add channels conda-forge).

If you do not want to use conda, the packages are also available on PyPI (python-casacore may require more effort, see details for that package below). You can install the optional dependencies via pip by specifying an option when you install pyuvdata, as in pip install pyuvdata[healpix] which will install all the required packages for using the HEALPix functionality in pyuvdata. The options that can be passed in this way are: [astroquery, casa, cst, hdf5_compression, healpix, lunar, novas, all, test, doc, dev]. The first set (astroquery, casa, cst, hdf5_compression, healpix, lunar, novas) enable various specific functionality while all will install all optional dependencies. The last three (test, doc, dev) may be useful for developers of pyuvdata.

Installing python-casacore

python-casacore requires the casacore c++ libraries. It can be installed easily using conda (python-casacore on conda-forge).

If you do not want to use conda, the casacore c++ libraries are available for ubuntu through the kern suite. On OSX, casacore is available through the ska-sa brew tap. The python-casacore library (with manual install instructions) is available at https://github.com/casacore/python-casacore

Developer Installation

Clone the repository using git clone https://github.com/RadioAstronomySoftwareGroup/pyuvdata.git

Navigate into the pyuvdata directory and run pip install . (note that python setup.py install does not work). Note that this will attempt to automatically install any missing dependencies. If you use anaconda or another package manager you might prefer to first install the dependencies as described in Dependencies.

To install without dependencies, run pip install --no-deps .

To compile the binary extension modules such that you can successfully run import pyuvdata from the top-level directory of your Git checkout, run: python setup.py build_ext --inplace

If you want to do development on pyuvdata, in addition to the other dependencies you will need the following packages:

  • pytest >= 6.2
  • pytest-cases >= 3.8.3
  • pytest-cov
  • cython >=3.0
  • coverage
  • pre-commit
  • matplotlib
  • sphinx
  • pypandoc

One other package, pytest-xdist, is not required, but can be used to speed up running the test suite by running tests in parallel. To use it call pytest with the -n auto option.

One way to ensure you have all the needed packages is to use the included environment.yaml file to create a new environment that will contain all the optional dependencies along with dependencies required for testing and development (conda env create -f environment.yaml). Alternatively, you can specify test, doc, or dev when installing pyuvdata (as in pip install pyuvdata[dev]) to install the packages needed for testing (including coverage and linting) and documentation development; dev includes everything in test and doc.

To use pre-commit to prevent committing code that does not follow our style, you'll need to run pre-commit install in the top level pyuvdata directory.

Tests

Uses the pytest package to execute test suite. From the source pyuvdata directory run pytest or python -m pytest.

Testing of UVFlag module requires the pytest-cases plug-in.

API

The primary interface to data from python is via the UVData object. It provides import functionality from all supported file formats (UVFITS, Miriad, UVH5, FHD, CASA measurement sets, SMA Mir, MWA correlator FITS) and export to UVFITS, Miriad, CASA measurement sets and UVH5 formats and can be interacted with directly. Similarly, the primary calibration, beam, and flag interfaces are via the UVCal, UVBeam, and UVflag objects. The attributes of the UVData, UVCal, UVBeam, and UVFlag objects are described in the UVData Parameters, UVCal Parameters, UVBeam Parameters and UVFlag Parameters pages on ReadTheDocs.

Maintainers

pyuvdata is maintained by the RASG Managers, which currently include:

  • Adam Beardsley (Winona State University)
  • Bryna Hazelton (University of Washington)
  • Garrett "Karto" Keating (Smithsonian Astrophysical Observatory)
  • Daniel Jacobs (Arizona State University)
  • Matt Kolopanis (Arizona State University)
  • Paul La Plante (University of Nevada, Las Vegas)
  • Jonathan Pober (Brown University)

Please use the channels discussed in the guide on contributing for code-related discussions. You can contact us privately if needed at rasgmanagers@gmail.com.

Acknowledgments

Support for pyuvdata was provided by NSF awards #1835421 and #1835120.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyuvdata-3.1.0.tar.gz (51.2 MB view details)

Uploaded Source

Built Distributions

pyuvdata-3.1.0-cp312-cp312-win_amd64.whl (47.3 MB view details)

Uploaded CPython 3.12 Windows x86-64

pyuvdata-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (51.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyuvdata-3.1.0-cp312-cp312-macosx_11_0_arm64.whl (48.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyuvdata-3.1.0-cp312-cp312-macosx_10_9_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyuvdata-3.1.0-cp311-cp311-win_amd64.whl (47.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyuvdata-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (51.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyuvdata-3.1.0-cp311-cp311-macosx_11_0_arm64.whl (48.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyuvdata-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyuvdata-3.1.0-cp310-cp310-win_amd64.whl (47.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyuvdata-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (50.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyuvdata-3.1.0-cp310-cp310-macosx_11_0_arm64.whl (48.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyuvdata-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file pyuvdata-3.1.0.tar.gz.

File metadata

  • Download URL: pyuvdata-3.1.0.tar.gz
  • Upload date:
  • Size: 51.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyuvdata-3.1.0.tar.gz
Algorithm Hash digest
SHA256 0205b56af6ce271342cdd22ae11832a0dcdf24eb71d98337c1df49e7cba66022
MD5 12389924205c98914ce94058c2372ffe
BLAKE2b-256 1a8a4061630a000ccc41c996da7fe7e7a45cce6d0a616f62041c6b0663bab94d

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyuvdata-3.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 47.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyuvdata-3.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e87c3b259b92090d11c5bd8d5fedc0236f7baa0bc76b4063b1de8fe414432b1a
MD5 1f3716b1bd41bc4d8407dc7df6086010
BLAKE2b-256 e36e7a91b831c7df88fc4b14e1795be1f8c1e612f1ae453607345037837a3544

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e667135eb394562766b8142036bf77cb9e4056678a056f9b70142a7f02dfd62
MD5 2a254d671ca92114128a9ef9496641e2
BLAKE2b-256 bac83c627ea0dc45b9c6f1168f78cf5ea205a47d20cd2a3cb761140f9ad6cfa7

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 466348c168a43f185fd2d08df36de3e18b0055c8c3acf718c3bdb191759cc4b8
MD5 a46387e90b6be79f04db23d0602152b0
BLAKE2b-256 946c0b784bc8c5d5933ecd817703bdee9f8080efe9c6a000d07823a60fae182e

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 65403332e0dd536381f435167f201463cb0f3b2507d9694f580a5c9be0e0a8ed
MD5 4ae2d420dfd2cbd8eb68a52c1ef2b547
BLAKE2b-256 b59318c4e9479f36fd6050dc2bc539930da3a4012323dfc5c0cd8c2758184913

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyuvdata-3.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 47.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyuvdata-3.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b6ffc9aa008c2291c2f4897a372808c909ba63d80f129293b330f560200144d1
MD5 6a2ec6854cbf747af9423f8ba4c9616d
BLAKE2b-256 e64ed99aee34b37f47b71ae9f07962b501e7ebfd73c42fb1059e6ce61a032bb6

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c964b5434b1889bff744e98be9067cde55c78b07faca74b45a714c9c2ab2659a
MD5 ff4802aa4303d4f316f795850ad30e6b
BLAKE2b-256 07962f26c32083960117be735891da303023801fd680b4173c337c3b6f982722

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e52cb8ec55f6f91931f4fc43f57497dc2b946bf51d170875b622c497e8f8cfa
MD5 a1d21c143d0cee5cef9ee88515d1c2e0
BLAKE2b-256 80e967314c4fc1a5b8f599c04c155e78ddfeee348d1ed811752af3e4fbd8b921

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4c9384003ecb820df0ec8f5f6005b73d50582b2dff8976c75477072ed8a99e97
MD5 45f863fae412a38972a42f3939ae3ee7
BLAKE2b-256 d64a0fc7cb22b607b90f3f9879385106dbe2c126f72c1439ddb27232aa539045

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyuvdata-3.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 47.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyuvdata-3.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f06bd870fd04f97e7147c7ce6bc46180e15bda68b4315999693d262bd8ddf3bf
MD5 123e1983a0ef341407ecc1d3207a099b
BLAKE2b-256 21bc9761e1e77901cd77638e6de4254d8cbe9d8d8465593a99aab2f16e8956aa

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d552348f53397b7c15dfc539c7a1557fae01ae4afd41da33c2475f3fb7d2fb1
MD5 5fe6567cf8f105a24008005883872ef7
BLAKE2b-256 8b70abfce6bef6f25c8a682890e452038f9e48d2cbd4210eb01dc52d4b22fbe6

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db4a47284868f6e3f9bdac7413d3674a8953a3c8761f06cc631934c4b5f454ab
MD5 2abdcc47266da18f603ee606d34e265c
BLAKE2b-256 cf14795e5dbb46338dfbc839942ad300a21f946bd8f26541d0f4cc7b5b1ba442

See more details on using hashes here.

File details

Details for the file pyuvdata-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyuvdata-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff2e55e2d2269ee07a6fa905a52a97b073f32148757627d74931302c8eee890b
MD5 fa336a36bab4e275dccd0b77f03a4729
BLAKE2b-256 bf25e1520ed49cec327ed1e44513f8d0bbe84a3aaeb5265008f27389c9e00af5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page