NAME

db2xcm - create an XSPEC *.xcm file for a given set of runid, detector, iteration tuples based on some combination of default values, previous fits archived in the PostgreSQL database, and user supplied parameters.


SYNOPSIS

db2xcm [param=value ...]


PARAMETERS

db2xcm uses an IRAF-compatible parameter interface. A template parameter file is in /proj/axaf/simul/lib/uparm/db2xcm.par.

key file
An \rdb formatted file containing columns `runid', `detector', and `iteration'. db2xcm parses the \rdb file and creates an XSPEC *.xcm file for each tuple.

model
A list of XSPEC models, specified in the same fashion as for the XSPEC model command.

Note that there are some differences between XSPEC syntax and the syntax here. New models here are specified by prepending an @ to the model name. Also, if there are multiple instances of the same model for a entry in the database, the user may specify which instance but appending an index to the model name, `[1]'.

Thus, @jmkmod is a new jmkmod, jmkmod[3] is the third jmkmod in the database for the current tuple, and jmkmod @jmkmod jmkmod is the first jmkmod from the database followed by a new jmkmod, followed by the second jmkmod from the database.

param
A semi-colon seperated list of XSPEC parameter values. Each fit parameter is specified as keyword = value, where keyword has the form model[index],parameter,attribute, where model is the name of an XSPEC model, parameter is the name of a parameter in the model, and attribute is one of the parameter attributes. Valid values of attribute are val, min, bot, max, top, fix. index specifies the ordinal number of the model if there is more than one instance of that model.

Parameters maybe set equal to another parameter by specifying value as ordinal,model,parameter modifier. If the model is the same as the current one, the model and ordinal fields may be omitted. If there is only one instance of the model, the ordinal field may be omitted. Leading commas should be deleted. The optional modifier, say a previous parameter times 1.5, must be preceded by a space; If not present, no space should be included.

paramfile file
A file containing additional XSPEC parameter values specified as above in param. One keyword = value to a line.

channels boolean
If true, the noticed channels from the PostgreSQL database is included in the XSPEC *.xcm file created. It appears as two XSPEC commands, first a ignore 1-, then a notice value, where value is the value from the PostgreSQL database noticed_channels field.

dflt_db
The PostgreSQL database where the default XSPEC models are kept.

xp_db
The PostgreSQL database where the XSPEC parameter tables(xp_* tables) are kept.

host
The PostgreSQL hostname.

port
The PostgreSQL port.

model_man file
The name and absolute path of the XSPEC model manager.

version boolean
If true, db2xcm prints the version number and exits.

help boolean
If true, db2xcm prints this help message and exits.


DESCRIPTION

db2xcm creates an XSPEC *.xcm file for the runid, detector, iteration tuples specified in the key file.

The models are specified in the same fashion as for the XSPEC model command. New models should be prefixed with @. When there is more than one instance of the same model in a specification, the possibility for confusion in assigning values to model parameters arises. Parameters will be assigned to models in the order that the models appear in the database. For instance, if the original specification is

        jmkmod gaussian gaussian gaussian

and the new specification is

        jmkmod gaussian @jmkmod gaussian gaussian

this is equivalent to

        jmkmod[1] gaussian[1] @jmkmod gaussian[2] gaussian[3]

If a new model instance will replace a previous one, or if the ordering of models is to be changed, explicit specificaiton of the models' ordinal numbers (as assigned in the original specification) is required. For instance, if the second Gaussian is to be replaced with a new one,

        jmkmod gaussian @gaussian gaussian[3]

the ordinal number for the third Gaussian must be specified, else db2xcm will use the parameters from the second Gaussian. Parameter attributes for new models must be specified using the models' ordinal numbers, excluding reused models. For instance, in the above example, the parameters for the new Gaussian would be specified as

        @gaussian[1].LineE.val = 33

or

        @gaussian[1].LineE.bot = 3

or

        @gaussian[1].LineE.bot = 2,powerlaw,Phoindex

(Note the @ preceding the model, indicating it refers to an added model.)


AUTHOR

Michael Tibbetts (mtibbetts@cfa.harvard.edu)