pyuvsim

pyuvsim: A comprehensive simulation package for radio interferometers in python. - Published in JOSS (2019)

https://github.com/radioastronomysoftwaregroup/pyuvsim

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    9 of 17 committers (52.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords from Contributors

astronomy interferometry radio-astronomy

Scientific Fields

Engineering Computer Science - 33% confidence
Last synced: 6 months ago · JSON representation

Repository

A ultra-high precision package for simulating radio interferometers in python on compute clusters.

Basic Info
Statistics
  • Stars: 45
  • Watchers: 22
  • Forks: 10
  • Open Issues: 40
  • Releases: 14
Created over 8 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

pyuvsim

codecov DOI

pyuvsim is a comprehensive simulation package for radio interferometers in python.

A number of analysis tools are available to simulate the output of a radio interferometer (CASA, OSKAR, FHD, PRISim, et al), however each makes numerical approximations to enable speed ups. pyuvsim's goal is to provide a simulated instrument output which emphasizes accuracy and extensibility, and can represent the most general simulator design.

A comparison to other simulators may be found here.

pyuvsim, the Interferometer Simulator of Record

pyuvsim's primary goal is to be an interferometer simulator accurate at the level of precision necessary for 21cm cosmology science,

  1. High level of test coverage including accuracy (design goal is 97%).
  2. Testing against analytic calculations, monitored by continuous integration (see memo #XXX)
  3. Comparison with external simulations with standardized reference simulations

Usability and extensibility

A secondary goal is a community simulation environment which provides well documented and flexible code to support a diversity of use cases. Key elements of this approach include: 1. Design for scalability across many cpus. 2. Defining a clear, user-friendly standard for simulation design. 3. Documentation of analytic validation and reference simulations

Physical Instrumental Effects

Each addition of new physics is validated against analytic calculations and included in a new reference simulation. Physics that have been included or are on the roadmap. 1. Fully-polarized instrument response (complete) 1. Polarized sources (analytic testing ~90% ) 1. Floating-point source position accuracy (complete) 1. Full-sky field of view (complete) 1. Exact antenna positions. (complete) 1. Varied beam models across the array (complete, tested against analytic) 1. Diffuse emission (complete, tested against analytic, paper in prep) 1. Arbitrary spectrum (complete) 1. Non-terrestrial observatories (Lunar observatory complete) 1. Time domain sources (TODO) 1. Ionospheric scintillation (TODO)

Citation

Please cite pyuvsim by citing our JOSS paper:

Lanman et al., (2019). pyuvsim: A comprehensive simulation package for radio interferometers in python. Journal of Open Source Software, 4(37), 1234, https://doi.org/10.21105/joss.01234

ADS Link

Installation

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

A user-installation is achieved simply with pip install pyuvsim, or to get the bleeding-edge: pip install https://github.com/RadioAstronomySoftwareGroup/pyuvsim.

By default, mpi capabilities are not enabled -- many of the utilities provided in pyuvsim do not require it. To use the simulator within pyuvsim, you should install pyuvsim with pip install pyuvsim[sim]. Note that the pyuvsim simulator is intended to run on clusters running the linux operating system, but we test against Mac OSX and MS Windows as well. We test against both Open MPI and MPICH on Linux/MacOS and MS-MPI on Windows. However, note that casacore and lunarsky functionalities are not supported on Windows.

There are a few more optional dependencies for pyuvsim which enable some features, such as astropy_healpix to use healpix based sky catalogs or healpix beams, python-casacore for writing out measurement sets and lunarsky for simulating telescopes on the moon. If you would like these tools as well as the full simulator, install pyuvsim with pip install pyuvsim[all] (or use the [healpix], [casa] or [moon] options to only get the dependencies for each of those functionalities).

If you are planning to develop pyuvsim on Windows, you can install all necessary dependencies with pyuvsim[windows-dev].

If you wish to manage dependencies manually read on.

Dependencies

If you are using conda to manage your environment, you may wish to install the following packages before installing pyuvsim:

Required:

  • astropy>=6.0
  • numpy>=1.23
  • psutil
  • pyradiosky>=1.1.0
  • python>=3.11
  • pyuvdata>=3.2.3
  • pyyaml>=5.4.1
  • scipy>=1.9
  • setuptools_scm>=8.1

Optional:

  • astropy-healpix>=1.0.2 (for using healpix based sky catalogs or beams)
  • mpi4py>=3.1.3 (for actually running simulations)
  • lunarsky>=0.2.5 (for simulating telescopes on the moon)
  • python-casacore>=3.5.2 (for writing CASA measurement sets, not available on Windows)
  • matplotlib>=3.6 (for plotting functions)

Developer Installation

If you are developing pyuvsim, you will need to download and install the repository using git clone https://github.com/RadioAstronomySoftwareGroup/pyuvsim.git.

Navigate into the pyuvsim directory and run pip install . or pip install -e . for a developer install (which makes it so that you don't have to reinstall every time you change the code) 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 (as well as the developer dependencies listed below).

To install without dependencies, run pip install --no-deps . (optionally with the -e flag as well).

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

  • coverage
  • line-profiler
  • pooch >= 1.8
  • pre-commit
  • pytest
  • pytest-cov >= 5.0
  • pypandoc
  • sphinx

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.

Two additional packages, pytest-benchmark and requests, are required if you need to locally run single core regression testing of the reference simulations. For more realistic benchmarking at any level of scale, and for instruction on regression testing with pytest, see Benchmarking.

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 .[dev]) to install the packages needed for testing (including coverage and linting) and documentation development; dev includes everything in test and doc. If you are developing on Windows, use the [windows-dev] extra instead of plain [dev].

Finally, install the pre-commit hook using pre-commit install to help prevent committing code that does not meet our style guidelines.

Inputs

A simulation requires sets of times, frequencies, source positions and brightnesses, antenna positions, and direction-dependent primary beam responses. pyuvsim specifies times, frequencies, and array configuration via a UVData object (from the pyuvdata package), source positions and brightnesses via Source objects, and primary beams either through UVBeam or AnalyticBeam objects.

  • All sources are treated as point sources, with flux specified in Stokes parameters and position in right ascension / declination in the International Celestial Reference Frame (equivalently, in J2000 epoch).
  • Primary beams are specified as full electric field components, and are interpolated in angle and frequency. This allows for an exact Jones matrix to be constructed for each desired source position.
  • Multiple beam models may be used throughout the array, allowing for more complex instrument responses to be modeled.

These input objects may be made from a data file or from a set of yaml configuration files. See Running a simulation.

Outputs

Data from a simulation run are written out to a file in any format accessible with pyuvdata. This includes:

  • uvfits
  • MIRIAD
  • uvh5

When read into a UVData object, the history string will contain information on the pyuvsim and pyuvdata versions used for that run (including the latest git hash, if available), and details on the catalog used.

Quick start guide

Example obsparam configuration files may be found in the reference_simulations directory.

  1. Install from github or pip.
  2. Run off of a parameter file with 4 MPI ranks: mpirun -n 4 python scripts/run_param_pyuvsim.py reference_simulations/first_generation/obsparam_ref_1.1.yaml

Documentation

Documentation on how to run simulations and developer API documentation is hosted on ReadTheDocs.

Testing

pyuvsim uses the pytest package for unit testing. If you've cloned the source into a directory pyuvsim/, you may verify it as follows:

  1. Install pytest from anaconda or pip.
  2. Run the pytest from pyuvsim/ pytest You can alternatively run python -m pytest pyuvsim or python setup.py test. You will need to have all dependencies installed.

Some tests are run in parallel using the mpi4py module. Those tests have a decorator pytest.mark.parallel(n) where n is an integer giving the number of parallel processes to run the test on. To temporarily disable parallel tests, run pytest with the option --nompi.

Where to find Support

Please feel free to submit new issues to the issue log to request new features, document new bugs, or ask questions.

How to contribute

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

Versioning Approach

We use a generation.major.minor format.

  • Generation - Release combining multiple new physical effects and or major computational improvements. Testing: Backed by unittests, internal model validation, and significant external comparison.
  • Major - Adds new physical effect or major computational improvement. Small number of improvements with each release. Testing: Backed by unittests, internal model validation and limited external comparison.
  • Minor - Bug fixes and small improvements not expected to change physical model and which do not include breaking API changes. Testing: Backed by unittests

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.

Some helpful definitions

  • Physical effects: things like polarization effects, noise, ionospheric modeling, or nonterrestrial observing positions.
  • Major computational improvement: Support for new catalog types (e.g, diffuse maps), new analysis tools, changes to parallelization scheme
  • Small improvements: Better documentation or example code, outer framework redesign.

Maintainers

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

  • Adam Beardsley (Arizona State University)
  • Bryna Hazelton (University of Washington)
  • Daniel Jacobs (Arizona State University)
  • Paul La Plante (University of California, Berkeley)
  • 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.

Owner

  • Name: Radio Astronomy Software Group
  • Login: RadioAstronomySoftwareGroup
  • Kind: organization
  • Email: rasgmanagers@gmail.com

Foundational software tools for radio astronomy

JOSS Publication

pyuvsim: A comprehensive simulation package for radio interferometers in python.
Published
May 15, 2019
Volume 4, Issue 37, Page 1234
Authors
Adam E. Lanman ORCID
Brown University, Physics Department, Radio Astronomy Software Group
Bryna J. Hazelton ORCID
University of Washington, eScience Institute, University of Washington, Physics Department, Radio Astronomy Software Group
Daniel C. Jacobs ORCID
Arizona State University, School of Earth and Space Exploration, Radio Astronomy Software Group
Matthew J. Kolopanis ORCID
Arizona State University, School of Earth and Space Exploration, Radio Astronomy Software Group
Jonathan C. Pober ORCID
Brown University, Physics Department, Radio Astronomy Software Group
James E. Aguirre ORCID
University of Pennsylvania, Physics Department, Radio Astronomy Software Group
Nithyanandan Thyagarajan ORCID
National Radio Astronomy Observatory, Radio Astronomy Software Group
Editor
Arfon Smith ORCID
Tags
radio astronomy simulation pyuvdata

GitHub Events

Total
  • Create event: 63
  • Commit comment event: 42
  • Release event: 1
  • Issues event: 12
  • Watch event: 6
  • Delete event: 60
  • Issue comment event: 105
  • Push event: 303
  • Pull request review comment event: 54
  • Pull request review event: 124
  • Pull request event: 127
  • Fork event: 4
Last Year
  • Create event: 64
  • Commit comment event: 42
  • Release event: 1
  • Issues event: 12
  • Watch event: 6
  • Delete event: 60
  • Issue comment event: 105
  • Push event: 303
  • Pull request review comment event: 54
  • Pull request review event: 124
  • Pull request event: 127
  • Fork event: 4

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,980
  • Total Committers: 17
  • Avg Commits per committer: 116.471
  • Development Distribution Score (DDS): 0.542
Past Year
  • Commits: 181
  • Committers: 7
  • Avg Commits per committer: 25.857
  • Development Distribution Score (DDS): 0.525
Top Committers
Name Email Commits
Adam Lanman a****n@b****u 907
Bryna Hazelton b****n@g****m 565
Matthew Kolopanis M****s@g****m 159
Steven Murray s****y@a****u 108
dseitova d****a@g****m 79
pre-commit-ci[bot] 6****] 65
Danny Jacobs d****s@a****u 37
EXTERNAL-Ewall-Wice a****e@j****v 9
Jonathan Pober j****r@g****m 9
Adam Beardsley a****y@g****m 8
Anze Slosar a****e@b****v 8
Nicholas Kern n****n@b****u 6
Willow Smith w****h@b****u 5
Mitchell Burdorf b****l@g****m 5
Nithyanandan Thyagarajan n****t@g****m 4
Daniya Seitova d****a@d****u 3
Garrett 'Karto' Keating g****g@c****u 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 90
  • Total pull requests: 281
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 16 days
  • Total issue authors: 19
  • Total pull request authors: 10
  • Average comments per issue: 2.41
  • Average comments per pull request: 1.82
  • Merged pull requests: 231
  • Bot issues: 0
  • Bot pull requests: 108
Past Year
  • Issues: 13
  • Pull requests: 146
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 8 days
  • Issue authors: 8
  • Pull request authors: 6
  • Average comments per issue: 2.62
  • Average comments per pull request: 1.14
  • Merged pull requests: 108
  • Bot issues: 0
  • Bot pull requests: 79
Top Authors
Issue Authors
  • jpober (20)
  • bhazelton (17)
  • mkolopanis (15)
  • steven-murray (9)
  • piyanatk (4)
  • aelanman (4)
  • rlbyrne (3)
  • Joshuaalbert (3)
  • nmahesh1412 (2)
  • burdorfmitchell (2)
  • JianrongTan (2)
  • kbharatgehlot (2)
  • dseitova (1)
  • dannyjacobs (1)
  • kartographer (1)
Pull Request Authors
  • bhazelton (120)
  • pre-commit-ci[bot] (108)
  • mkolopanis (18)
  • burdorfmitchell (14)
  • steven-murray (10)
  • kartographer (4)
  • slosar (2)
  • aelanman (2)
  • telegraphic (2)
  • wps2n (1)
Top Labels
Issue Labels
enhancement (18) technical debt (16) bug (14) docs (14) needs research (10) Validation (7) question (6) speedup (4) good first issue (3) test (2) continuous integration (2) packaging (1) wontfix (1)
Pull Request Labels
continuous integration (116) bug (46) technical debt (33) enhancement (32) packaging (24) docs (13) development (3) test (3)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,044 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 2
  • Total versions: 16
  • Total maintainers: 1
pypi.org: pyuvsim

Python objects and interfaces for representing diffuse, extended and compact astrophysical radio sources

  • Versions: 16
  • Dependent Packages: 3
  • Dependent Repositories: 2
  • Downloads: 1,044 Last month
Rankings
Dependent packages count: 3.1%
Downloads: 7.8%
Average: 9.8%
Stargazers count: 11.0%
Dependent repos count: 11.6%
Forks count: 15.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • sphinx >=1.3
  • sphinx_rtd_theme ==0.5.2
.github/workflows/externaltests.yaml actions
  • actions/checkout master composite
  • conda-incubator/setup-miniconda v2.0.0 composite
.github/workflows/publish-to-test-pypi.yaml actions
  • actions/checkout master composite
  • conda-incubator/setup-miniconda v2.0.0 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/testsuite.yaml actions
  • actions/checkout master composite
  • codecov/codecov-action v2.0.2 composite
  • conda-incubator/setup-miniconda v2.0.0 composite
pyproject.toml pypi
setup.py pypi
environment.yml pypi
  • lunarsky >=0.2.1
  • pyradiosky >=0.2