1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
Spectral Cube documentation
===========================
The spectral-cube package provides an easy way to read, manipulate, analyze,
and write data cubes with two positional dimensions and one spectral dimension,
optionally with Stokes parameters. It provides the following main features:
- A uniform interface to spectral cubes, robust to the
wide range of conventions of axis order, spatial projections,
and spectral units that exist in the wild.
- Easy extraction of cube sub-regions using physical coordinates.
- Ability to easily create, combine, and apply masks to datasets.
- Basic summary statistic methods like moments and array aggregates.
- Designed to work with datasets too large to load into memory.
Quick start
-----------
Here's a simple script demonstrating the spectral-cube package::
>>> import astropy.units as u
>>> from astropy.utils import data
>>> from spectral_cube import SpectralCube
>>> fn = data.get_pkg_data_filename('tests/data/example_cube.fits', 'spectral_cube')
>>> cube = SpectralCube.read(fn)
>>> print(cube)
SpectralCube with shape=(7, 4, 3) and unit=Jy / beam:
n_x: 3 type_x: RA---ARC unit_x: deg range: 52.231466 deg: 52.231544 deg
n_y: 4 type_y: DEC--ARC unit_y: deg range: 31.243639 deg: 31.243739 deg
n_s: 7 type_s: VRAD unit_s: m / s range: 14322.821 m / s: 14944.909 m / s
# extract the subcube between 98 and 100 GHz
>>> slab = cube.spectral_slab(98 * u.GHz, 100 * u.GHz) # doctest: +SKIP
# Ignore elements fainter than 1 Jy/beam
>>> masked_slab = slab.with_mask(slab > 1 Jy/beam) # doctest: +SKIP
# Compute the first moment and write to file
>>> m1 = masked_slab.moment(order=1) # doctest: +SKIP
>>> m1.write('moment_1.fits') # doctest: +SKIP
Using spectral-cube
-------------------
The package centers around the
:class:`~spectral_cube.SpectralCube` class. In the following
sections, we look at how to read data into this class, manipulate spectral
cubes, extract moment maps or subsets of spectral cubes, and write spectral
cubes to files.
Getting started
^^^^^^^^^^^^^^^
.. toctree::
:maxdepth: 1
installing.rst
creating_reading.rst
accessing.rst
masking.rst
arithmetic.rst
manipulating.rst
metadata.rst
smoothing.rst
writing.rst
moments.rst
errors.rst
quick_looks.rst
beam_handling.rst
spectral_extraction.rst
continuum_subtraction.rst
examples.rst
visualization.rst
dask.rst
There is also an `astropy tutorial
<http://learn.astropy.org/rst-tutorials/FITS-cubes.html>`__ on accessing and
manipulating FITS cubes with spectral-cube.
Advanced
^^^^^^^^
.. toctree::
:maxdepth: 1
yt_example.rst
big_data.rst
api.rst
|