Skip to main content

plotastrodata

Python package to make figures from radio astronomical data by astropy and matplotlib. The API, examples, and gallery are available in readthedocs. The PDF manual is available here.

Highlights

  • Read, write, and process astronomical FITS images, spectral cubes, position-velocity diagrams, and NumPy arrays, including WCS coordinates, spectral axes, beam information, and brightness-temperature conversion.
  • Create 2D maps, channel maps, position-velocity diagrams, RGB composites, line profiles, spatial slices, and interactive 3D isosurface visualizations.
  • Overlay color, contour, polarization-vector, and RGB data from different spatial grids, with astronomical coordinates, beams, scale bars, regions, markers, and other annotations.
  • Prepare data through trimming, interpolation, binning, masking, centering, rotation, deprojection, beam circularization, and profile extraction.
  • Estimate image noise, including support for primary-beam-corrected data.
  • Fit Gaussian models to line profiles and two-dimensional image components.
  • Use supporting tools for coordinate and line-of-sight transformations, centered Fourier transforms and visibility sampling, and Bayesian or grid-based parameter estimation.

Installation

Install from conda-forge:

conda install conda-forge::plotastrodata

or from PyPI:

pip install plotastrodata

To install the latest source from GitHub:

git clone https://github.com/yusukeaso-astron/plotastrodata
cd plotastrodata
python -m pip install .

To update a source installation, run the following commands in the cloned repository:

git pull
python -m pip install --upgrade .

Demo and Usage

The repository includes example.py, which demonstrates the main plotting and analysis features. After cloning the repository and installing the package, run:

python example.py

More examples and the complete API reference are available in the online documentation.

Requirement

  • Python >= 3.11
  • astropy >= 7.2
  • corner (only for fitting)
  • dynesty (only for fitting)
  • emcee >= 3.1.5 (only for fitting)
  • ffmpeg (only for movie)
  • matplotlib
  • numpy >= 2.0
  • pillow (only for RGB figures)
  • plotly (only for html cube)
  • ptemcee (only for fitting)
  • pydantic >= 2
  • scikit-image (only for html cube)
  • scipy
  • tqdm (only for fitting)

Conventions and Limitations

  • Array axes are ordered as (y, x) for a 2D image, (v, y, x) for a spectral cube, and (v, x) for a position-velocity diagram. With NumPy-array input, supply matching one-dimensional coordinate arrays; a spectral cube requires v to construct channel maps. FITS input obtains these coordinates from its header.
  • Spatial coordinates are offsets from center. They are expressed in arcseconds when dist=1. When dist is set to the source distance in parsecs, spatial offsets and beam sizes are expressed in au.
  • By default, the R.A. axis increases toward the left (xflip=True), following the usual astronomical image convention. Use xflip=False to reverse this behavior.
  • Velocity coordinates and vsys are in km/s, while restfreq is in Hz. A frequency axis read from FITS is converted to velocity relative to vsys.
  • Sky positions may be given as coordinate strings, such as 'ICRS 01h23m45.6s 01d23m45.6s'. Numeric positions supplied through poslist, such as [0.2, 0.3], are relative plotting positions: 0 is the left or bottom edge and 1 is the right or top edge. They are not spatial offsets.
  • Angles are in degrees unless an API explicitly states otherwise. Sky position angles are measured from north toward east. The polar-coordinate arrays theta and phi used by the line-of-sight utilities are in radians.
  • A beam is represented by [bmaj, bmin, bpa], where the first two values use the current spatial unit and bpa is in degrees. Tb=True converts data from Jy/beam to brightness temperature and requires a valid rest frequency and spatial-resolution metadata.
  • sigma may be a numeric RMS value, a string selecting a noise-estimation method, or None to disable noise-dependent behavior. See the API documentation for the available estimation methods.
  • Annotation methods accept a single value or a list of values. include_chan selects displayed channels by zero-based index; None applies the annotation to all channels.
  • Position-velocity mode (pv=True) does not support regions, lines, arrows, or segment maps because its spatial and velocity axes use different units. Markers and text may still be placed using relative plotting positions.
  • Constants in const_utils are plain numerical values in SI units, not astropy.units.Quantity objects.

Author

  • Name: Yusuke Aso
  • Affiliation: Korea Astronomy and Space Science Institute
  • E-mail: yaso@kasi.re.kr

License

"plotastrodata" is under GNU General Public License Version 3.

Metadata

Release files for plotastrodata 1.10.2

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

Source distribution (sdist)

Source distribution for plotastrodata 1.10.2
File Size Uploaded
plotastrodata-1.10.2.tar.gz 74.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plotastrodata 1.10.2
File Interpreter ABI Platform
plotastrodata-1.10.2-py3-none-any.whl Python 3 none any Details

Total release size: 152.0 kB

Release files / plotastrodata-1.10.2.tar.gz

Download URL plotastrodata-1.10.2.tar.gz
Size 74.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1c04147b56f7463e41eeadd9e3b04e0b34a76e4d68bad2c825c6c9a576227ef0
BLAKE2b-256 checksum
How to use checksums
9d884a19d876b0128b21e2d040a9cf5289c988bae0db9659d8e9543429ff7e6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / plotastrodata-1.10.2-py3-none-any.whl

Download URL plotastrodata-1.10.2-py3-none-any.whl
Size 77.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ed57bdeae7e17176756561fa0bba5e32946fe85d6639987eaec0eb2c57ba3ee
BLAKE2b-256 checksum
How to use checksums
7bedc5c3e09fdd3264db395e8726c4d1dc0aadcf7a5415b2fcf14c514da4e5ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

1.10.3

2 release files

This release

1.10.2 This release

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.21

2 release files

1.9.20

2 release files

1.9.19

2 release files

1.9.18

2 release files

1.9.17

2 release files

1.9.16

2 release files

1.9.13

2 release files

1.9.12

2 release files

1.9.10

2 release files

1.9.9

2 release files

1.9.8

2 release files

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.18

2 release files

1.8.17

2 release files

1.8.16

2 release files

1.8.15

2 release files

1.8.14

2 release files

1.8.13

2 release files

1.8.12

2 release files

1.8.11

2 release files

1.8.10

2 release files

1.8.9

2 release files

1.8.8

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.14

2 release files

1.7.13

2 release files

1.7.12

2 release files

1.7.11

2 release files

1.7.10

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.16

2 release files

1.4.15

2 release files

1.4.14

2 release files

1.4.10

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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