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


next up previous contents index
Next: quanta.getvalue - Function Up: quanta - Tool Previous: quanta.convertdop - Function


quanta.quantity - Function



Package general
Module quanta
Tool quanta


make a quantity from a string or from a value and a unit string


Synopsis
quantity(v, name)


Arguments

v in value to convert to quantity
    Allowed: quantity or string or numeric
    Default: '1' or 1.0
name in unit string if v numeric
    Allowed: string
    Default: ''


Returns
quantity


Description
quantity makes a quantity from a string, or from a value and a string. Note that a function unit exists which is a synonym for quantity. If only a string is given, it can be a scalar string, a vector of strings, or an array of strings. The result will be a scalar quantity, or an array of quantities. If a numeric value and a string are given, the numeric value can be any numeric type, and can also be an array or a vector of them. See the introduction for an example of all the possibilities.



Example
- tu := dq.quantity('1Jy')			# make quantity
- tu
[value=1, unit=Jy] 
- dq.quantity(tu)				# also accepts a quantity
[value=1, unit=Jy] 
- tu := dq.unit('1Jy')			# make quantity with synonym
- tu
[value=1, unit=Jy] 
- dq.quantity(-1.3, 'Jy')		# make quantity with separate value
[value=-1.3, unit=Jy]





next up previous contents index
Next: quanta.getvalue - Function Up: quanta - Tool Previous: quanta.convertdop - 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