Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: coordsys.setstokes - Function Up: coordsys - Tool Previous: coordsys.setrestfrequency - Function


coordsys.setspectral - Function



Package general
Module images
Tool coordsys


Set tabular values for the spectral coordinate


Synopsis
setspectral(refcode, restfreq, frequencies, doppler, velocities)


Arguments

refcode in Reference code
    Allowed: String
    Default: No change
restfreq in Rest frequency
    Allowed: Quantum or double
    Default: No change
frequencies in Vector of frequencies
    Allowed: Quantum vector
    Default: No change
doppler in Doppler type
    Allowed: String
    Default: No change
velocities in Vector of velocitiestypes
    Allowed: Quantum vector
    Default: No change


Returns
T or fail



Description

When you construct a Coordsys tool, if you include a Spectral Coordinate, it will be linear in frequency. This function allows you to replace the Spectral Coordinate by a finite table of values. Coordinate conversions between pixel and world are then done by interpolation.

You may specify either a vector of frequencies or velocities. If you specify frequencies, you can optionally specify a (new) reference code (see function setreferencecode for more details) and rest frequency (else the existing ones will be used).

If you specify velocities, you can optionally specify a (new) reference code and rest frequency (else the existing ones will be used). You must also give the doppler type (see function summary for more details). The velocities are then converted to frequency for creation of the Spectral Coordinate (which is fundamentally described by frequency).

You may specify the rest frequency as a Quantum or a double (native units of Spectral Coordinate used).



Example
- cs := coordsys(spectral=T);
-
- f1 := [1,1.01,1.03,1.4]
- fq := dq.quantity(f1, 'GHz')
- cs.setspectral(frequencies=fq)
- v := cs.frequencytovelocity(f1, 'GHz', 'radio', 'km/s')
- print 'v=', v
[88731.3175 86620.7061 82399.4832 4306.86125]  
- vq := dq.quantity(v, 'km/s')
- cs.setspectral(velocities=vq, doppler='radio')
- f2 := cs.velocitytofrequency(v, 'GHz', 'radio', 'km/s')
-
- print 'f1 = ', f1
[1 1.01 1.03 1.4]  
- print 'f2 = ', f2
[1 1.01 1.03 1.4]
We make a linear Spectral Coordinate. Then overwrite it with a list of frequenices. Convert those values to velocity, then overwrite the coordinate starting with a list of velocities. Then convert the velocities to frequency and show we get the original result.





next up previous contents index
Next: coordsys.setstokes - Function Up: coordsys - Tool Previous: coordsys.setrestfrequency - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01