Projection

class spectral_cube.lower_dimensional_structures.Projection(value, unit=None, dtype=None, copy=True, wcs=None, meta=None, mask=None, header=None, beam=None, fill_value=nan, read_beam=False, wcs_tolerance=0.0)[source]

Bases: spectral_cube.lower_dimensional_structures.LowerDimensionalObject, spectral_cube.base_class.SpatialCoordMixinClass, spectral_cube.base_class.MaskableArrayMixinClass, spectral_cube.base_class.BeamMixinClass

Methods Summary

convolve_to(beam[, convolve])

Convolve the image to a specified beam.

from_hdu(hdu)

Return a projection from a FITS HDU.

quicklook([filename, use_aplpy, aplpy_kwargs])

Use APLpy to make a quick-look image of the projection.

reproject(header[, order])

Reproject the image into a new header.

subimage([xlo, xhi, ylo, yhi])

Extract a region spatially.

to(unit[, equivalencies, freq])

Return a new Projection of the same class with the specified unit.

with_beam(beam[, raise_error_jybm])

Attach a new beam object to the Projection.

with_fill_value(fill_value)

Create a new Projection or Slice with a different fill_value.

Methods Documentation

convolve_to(beam, convolve=<function convolve_fft>, **kwargs)[source]

Convolve the image to a specified beam.

Parameters
beamradio_beam.Beam

The beam to convolve to

convolvefunction

The astropy convolution function to use, either astropy.convolution.convolve or astropy.convolution.convolve_fft

Returns
projProjection

A Projection convolved to the given beam object.

static from_hdu(hdu)[source]

Return a projection from a FITS HDU.

quicklook(filename=None, use_aplpy=True, aplpy_kwargs={})[source]

Use APLpy to make a quick-look image of the projection. This will make the FITSFigure attribute available.

If there are unmatched celestial axes, this will instead show an image without axis labels.

Parameters
filenamestr or Non

Optional - the filename to save the quicklook to.

reproject(header, order='bilinear')[source]

Reproject the image into a new header.

Parameters
headerastropy.io.fits.Header

A header specifying a cube in valid WCS

orderint or str, optional

The order of the interpolation (if mode is set to 'interpolation'). This can be either one of the following strings:

  • ‘nearest-neighbor’

  • ‘bilinear’

  • ‘biquadratic’

  • ‘bicubic’

or an integer. A value of 0 indicates nearest neighbor interpolation.

subimage(xlo='min', xhi='max', ylo='min', yhi='max')[source]

Extract a region spatially.

When spatial WCS dimensions are given as an Quantity, the spatial coordinates of the ‘lo’ and ‘hi’ corners are solved together. This minimizes WCS variations due to the sky curvature when slicing from a large (>1 deg) image.

Parameters
[xy]lo/[xy]hiint or astropy.units.Quantity or min/max

The endpoints to extract. If given as a quantity, will be interpreted as World coordinates. If given as a string or int, will be interpreted as pixel coordinates.

to(unit, equivalencies=[], freq=None)[source]

Return a new Projection of the same class with the specified unit.

See astropy.units.Quantity.to for further details.

with_beam(beam, raise_error_jybm=True)[source]

Attach a new beam object to the Projection.

Parameters
beamBeam

A new beam object.

with_fill_value(fill_value)[source]

Create a new Projection or Slice with a different fill_value.