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

URL: http://cxc.harvard.edu/ciao/ahelp/paramgetpath.html
Jump to: Description · Examples · See Also


AHELP for CIAO 4.9

paccess

Context: paramio

Synopsis

Returns the path to the specified parameter file.

Syntax

paccess(paramfile)
paccess(paramfile, mode)
paccess(fh, param)

paramgetpath(paramfile)
paramgetpath(fh)

Description

The paccess() and paramgetpath() routines are used to find out whether parameters and parameter files are accessible.

paccess()

There are two forms of the paccess() call:

  • first argument is a string
  • first argument is a Param_File object created by paramopen()

If given a string as the first argument then paccess() will return the full path to the parameter file, or an exception if it can not be found or the parameter file can not be accessed using the supplied mode (the optional second argument).

If given a Param_File object as the first argument then paccess() returns 1 if the second argument is listed in the parameter file, or 0 if not.

paramgetpath()

The paramgetpath() function returns the location of the parameter file for the given argument, which can be either the name of the parameter file or the Param_File object returned by paramopen().

Example 1

>>> from paramio import *
>>> print(paccess("dmlist"))
/home/ciaouser/cxcds_param/dmlist.par

Example 2

>>> fp = paramopen("dmlist")
>>> print(paramgetpath(fp))
/home/ciaouser/cxcds_param/dmlist.par

Example 3

>>> fp = paramopen("dmcopy")
>>> print(paccess(fp, "infile"))
1
>>> print(paccess(fp, "value"))
0

See Also

paramio
paramclose, paramio, paramopen, pget, pgets, plist, pquery, 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.