About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/paramio_api.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 pgets Context: paramio

Synopsis

Read/write individual parameter values from S-Lang.

Syntax

Integer_Type pgetb( paramfile, param )
Short_Type pgets( paramfile, param )
Integer_Type pgeti( paramfile, param )
Float_Type pgetf( paramfile, param )
Double_Type pgetd( paramfile, param )
String_Type pgetstr( paramfile, param )

pputb( paramfile, param, Integer_Type intval )
pputs( paramfile, param, Short_Type shortval )
pputi( paramfile, param, Integer_Type intval )
pputf( paramfile, param, Float_Type floatval )
pputd( paramfile, param, Double_Type doubleval )
pputstr( paramfile, param, String_Type stringval )

Description

These functions provide read and write access to individual parameter values for a tool. Unlike the generic pget() and pset() routines provided by paramio, these functions typecast the variable into the given type.

As with all the paramio routines, the PF_Errno variable is set to 0 on success, or on error it is set to one of the error codes listed in the paramio documentation.

Example 1

chips> require("paramio")
chips> err = pgetd( "dmextract", "sys_err" )
chips> print(err)
0
chips> print(typeof(err))
Double_Type

pgetd() is used to return the value of the sys_err parameter of dmextract as a double.

Note that the require("paramio") line only needs to be issued once per ChIPS/Sherpa session.

Example 2

chips> vali = pgeti( "dmextract", "verbose" )
chips> vals = pgets( "dmextract", "verbose" )
chips> vald = pgetd( "dmextract", "verbose" )
chips> valstr = pgetstr( "dmextract", "verbose" )
chips> vmessage( "i=%d s=%d d=%f str=%s", vali, vals, vald, valstr )
i=0 s=0 d=0.000000 str=0
chips> typeof(vali)
Integer_Type
chips> typeof(vals)
Short_Type
chips> typeof(vald)
Double_Type
chips> typeof(valstr)
String_Type

Here we get the value of the "verbose" parameter as an integer, short, double, and string.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.