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/pquery.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 pquery Context: tools

Synopsis

Query whether a parameter exists and, if so, get and return its value.

Syntax

pquery toolname parameter
pquery toolname parameter [ [ para1=value ... ] | value1 ... ]

Description

`pquery' is useful in scripts to get parameter values. It will prompt the user for parameter values for queried parameters (if not specified as optional arguments to the command line) and will simply return the values of hidden parameters.

Example 1

pquery dmcopy infile

Since infile in dmcopy.par is a queried parameter, pquery would prompt the user for the value and then echo that back to STDOUT which could be grabbed by a script.

Example 2

pquery dmcopy infile infile='my_file.fits'

Now, since the parameter value has been specified, it will just return the parameter value (and set it in the parameter file).

Example 3

echo infile outfile clobber | pquery dmcopy - clob+

Will get the values for all three parameters: infile, outfile, and clobber. Since clobber is specified on the command line it will get the value (yes) from there. The other two parameter are typically 'queried'/automatic parameters and would be prompted for.

Parameters

name type ftype reqd
parameter_file string input yes
parameter string input yes

Detailed Parameter Descriptions

Parameter=parameter_file (string required filetype=input)

parameter file name

Name (plus optional path) of the parameter file to use

Parameter=parameter (string required filetype=input)

Name of parameter to query

The name of the parameter to query. Optionally can use the various parameter attributes listed below to return those values.

Parameter Attributes
p_mode Whether the parameter is prompted for or not
p_value The value of the parameter. If the parameter is a redirected, this returns the redirection string rather than what the redirection evaluates too.
p_min Minimum value allowed
p_max Maximum value allowed
p_prompt The parameter prompt

If the parameter value is "-", a list of parameters is read from stdin.

Bugs

See the bugs page for this tool on the CIAO website for an up-to-date listing of known bugs.

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.