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:
LowerDimensionalObject
,SpatialCoordMixinClass
,MaskableArrayMixinClass
,BeamMixinClass
Methods Summary
convolve_to
(beam[, convolve])Convolve the image to a specified beam.
from_hdu
(hdu[, ext])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
orSlice
with a differentfill_value
.Methods Documentation
- convolve_to(beam, convolve=<function convolve_fft>, **kwargs)[source]¶
Convolve the image to a specified beam.
- Parameters:
- beam
radio_beam.Beam
The beam to convolve to
- convolvefunction
The astropy convolution function to use, either
astropy.convolution.convolve
orastropy.convolution.convolve_fft
- beam
- Returns:
- proj
Projection
A Projection convolved to the given
beam
object.
- proj
- static from_hdu(hdu, ext=0)[source]¶
Return a projection from a FITS HDU.
- Parameters:
- extint
The integer index to load when given an
astropy.io.fits.HDUList
. Default is 0 (the first HDU in the list.
- 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:
- header
astropy.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.
- header
- 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
ormin
/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.
- [xy]lo/[xy]hiint or
- 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:
- beam
Beam
A new beam object.
- beam
- with_fill_value(fill_value)[source]¶
Create a new
Projection
orSlice
with a differentfill_value
.