imviewField

Return to directory of Todd's CASA extensions

Plots a square portion of a CASA image using imview (so you don't have to figure out the blc and trc parameters in world coordinates). Generates a png file. See also imviewFields.

Usage:

imviewField(img, radius=0, minIntensity=None, maxIntensity=None, maxIntensityFraction=None,
                xcenter=None, ycenter=None, colorwedge=True, plotfile=None,
                frequency=None, trim=True, colormap='Rainbow 2', scaling=0, verbose=False,
                contourImage=None, levels=None, unit=1.0):
  • radius: radius of the square, in arcseconds; if <=0, use the whole image
  • minIntensity: the minimum intensity to display
  • maxIntensity: the maximum intensity to display (if None, use maxIntensityFraction)
  • maxIntensityFraction: the fraction of the image maximum to display (if None, use max)
  • xcenter, ycenter: central pixel
  • colorwedge: Boolean to control the display of a colorwedge
  • plotfile: the name of the png file to produce
  • frequency: scale the requested radius by the ratio of this frequency (given in Hz or GHz) to the frequency in the image header
  • trim: if True, run ImageMagick's "convert -trim" to remove blank borders
  • colormap: see the Viewer wrench tool: e.g. 'Greyscale 1', 'Hot Metal 1'
  • scaling: does not yet work due to CAS-6081
  • contourImage: overlay another image with contours (relative values)
  • levels: numeric vector, e.g. [3,4,5]
  • unit: of contours, i.e. sets the value of "one" in the relative levels

Returns:
  • the name of the png file produced

Example:

CASA <2>: au.imviewField('/lustre/naasc/thunter/alma/SD/holography/Band3/results/uid___A002_X67509f_X660_APC-DA42-H-LSB-beam_square',180)
2014-02-19 16:24:24     SEVERE          Exception Reported: RecordInterface: field restfreq is unknown
2014-02-19 16:24:24     SEVERE  imhead::::casa  *** Error *** RecordInterface: field restfreq is unknown
2014-02-19 16:24:24     SEVERE  imhead::::casa  An error occurred running task imhead.
2014-02-19 16:24:24     SEVERE          Exception Reported: This image has no beam(s).
2014-02-19 16:24:24     SEVERE  imhead::::casa  *** Error *** This image has no beam(s).
2014-02-19 16:24:24     SEVERE  imhead::::casa  An error occurred running task imhead.
Reading non-standard header:  {'crpix1': 512.0, 'crpix2': 512.0, 'cdelt1': 9.958328608743699, 'beampa': 0, 'beammajor': 0, 'shape': array([1024, 1024], dtype=int32), 'cunit1': 'arcsec', 'ctype2': 'Latitude', 'ctype1': 'Longitude', 'cunit2': 'arcsec', 'beamminor': 0, 'cdelt2': 9.958328608743699}
  Out[2]: '/lustre/naasc/thunter/alma/SD/holography/Band3/results/uid___A002_X67509f_X660_APC-DA42-H-LSB-beam_square.imview.png'

-- ToddHunter - 2014-02-19
Topic revision: r7 - 2016-02-03, 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