Usage of imfitparse

Return to directory of Todd's CASA extensions

This function accepts a dictionary result from imfit is passed in via the 'imfitdict' argument, and a string is returned containing the position of a component (default=0) in RA/Dec sexagesimal, followed by its flux, fitted size, and uncertainties. The units for size (Major and Minor axes) are typically arcsec, while the Position angle is typically in degrees. See also imfitparseCLB and imstatparse.

The returned string contains: RA Dec Flux Error SNR MajorAxis Error MinorAxis Error PositionAngle Error


au.imfitparse(imfitdict, raprec=5, decprec=5, fluxprec=4, sizeprec=4, 
              paprec=2, stokes=0, refpos='', separationprec=2, snrprec=2, 
              component=0, fluxunit='Jy', logfile=None, showpixels=False, 
              meanpixel=None, img=None, deconvolved=False, returnPeakPixel=False,
  • imfitdict: a dictionary returned by imfit
  • optional parameters:
    • raprec: one less than the number of digits after decimal point to show for the RA seconds
    • decprec, fluxprec, sizeprec, snrprec, paprec: the number of digits after the decimal point to show for the corresponding quantity
    • stokes: which Stokes parameter of the result to return (default = 0 = "I")
    • refpos: a sexagesimal string (e.g. HH:MM:SS.SSS +DD:MM:SS.SSSS).
      • If specified, also compute the separation from this position, and insert it after the fluxerr field.
      • The RA and Dec part of the string can be either comma or space separated.
      • The dec portion of the string can be either : or . delimited.
      • separationprec: the number of digits after the decimal point to show for the separation from the refpos
    • component: the component number of the imfitdict to parse
    • fluxunit: set to 'mJy' to multiply values by 1000
    • logfile: alternate logfile to use for showpixels and deconvolved options, (default=the current log file)
    • showpixels: if True, then put the pixel values as 2 final columns, as read from the current logfile. If not Boolean, then also normalize the pixel value by this number
    • meanpixel: if specified as [x,y], then remove x,y from fitted pixel value before normalizing by showpixels
    • img: if specified, and showpixels=True, then the peak pixel is returned using findRADec (rather than parsing the logfile)
    • deconvolved: if True, then the size will be the size deconvolved from the beam, rather than the (larger) fitted size.
  • ra, dec, flux, fluxerr, snr=(flux/fluxerr), majorarcsec, majorarcsecerr, minorarcsec, minorarcsecerr, posangle, posangleerr
  • if returnPeakPixel==True, then also return the peak xpixel and ypixel
  • if returnPositionUncertainties==True, then also return the RA and Dec uncertainties on the fitted peak (in arcsec)


CASA <2>: mydict = imfit('IN_VEX_1.3mmContin_all_ap.image.pbcor', region='box [[17:20:54.88433, -], [17:20:54.76994, -]] coord=J2000')
CASA <3>: au.imfitparse(mydict)
  Out[3]: '17:20:54.82967  -35:45:03.601045  0.0166 0.0031  0.7039 0.0751  0.5392 0.1310 +174.58  6.15'

-- ToddHunter - 2013-04-19
Topic revision: r12 - 2016-06-06, 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