CubeMosaic

class mpdaf.obj.CubeMosaic(files, output_wcs, **kwargs)[source]

Bases: mpdaf.obj.CubeList

Manages a list of cubes and handles the combination to make a mosaic.

To run the combination, all the cubes must be on the same WCS grid. The values from the CRPIX keywords will be used as offsets to put each cube inside the combined cube. The shape and WCS grid of the output cube is determined using from a FITS file specified with the output_wcs argument (same principle as the MUSE pipeline).

This class inherits from mpdaf.obj.CubeList, but not all the combination commands are available: currently only CubeMosaic.pycombine is implemented.

Parameters
fileslist of str

List of cubes FITS filenames.

output_wcsstr

Path to a cube FITS file, this cube is used to define the output cube: shape, WCS and unit are needed, it must have the same WCS grid as the input cubes.

Attributes
fileslist of str

List of cubes FITS filenames.

nfilesint

Number of files.

shapearray of 3 integers

Lengths of data in Z and Y and X (python notation (nz,ny,nx)).

wcsmpdaf.obj.WCS

World coordinates.

wavempdaf.obj.WaveCoord

Wavelength coordinates

unitstr

Possible data unit type. None by default.

Attributes Summary

checkers

Methods Summary

check_compatibility(self)

Checks if all cubes are compatible.

check_dim(self)

Checks if all cubes have same dimensions.

check_wcs(self)

Checks if all cubes use the same projection.

combine(self)

This method is not implemented for CubeMosaic.

info(self[, verbose])

Print information.

median(self)

This method is not implemented for CubeMosaic.

pycombine(self[, nmax, nclip, var, nstop, …])

Combines cubes in a single data cube using sigma clipped mean.

pymedian(self)

This method is not implemented for CubeMosaic.

save_combined_cube(self, data[, var, …])

Attributes Documentation

checkers = ('check_dim', 'check_wcs')

Methods Documentation

check_compatibility(self)

Checks if all cubes are compatible.

check_dim(self)[source]

Checks if all cubes have same dimensions.

check_wcs(self)[source]

Checks if all cubes use the same projection.

combine(self)[source]

This method is not implemented for CubeMosaic.

info(self, verbose=False)[source]

Print information.

median(self)[source]

This method is not implemented for CubeMosaic.

pycombine(self, nmax=2, nclip=5.0, var='propagate', nstop=2, nl=None, header=None, mad=False)[source]

Combines cubes in a single data cube using sigma clipped mean.

This is less optimized but more flexible version, compared to CubeList.combine. It is useful mostly for CubeMosaic, where we need to shift the individual cubes into the output one.

Parameters
nmaxint

Maximum number of clipping iterations.

nclipfloat or tuple of float

Number of sigma at which to clip. Single clipping parameter or lower / upper clipping parameters.

nstopint

If the number of not rejected pixels is less than this number, the clipping iterations stop.

var{‘propagate’, ‘stat_mean’, ‘stat_one’}
  • propagate: the variance is the sum of the variances of the N individual exposures divided by N**2.

  • stat_mean: the variance of each combined pixel is computed as the variance derived from the comparison of the N individual exposures divided N-1.

  • stat_one: the variance of each combined pixel is computed as the variance derived from the comparison of the N individual exposures.

madbool

Use MAD (median absolute deviation) statistics for sigma-clipping.

Returns
cubeCube

The merged cube.

expmap: mpdaf.obj.Cube

Exposure map data cube which counts the number of exposures used for the combination of each pixel.

statpix: astropy.table.Table

Table that gives the number of NaN pixels and rejected pixels per exposures (columns are FILENAME, NPIX_NAN and NPIX_REJECTED).

rejmap: Cube

Cube which contains the number of rejected values for each pixel.

pymedian(self)[source]

This method is not implemented for CubeMosaic.

save_combined_cube(self, data, var=None, method='', keywords=None, expnb=None, unit=None, header=None)