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.
- Set the x-axis to "velocity" or "frequency" and the y-axis to anything else.
- Select the SPW that you want; select one scan to speed up the process.
- Average over all time and all baselines.
- Set transform to True.
- Set the rest frequency, frequency reference frame, and velocity definition appropriately.
- Set plotfile to "plot1.txt" or some other .txt output file
- 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.
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?