Return to directory of Todd's CASA extensions

Directly estimate the actual FWHM of the CASA image provided, with no assumption about shape except that the function has a well defined peak and is approximately azimuthally symmetric. It finds the peak, subtracts half, then solves for the zero crossing, and doubles the result. For an alternative algorithm, see getfwhm. To operate on data arrays directly, see findFWHM.


au.getfwhm2(imgfile, pkXmin='min', pkXmax='max', pkYmin='min', pkYmax='max', pixelSize=None, 
            axis3channel=0, axis4channel=0, plotfile=None, ignoreIdenticalZeros=True, 
            maxRadius=-1, plotrange=[0, 0, 0, 0], s=0 gaussian=None, showlog=False,
            plotrange2=[0,0,0,0], centroid=False, threshold=0)
Required parameters:
  • imgfile - a CASA image
  • pk{X,Y}{min,max} - pixel coordinate range (integers) within which to search for peak and FWHM. So long as this region contains the peak and the half max point you should get reasonable results. (default is to consider all pixels)
  • pixelSize - if None, use value from image header (supports deg or rad units)
  • axis3channel - which channel of the cube to use (if naxis>2)
  • axis4channel - which channel of the cube to use (if naxis>3)
  • plotfile - if True, or a string, then write a png file
  • maxRadius - set this to limit the area searched for the half-power, which is useful for large images of a small source
  • plotrange: set the x and y axis ranges of the plot
  • s: the positive smoothing factor to pass to scipy.interpolate.UnivariateSpline
  • gaussian - the FWHM of a Gaussian profile to overlay on the plot
  • showlog - show the log of the pixel values in a second panel
  • plotrange2 - [xmin, xmax, ymin, ymax] for the log plot
  • centroid - if True, call imageCentroid to find the (fractional) pixel
  • threshold - value (in % of peak) below which to ignore in imageCentroid


CASA <5>: au.getfwhm2('uid___A002_X65c1ab_Xd8d_APC-DV18-V-USB-beam_square',maxRadius=60,plotfile='getfwhm2.png')
Got pixelSize = 2.484117 arcsec
 Max found at pixel  512.0   512.0
Averaging the values at the same radius.
Finding FWHM
  Out[5]: 17.966082459243811

  • getfwhm2.png:

-- ToddHunter - 2013-12-18
Topic revision: r3 - 2014-03-20, 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