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

Functions

UnitArray(array, old_unit, new_unit)

UnitMaskedArray(mask_array, old_unit, new_unit)

airtovac(airwl)

Convert air wavelengths to vacuum wavelengths.

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.

cleanSignal(signal, noise, levels[, ...])

Filter an input signal by using the 1 standard deviation noise estimate and wavelets epsilon is the iteration-stop parameter for extracting signal from the residual signal.

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.

determine_refframe(phdr)

Determine the reference frame and equinox in standard FITS WCS terms.

dms2deg(x)

Transform degrees:arcminutes:arcseconds strings to degrees.

flux2mag(flux, err_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.

get_plot_norm(data[, vmin, vmax, zscale, scale])

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

mask_sources(image[, sigma, iterations, ...])

Create a mask of sources, using photutils.

moffat_image([shape, wcs, factor, moffat, ...])

Create a new image from a 2D Moffat function.

plot_rgb(images[, title, scale, vmin, vmax, ...])

Plot the RGB composite image with axes labeled in pixels.

sexa2deg(x)

Transform equatorial coordinates from sexagesimal strings to degrees.

vactoair(vacwl)

Calculate the approximate wavelength in air for vacuum wavelengths.

wavelet_backTransform(coefficients)

Transform from wavelet to real space.

wavelet_transform(signal, levels)

Transform a signal into wavelet space.

Classes

Cube([filename, hdulist, data, mask, var, ...])

This class manages Cube objects, which contain images at multiple wavelengths.

CubeList(files[, scalelist, offsetlist])

Manages a list of cubes and handles the combination.

CubeMosaic(files, output_wcs, **kwargs)

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.

FormatCoord(image, data)

Alter mouse-over coordinates displayed by plt.show()

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 one to keep track of the spatial frequency limits of an image.

Spectrum([filename, hdulist, data, mask, ...])

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

digraph inheritance3f3d79abb6 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ArithmeticMixin" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Cube" [URL="../api/mpdaf.obj.Cube.html#mpdaf.obj.Cube",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This class manages Cube objects, which contain images at multiple"]; "ArithmeticMixin" -> "Cube" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DataArray" -> "Cube" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CubeList" [URL="../api/mpdaf.obj.CubeList.html#mpdaf.obj.CubeList",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Manages a list of cubes and handles the combination."]; "CubeMosaic" [URL="../api/mpdaf.obj.CubeMosaic.html#mpdaf.obj.CubeMosaic",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Manages a list of cubes and handles the combination to make a mosaic."]; "CubeList" -> "CubeMosaic" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DataArray" [URL="../api/mpdaf.obj.DataArray.html#mpdaf.obj.DataArray",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Parent class for `~mpdaf.obj.Cube`, `~mpdaf.obj.Image` and"]; "FormatCoord" [URL="../api/mpdaf.obj.FormatCoord.html#mpdaf.obj.FormatCoord",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Alter mouse-over coordinates displayed by plt.show()"]; "Gauss1D" [URL="../api/mpdaf.obj.Gauss1D.html#mpdaf.obj.Gauss1D",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This class stores 1D Gaussian parameters."]; "Gauss2D" [URL="../api/mpdaf.obj.Gauss2D.html#mpdaf.obj.Gauss2D",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This class stores 2D gaussian parameters."]; "Image" [URL="../api/mpdaf.obj.Image.html#mpdaf.obj.Image",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Manage image, optionally including a variance and a bad pixel mask."]; "ArithmeticMixin" -> "Image" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DataArray" -> "Image" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Moffat2D" [URL="../api/mpdaf.obj.Moffat2D.html#mpdaf.obj.Moffat2D",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This class stores 2D moffat parameters."]; "SpatialFrequencyLimits" [URL="../api/mpdaf.obj.SpatialFrequencyLimits.html#mpdaf.obj.SpatialFrequencyLimits",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Allow one to keep track of the spatial frequency limits of an image."]; "Spectrum" [URL="../api/mpdaf.obj.Spectrum.html#mpdaf.obj.Spectrum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Spectrum objects contain 1D arrays of numbers, optionally"]; "ArithmeticMixin" -> "Spectrum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DataArray" -> "Spectrum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WCS" [URL="../api/mpdaf.obj.WCS.html#mpdaf.obj.WCS",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The WCS class manages the world coordinates of the spatial axes of"]; "WaveCoord" [URL="../api/mpdaf.obj.WaveCoord.html#mpdaf.obj.WaveCoord",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="WaveCoord class manages world coordinates in spectral direction."]; }