Skip to main content

How can I calculate the spectral coverage of my SPWs in different frequency reference frames? - Knowledgebase / Offline Data Reduction and/or CASA - ALMA Science

How can I calculate the spectral coverage of my SPWs in different frequency reference frames?

Authors list

The easiest way to calculate the spectral coverage of one or more SPWs in different frequency reference frames is by using plotms or viewer. For a measurement set, plotms will plot data as a function of frequency using the reference frame selected in the Transform tab. For an image, the spectrum can be plotted by using the Spectrum Profiler in the viewer's control bar; the spectrum profiler contains a pull-down menu for selecting the reference frame.

To calculate the spectral coverage without a GUI (e.g. for scripting purposes) you can invoke plotms from the command line.

  1. Set the x-axis to "velocity" or "frequency" and the y-axis to anything else.

  2. Select the SPW that you want; select one scan to speed up the process.

  3. Average over all time and all baselines.

  4. Set transform to True.

  5. Set the rest frequency, frequency reference frame, and velocity definition appropriately.

  6. Set plotfile to "plot1.txt" or some other .txt output file

  7. plotms will produce a text file holding your spectrum. All you care about are the minimum and maximum (first and last entries of the first column) values of the x coordinate. That's the spectral coverage of your spectral window in the selected reference frame.

For example:

plotms(vis = vis,
       xaxis = 'frequency',
       yaxis = 'amp',
       scan = '3',
       correlation = 'XX',
       spw = '0',
       avgtime = '1e6',
       avgbaseline = True,
       transform = True,
       freqframe = 'LSRK',
       restfreq = '115.27120GHz',
       plotfile = 'plot1.txt')

 

For more information on frequency reference frames see the KB article What are the frequency reference frames in CASA?