Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/ciao/ahelp/pquery.html
AHELP for CIAO 4.9

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

There are no known bugs for this tool.

See Also

concept
parameter
tools
dmhistory, dmkeypar, dmmakepar, dmreadpar, paccess, pdump, pget, pline, plist, pset, punlearn

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

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