ispec

Return to directory of Todd's tools

Emulates AIPS' ISPEC function to produce an ASCII spectrum from a CASA image, using the region tool (rg) and the image tool (ia). Operates on a single pixel and a single polarization only. See also ispecOverlay.

Usage:

tt.ispec(image, outfile=None, region='', sep=' ', format='%e', 
        overwrite=True, blc=None, trc=None, pol=0, showplot=False, 
        source=None, velocity=False, startchan=None, 
        endchan=None, plotfile=None, plotrange=[0,0,0,0])
  • outfile: the name of the ASCII file to produce
  • source: append this source name to the filename
  • region: the region to use (alternative to blc,trc)
  • sep: the character string to use to separate columns in the output file
  • blc, trc: the pixel range to use as a list (e.g. [40,50]). Currently blc must equal trc. If trc is not specified, it is assumed to equal blc. If blc not specified, then find and use the peak.
  • velocity: if True, then convert Hz to km/s via restfreq keyword
  • startchan: the first spectral channel to consider
  • endchan: the final spectral channel to consider (if negative, then ignore this many channels at end)

Returns: three lists:
  • xaxis in GHz (or km/s), flux density, blc (i.e. the pixel used)

Example:

CASA <5>: tt.ispec('/net/shadowfax/export/data_2/vext_inorth/casa_imaging/IN_VEX228.LINE_hann.image.pbcor',blc=[209,365],outfile='sma1b.228.txt',showplot=T)
  Out[5]:
(array([  2.28892724e+11,   2.28893585e+11,   2.28894446e+11, ...,
         2.30868610e+11,   2.30869471e+11,   2.30870331e+11]),
 array([ 0.06410486,  0.12293984,  0.1259677 , ...,  0.        ,
        0.        ,  0.        ]))

-- ToddHunter - 2013-12-06
Topic revision: r6 - 2015-02-05, 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