nraonrao
 
NRAO Home > CASA > CasaRef
coordsys.frequencytofrequency - Function

1.1.3 Convert frequency to frequency with an offset
Description

This function converts frequencies to frequencies by applying (subtracting) a velocity offset.

The input frequencies are specified via a vector of numeric values and a specified unit (frequnit). If you don’t give a frequency unit, it is assumed that the units are those given by function coordsys units() for the spectral coordinate.

This function does not make any frame conversions (e.g. LSR to BARY) but you can specifiy the velocity doppler definition for the velocity via the doppler argument (see image summary() for possible values).

This function fails if there is no spectral coordinate in the Coordinate System. See also function frequencytovelocity.

This function presently uses an approximation only valid for velocities less than the speed of light. The correction tends to zero as the velocity appraches the speed of light. You will get NaNs for larger values of the velocity.

Arguments





Inputs

value

Frequency to convert

allowed:

doubleArray

Default:

frequnit

Unit of input frequencies. Default is unit of the spectral coordinate.

allowed:

string

Default:

velocity

Velocity offset

allowed:

any

Default:

variant

doppler

Velocity doppler definition

allowed:

string

Default:

radio

Returns
doubleArray

Example

"""  
#  
print "\t----\t frequencytofrequency Ex 1 \t----"  
csys = cs.newcoordsys(spectral=T)  
idx = [1.1,1.2,1.3,1.4,1.5]  
rval = csys.referencevalue()  
rv=rval[’numeric’][0]  
freq=[]  
for i in range(len(idx)):  
  freq.append(rv*idx[i])  
print "In = [%.4e %.4e %.4e %.4e %.4e]" % tuple(freq)  
#In = [1.5565e+09 1.6980e+09 1.8395e+09 1.9810e+09 2.1225e+09]  
print cs.frequencytofrequency(freq, velocity=’100km/s’)  
#[1555980894.0489383, 1697433702.5988414, 1838886511.1487448,  
# 1980339319.698648, 2121792128.2485518]  
#  
"""

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2008 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search

Updated daily during alpha development.