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


next up previous contents index
Next: measures.doframe - Function Up: measures - Tool Previous: measures.listcodes - Function


measures.measure - Function



Package general
Module measures
Tool measures


convert a measure to another reference


Synopsis
measure(v, rf, off, qv)


Arguments

v in measure to be converted
    Allowed: measure
rf in output reference code
    Allowed: coded string
off in optional output offset
    Allowed: measure
    Default: F
qv in optional quantity (with multiple values possible)
    Allowed: quaantity
    Default: F


Returns
measure


Description
measure converts measures (epoch, direction etc.) from one reference to another. It will, for instance, convert a direction from J2000 to AZEL representation.
Its arguments are a measure, an output reference code (see the individual measures for the allowable codes (direction, position, epoch, frequency, doppler, radialvelocity, baseline, uvw, earthmagnetic)), and an optional offset of the same type as the main measure. The offset will be subtracted from the result before it is returned.
In some cases (see the individual measures for when), more information than just a reference code is necessary. E.g. the above example of a conversion to AZEL, needs to know for when, and where on Earth we want it. This information is stored in a reference frame. Measures are set in the reference frame with the doframe function. The frame is tool wide.
An optional argument em qv can contain a quantity with a vector of values and a unit. When present, the vector will be converted (and returned) in the same way as the main reference. Not all Measures accept this argument yet. If needed please ask an enhancement.



Example
- print a := dm.epoch('utc', 'today') 			# a time
[type=epoch, refer=utc, m0=[value=50451.2, unit=d]]
- dm.measure(a, 'tai')					# convert to IAT
[type=epoch, refer=tai, m0=[value=50451.2, unit=d]] 
- dm.doframe(a)						# set time in frame
T 
- dm.doframe(dm.observatory('ATCA'))			# set position in frame
T 
- print b:=dm.direction('j2000', dm.toangle('0h'), '-30deg')  # a direction
[type=direction, refer=j2000, m0=[value=0, unit=rad], 
	m1=[value=-0.523599, unit=rad]]
- dm.measure(b, 'azel')					# convert to AZEL
[type=direction, refer=azel, m0=[value=-1.35242, unit=rad], 
	m1=[value=0.846695, unit=rad]]
- print dm.angle(dm.getvalue(dm.measure(b, 'azel'))[1]),
+	 dm.angle(dm.getvalue(dm.measure(b, 'azel'))[2]) # show as angles
-077.29.18 +048.30.43
In the following the qv argument is used.
# Fill the frame with necessary information
- dm.doframe(dm.epoch('utc','today'))
T
- dm.doframe(dm.observatory('atca'))
T
- dm.doframe(dm.direction('mars'))
T
# Make a list of frequencies to be converted
- a:=dq.unit([1,1.1,1.2,1.3],'GHz')
- a
[value=[1 1.1 1.2 1.3] , unit=GHz] 
# Make a frequency measure. Although any can be used, it is advisable
# to use an element of the list, to make sure all units are correct
- m:=dm.frequency('lsrk',dq.unit(dq.getvalue(a)[1], dq.getunit(a))) 
# Convert all
- dm.measure(m,'lsrd',qv=a)
[type=frequency, refer=LSRD, m0=[value=999995118, unit=Hz]] 
# And check
- a
[value=[0.999995118 1.09999463 1.19999414 1.29999365] , unit=GHz]





next up previous contents index
Next: measures.doframe - Function Up: measures - Tool Previous: measures.listcodes - 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