<casaxml xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd file:///opt/casa/code/tools/xml/casa.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://casa.nrao.edu/schema/psetTypes.html">
<tool module="quanta" name="quanta">
<shortdescription>quanta tool handles units and quantities
<keyword>quanta</keyword>
<include>quanta_forward.h</include>
<include>quanta_private.h</include>
<method name="quanta" type="constructor">
<shortdescription>Construct quanta tool</shortdescription>
Create a quanta tool on the specified host (or by default the
host you are running on).
<method name="convertfreq" type="function">
<shortdescription>convert a frequency quantity to another unit</shortdescription>
<param name="v" direction="in" type="variant">
<description>quantity to convert</description>
<param name="outunit" direction="in" type="string">
<description>unit to convert to</description>
convertfreq converts a frequency quantity to another unit.
print "\t----\t convertfreq Ex 1 \t----"
print qa.convertfreq('5GHz','cm')
#{'value': 5.9958491599999997, 'unit': 'cm'}
print qa.convertfreq('5cm','GHz')
#{'value': 5.9958491599999997, 'unit': 'GHz'}