NRAO Home > CASA > CASA Cookbook and User Reference Manual

8.1.4 Dictionaries

Currently, the SDtasks return the Python dictionary for the results of line fitting (in sdfit) and region statistics (in sdstat). If you invoke these tasks by assigning a variable for the return, you can then access the elements through the keywords, e.g.,

CASA <10>: line_stat=sdstat()  
Current fluxunit = K  
No need to convert fluxunits  
Using current frequency frame  
Using current doppler convention  
 
CASA <11>: line_stat  
  Out[11]:  
{’eqw’: 70.861755476162784,  
 ’max’: 1.2750182151794434,  
 ’mean’: 0.35996028780937195,  
 ’median’: 0.23074722290039062,  
 ’min’: -0.20840644836425781,  
 ’rms’: 0.53090775012969971,  
 ’stddev’: 0.39102539420127869,  
 ’sum’: 90.350028991699219}

One can then use these values in scripts by accessing this dictionary, e.g.,

CASA <12>: print "Line max = %5.3f K" % (line_stat[’max’])  
Line max = 1.275 K


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

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