NRAO Home > CASA > CASA Toolkit Reference Manual
quanta.angle - Function

1.5.1 show an angle as a formatted string


Description

angle converts an angle quantity to a formatted string. The formatting information is a precision (0 is default, 6 includes +-ddd.mm.ss) and a string array of codes (no-case, minimax match): Codes include:

clean
delete leading/trailing superfluous separators
no_d
do not show degrees part
no_dm
do not show degrees and minutes part
dig2
show only 2 digits of degrees in angle format
time
show as time (hh:mm:ss.ttt) rather than as angle

If a multi-dimensional value is given for the value v, the returned value is a string vector of a length equal to last dimension. Each string has a number of fields equal to the number of elements in all earlier dimensions. If the showform is T, each vector element is surrounded by a pair of square brackets if there is more than one entry, and fields are separated by a ’,’.

Arguments





Inputs

v

angle quantity value to output

allowed:

variant

Default:

prec

number of digits shown

allowed:

int

Default:

0

form

formatting information in coded string array

allowed:

stringArray

Default:

showform

show square brackets and separating ,

allowed:

bool

Default:

false

Returns
stringArray

Example

 
 
"""  
#  
print "\t----\t angle Ex 1 \t----"  
tu = qa.quantity(’5.7.12.345678’) # define an angle  
print tu  
#{’value’: 5.1200960216666669, ’unit’: ’deg’}  
print qa.angle(tu)     # default output  
#+005.07.12  
print qa.angle(tu, prec=7) # 7 digits  
#+005.07.12.3  
print qa.angle(tu, prec=4) # 4 digits  
#+005.07.  
print qa.angle(tu, form=["tim","no_d"]) # as time, no hours shown  
#:20:29  
#  
"""  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright © 2016 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