readNonStandardHeader

Return to directory of Todd's CASA extensions

If the spectral axis of a CASA image is missing, then imhead(mode='list') will bomb ( CAS-5901). This workaround function reads the major header items individually and builds a little dictionary, designed for use by getFitsBeam.

Usage:

au.readNonStandardHeader(image)

Example:

CASA <39>: au.readNonStandardHeader('/lustre/naasc/thunter/alma/SD/holography/Band3/results/uid___A002_X67509f_X660_APC-DA42-H-LSB-beam_square')
2014-02-19 16:10:50     SEVERE          Exception Reported: This image has no beam(s).
2014-02-19 16:10:50     SEVERE  imhead::::casa  *** Error *** This image has no beam(s).
2014-02-19 16:10:50     SEVERE  imhead::::casa  An error occurred running task imhead.
  Out[39]:
{'beammajor': 0,
 'beamminor': 0,
 'beampa': 0,
 'cdelt1': 9.958328608743699,
 'cdelt2': 9.958328608743699,
 'crpix1': 512.0,
 'crpix2': 512.0,
 'ctype1': 'Longitude',
 'ctype2': 'Latitude',
 'cunit1': 'arcsec',
 'cunit2': 'arcsec',
 'shape': array([1024, 1024], dtype=int32)}

-- ToddHunter - 2014-02-19

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > ReadNonStandardHeader
Topic revision: 2014-02-19, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback