getFitsBeam
Return to directory of Todd's CASA extensions
Extract the beam and pixel scale information from a FITS image (or CASA image) from the BMAJ, BMIN, BPA header values. If these are not found in the FITS image, it then searches for them in the HISTORY records. For a CASA image, if 'beammaj' is not found, then it computes the median of the perplanebeams (if present). See also
numberOfChannelsInCube,
getFitsDate and
getIntensityForPixel.
Usage:
au.getFitsBeam(image, returnBunit=False, addHalfChannelWidth=False,
returnRestFreq=False, returnVelocityWidth=False)
Returns: bmaj, bmin, bpa, cdelt1, cdelt2, naxis1, naxis2, frequency (and optionally bunit)
- cdelt1 and cdelt2 are in arcseconds
- bpa in degrees
- frequency in GHz (for the reference pixel of either craxis3 or craxis4 in the case of CASA images)
- returnRestFreq: if True, then also return restfreq in Hz (if present); only works for CASA images
- returnVelocityWidth: if True, then also return the channel width in km/s
- returnRestFreq and returnVelocityWidth are mutually exclusive
Example:
CASA <2>: au.getFitsBeam('N6334-X.PBCOR.UV100')
0.5148'' x 0.204638'' at -0.79 deg
Pixel size = -0.050000 by 0.050000 (RA by DEC)
CRVAL3 = 8.4399e+09 Hz at CRPIX = 1
central freq = 8.46178e+09 Hz
Out[2]:
(0.51480000000000004,
0.2046384,
-0.7900000000000,
-0.050000000544,
0.050000000544,
4096,
4096
8.4617750000000)
--
ToddHunter - 2013-07-27