#include "xstcl.h" #include "xscf.h" #include #define MAXOPTS 41 int xs_tclout(ClientData cdata,Tcl_Interp* interp,int objc, Tcl_Obj* CONST objv[] ) { static char* outToTcl; char* chosen = NULL; char* next = NULL; /* pointers for xspec common block variables */ float* energies = NULL; /* ear */ float* phaCor = NULL; float* phaObs = NULL; float* phaMod = NULL; float* phaBkg = NULL; float* varObs = NULL; float* varBkg = NULL; float* areasc = NULL; float* backsc = NULL; float* effArea = NULL; /* effar */ float* flux = NULL; /* fluxar */ float* components = NULL; /* esavar */ float* responseElts = NULL; /* respon */ int* group = NULL; /* igroup */ int* beginChan = NULL; /* ichanb */ int* endChan = NULL; /* ichane */ double* values = NULL; int logging = 0; int status = 0; int retStatus = TCL_OK; int posn = 0; int plot = 0; int interactive = 0; char* tmp=NULL; int paramNo = 1; int componentNo = 1; int dataNo = 1; int nparams; int i = 0; int source = 1; float energy = 0.; float deltaEnergy = 0.; char* tmp1 = NULL; char* tmp2 = NULL; unsigned int paramRequested = 1; /* for genfit */ unsigned int selected = 1; const char* option[] = { "", /* [0] null selection - put there to make 0 an invalid input condition */ "areascal", /* [1] areascal values */ "arf", /* [2] arf filename */ "backgrnd", /* [3] background filename */ "backscal", /* [4] backscal values */ "chatter", /* [5] current chatter level */ "compinfo", /* [6] compinfo -> the name, start model param # and number of parameters of the specified model component */ "cosmo", /* [7] cosmological parameters in use */ "datagrp", /* [8] number of datagroups */ "datasets", /* [9] number of datagroups */ "dof", /* [10] no. of d.o.f. */ "energies", /* [11] energies -> response energies for specified dataset */ "eqwidth", /* [12] eqwidth -> last equivalent width calculated for specified datagroup */ "error", /* [13] error -> last confidence region calculated for specified parameter */ "expos", /* [14] exposure time */ "filename", /* [15] filename -> filename of specified dataset */ "flux", /* [16] flux -> last model (energy flux, low range on error, high range on error) calculated for specified dataset */ "ftest", /* [17] last calculated F statistic */ "genpop", /* [18] genpop -> the genetic algorithm population for specified parameter */ "goodness", /* [19] last calculated goodness */ "idline", /* [20] idline -> get possible line IDs in specified energy range */ "lumin", /* [21] luminosity -> last model (luminosity, low range on error, high range on error) calculated for specified dataset */ "model", /* [22] description of current model */ "modcomp", /* [23] number of model components */ "modpar", /* [24] number of model parameters */ "modval", /* [25] modval current calculated model values for specified dataset */ "noticed", /* [26] noticed (low,high) noticed channels for specified dataset */ "param", /* [27] param -> (initial,delta,min,low,high,max) for specified model parameter */ "peakrsid", /* [28] peakrsid -> energies and strengths of the peak residuals (+ve and -ve) for the specified dataset. If an additional two arguments are given, they are an energy range in which to search */ "pinfo", /* [29] pinfo -> parameter name and unit */ "plink", /* [30] plink -> information on parameter linking. (T/F, parameter, multiplicative factor, additive constant)*/ "plot", /* [31] plot