Interface for spectra, images and cubes (mpdaf.obj)

The mpdaf.obj package provides a way to load a MUSE cube created by the MUSE pipeline (i.e. a 3GB FITS data cube of approximately 300x300x3680 pixels) into a Python object that manages spatial world-coordinates, wavelength world coordinates, pixel variances and bad pixel information.

It is then relatively easy to extract smaller cubes, narrow-band images or spectra from the cube. The world coordinates, associated variances and bad-pixel masks are propagated into these extracted cubes, images, and spectra. Many useful operations like masking, interpolation, re-sampling, smoothing and profile fitting are also provided.

Contents:

Reference/API

mpdaf.obj Package

Copyright (c) 2010-2016 CNRS / Centre de Recherche Astrophysique de Lyon Copyright (c) 2012-2015 Laure Piqueras <laure.piqueras@univ-lyon1.fr> Copyright (c) 2014-2016 Simon Conseil <simon.conseil@univ-lyon1.fr>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Functions

UnitArray(array, old_unit, new_unit)
UnitMaskedArray(mask_array, old_unit, new_unit)
axis_increments_from_cd(cd) Return the angular increments of pixels along the Y and X axes of an image array whose coordinates are described by a specified FITS CD matrix.
bounding_box(form, center, radii, shape[, ...]) Return Y-axis and X-axis slice objects that bound a rectangular image region that just encloses either an ellipse or a rectangle, where the rectangle has a specified center position, Y-axis and X-axis radii, and a given rotation angle relative to the image axes.
deg2dms(x) Transform degrees to degrees:arcminutes:arcseconds strings.
deg2hms(x) Transform degrees to hours:minutes:seconds strings.
deg2sexa(x) Transform equatorial coordinates from degrees to sexagesimal strings.
dms2deg(x) Transform degrees:arcminutes:arcseconds strings to degrees.
flux2mag(flux, wave) Convert flux from erg.s-1.cm-2.A-1 to AB mag.
gauss_image([shape, wcs, factor, gauss, ...]) Create a new image from a 2D gaussian.
hms2deg(x) Transform hours:minutes:seconds strings to degrees.
image_angle_from_cd(cd[, unit]) Return the rotation angle of the image.
is_float(x) Test if x is a float number.
is_int(x) Test if x is an int number.
is_number(x) Test if x is a number.
iter_ima(cube[, index]) An iterator over the images of successive spectral pixels in a Cube
iter_spe(cube[, index]) An iterator over the spectra of successive image pixels in a Cube
mag2flux(mag, wave) Convert flux from AB mag to erg.s-1.cm-2.A-1
moffat_image([shape, wcs, factor, moffat, ...]) Create a new image from a 2D Moffat function.
sexa2deg(x) Transform equatorial coordinates from sexagesimal strings to degrees.

Classes

Cube([filename, hdulist, data, mask, var, ...]) This class manages Cube objects, which contain images at multiple wavelengths.
CubeList(files[, scalelist]) Manages a list of cubes and handles the combination.
CubeMosaic(files, output_wcs) Manages a list of cubes and handles the combination to make a mosaic.
DataArray([filename, hdulist, data, mask, ...]) Parent class for Cube, Image and Spectrum.
Gauss1D(lpeak, peak, flux, fwhm, cont, ...) This class stores 1D Gaussian parameters.
Gauss2D(center, flux, fwhm, cont, rot, peak, ...) This class stores 2D gaussian parameters.
Image([filename, ext, wcs, data, var, unit, ...]) Manage image, optionally including a variance and a bad pixel mask.
Moffat2D(center, flux, fwhm, cont, n, rot, ...) This class stores 2D moffat parameters.
SpatialFrequencyLimits(fmax, rot) Allow to keep track of the spatial frequency limits of an image.
Spectrum([filename, ext, unit, data, var, ...]) Spectrum objects contain 1D arrays of numbers, optionally accompanied by corresponding variances.
WCS([hdr, crpix, crval, cdelt, deg, rot, ...]) The WCS class manages the world coordinates of the spatial axes of MPDAF images, using the pywcs package.
WaveCoord([hdr, crpix, cdelt, crval, cunit, ...]) WaveCoord class manages world coordinates in spectral direction.

Class Inheritance Diagram

Inheritance diagram of mpdaf.obj.cube.Cube, mpdaf.obj.cubelist.CubeList, mpdaf.obj.cubelist.CubeMosaic, mpdaf.obj.data.DataArray, mpdaf.obj.spectrum.Gauss1D, mpdaf.obj.image.Gauss2D, mpdaf.obj.image.Image, mpdaf.obj.image.Moffat2D, mpdaf.obj.image.SpatialFrequencyLimits, mpdaf.obj.spectrum.Spectrum, mpdaf.obj.coords.WCS, mpdaf.obj.coords.WaveCoord