Chapter 14. Unit conversions

Table of Contents

14.1. Converting to velocity and other frequency scales
14.2. Flux conversions

Last updated: 23 November, 2011

14.1. Converting to velocity and other frequency scales

The "x-axis" of spectra can be converted into other units (frequency, velocity, wavelength) using the general task, convertWavescale.

There is also a task specifically for HIFI data, the ConvertFrequencyTask, which works on a HifiSpectrumDataset and also a HifiTimelineProduct. This can be used to convert between the USB, LSB and IF scale and also to convert to velocity.

Converting Frequency Scales. 

Assuming spectrum is the variable name for a HifiSpectrumDataset with the frequency scale of the data in expressed as IF frequencies.

cft=ConvertFrequencyTask()
cft(sds=spectrum,to="lsbfrequency")

Of course, it is also possible to convert to the upper sideband. for this the keyword is "usbfrequency".

cft(sds=spectrum, to='usbfrequency')

To convert back to the IF, use:

cft(sds=spectrum, to='frequency')

The ConvertFrequencyTask works equally well on the HifiTimelineProduct itself. In this case all the internal HifiSpectrumDatasets are converted. This is not something you should do in the early stages (before level 0.5) of the HIFI pipeline. For example on a level 1 HifiTimelineProduct:

cft=ConvertFrequencyTask()
cft(htp=hifitimelineproduct, to='frequency')
[Note] Note
Direct application of the ConvertFrequencyTask changes the data listed in the spectrum. Conversion back to the original IF scale is possible, just use the to='frequency' option.

Conversion to Velocity. 

The ConvertFreqencyTask also works to convert the frequency scale to a velocity scale ("radio" convention) once given the reference frequency.

cft=ConvertFrequencyTask()
cft(sds=spectrum,to='velocity',reference=576.268,inupper=False)

In the above example, I had to specify the reference frequency in GHz and whether this reference frequency is for the upper (inupper=True) or lower (inupper=False) sideband.

Another call to ConvertFrequencyTask using "to = 'frequency'" will undo the change to velocity as well.

Summary. 

to= Description Other keywords necessary
frequency Converts to the Intermediate Frequency scale. None
usbfrequency Converts to the Upper side band Frequency scale. None
lsbfrequency Converts to the lower side band Frequency scale. None
velocity Converts to the velocity scale in km/s ("radio" convention) reference=reference frequency, inupper=(True or False)