CubeMosaic

class mpdaf.obj.CubeMosaic(files, output_wcs)[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 a cube inside the combined cube.

This class inherits from mpdaf.obj.CubeList.

Parameters:

files : list of str

List of cubes fits filenames

Attributes

files (list of str) List of cubes fits filenames
nfiles (integer) Number of files.
shape (array of 3 integers)) Lengths of data in Z and Y and X (python notation (nz,ny,nx)).
wcs (mpdaf.obj.WCS) World coordinates.
wave (mpdaf.obj.WaveCoord) Wavelength coordinates
unit (str) Possible data unit type. None by default.

Create a CubeMosaic object.

Parameters:

files : list of str

List of cubes fits filenames.

output_wcs : str

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 Summary

checkers

Methods Summary

check_compatibility() Checks if all cubes are compatible.
check_dim() Checks if all cubes have same dimensions.
check_wcs() Checks if all cubes use the same projection.
combine([nmax, nclip, nstop, var, mad, header]) combines cubes in a single data cube using sigma clipped mean.
info([verbose])
median([header]) Combines cubes in a single data cube using median.
pycombine([nmax, nclip, var, nstop, nl, header])
pymedian([header])
save_combined_cube(data[, var, method, ...])

Attributes Documentation

checkers = ('check_dim', 'check_wcs')

Methods Documentation

check_compatibility()

Checks if all cubes are compatible.

check_dim()[source]

Checks if all cubes have same dimensions.

check_wcs()[source]

Checks if all cubes use the same projection.

combine(nmax=2, nclip=5.0, nstop=2, var='propagate', mad=False, header=None)

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

Parameters:

nmax : integer

maximum number of clipping iterations

nclip : float or (float,float)

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

nstop : integer

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

var : str

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.

mad : boolean

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

Returns:

out : Cube, mpdaf.obj.Cube, astropy.table

cube, expmap, statpix

  • cube will contain the merged cube
  • expmap will contain an exposure map data cube which counts the number of exposures used for the combination of each pixel.
  • statpix is a table that will give the number of Nan pixels and rejected pixels per exposures (columns are FILENAME, NPIX_NAN and NPIX_REJECTED)
info(verbose=False)[source]
median(header=None)

Combines cubes in a single data cube using median.

Returns:

out : Cube, mpdaf.obj.Cube, Table

cube, expmap, statpix

  • cube will contain the merged cube
  • expmap will contain an exposure map data cube which counts the number of exposures used for the combination of each pixel.
  • statpix is a table that will give the number of Nan pixels pixels per exposures (columns are FILENAME and NPIX_NAN)
pycombine(nmax=2, nclip=5.0, var='propagate', nstop=2, nl=None, header=None)[source]
pymedian(header=None)
save_combined_cube(data, var=None, method='', keywords=None, expnb=None, unit=None, header=None)