FUNCTION Main script to invoke a suite of other scripts that call into action programs (stage-1) for extracting, monitoring and processing SAX-WFC FOTs in order to prepare the data for detecter correlation and X-ray sources detection (stage-2). USAGE w_proc -f prefix [-specifier [argument]] ..... [-specifier [argument]] or w_proc -fot [-specifier [argument]] ..... [-specifier [argument]] Where a specifier can be a switch or option followed by an argument. At least one of the following specifiers must be present: '-fot' to copy files from tape to disk, '-fits' to process FOT data into FITS files, '-clean' to select Good Time Intervals and produce filtered files; '-shift' to do event positioning processing, '-plot' to produce survey plots (PostScript format). All these actions (except '-fot') require the use of '-f'. If given with option '-fot' it will overrule the automatic setting of FOTID. Common practice is taking for the FOTID the Observation Period number preceded by 'OP' Before being able to use the w_proc at least the following shell environment variables must be set: WFC_TOP e.g. /home/xrayman/wfc WFC_ETC e.g. $WFC_TOP/etc WFC_BIN e.g. $WFC_TOP/bin path e.g. ( $WFC_ETC $WFC_BIN $path ) As in some instances use is made of ftools utilities also the following environment variable must be set FTOOLDIR e.g. /home/library/ftools To store the parameter files In addition a directory in your home directory must exist with the following name: $HOME/pfiles/release The names of these directories may be site dependent, so when in doubt ask your local ftools manager. It is advisable to create a single shell source file for setting these variables plus others to be used with stage-2 processing. DESCRIPTION When the '-fot' option is used it reads data from tape by invoking the 'dd' utility to copy the data from the FOT onto disk. If will create the specified FOT directory if not present. All other actions will invoke a call to one or more of the following relevant scripts: w_fits, w_clean, w_plot, w_shift, etc and will be described at the relevant document parts. Throughout a FOT-prefix is used to specify which particular WFC-FOT has to be processed. Presently only one FOT can be processed at a time. ACTION SPECIFIERS The order of actions or options is not fixed. An option can be either a switch or a keyword followed by one or more arguments. At least one of the following actions must be selected: -fot Copy FOT data directly from tape onto diskfiles. Resulting names are of the form 'prefix__nnnn.fot' where nnnn is a numeric field. If no prefix is specified by the '-f' switch, the FOT number as found in the TAPEDIRECTORY (first file) will be taken. -fits Process FOT files previously copied from tape or retrieved by internet and renamed by w_vaxlink. Swap bytes if the data is written according the VAX byte ordering. Extract the relevant data into files structured according the FITS standard. Issue warnings about the instrument status and out-of-limit situations. Print an overview of types and times of extracted data. The resulting files are level 0 processed fits files and will be of the form Wprefix_*0.fits'. -clean Clean and select from level 0 processed FOT files according selection criteria (script 'w_clean' will be invoked). The resulting files are level 1 processed fits files and will be of the form Wprefix_*1.fits'. Additionally the attitude data is processed and analyzed to produce information on camera pointings and earth occultations. Stage-2 processing can take place on level 1 procesing or higher. -shift Process level 1 processed FOT files to produce drift corrected detector positions (script 'w_shift' will be invoked). The resulting files are level 2 processed fits files and will be of the form Wprefix_*2.fits' -plot Produce a standard set of plots in PostScript format (script 'w_plot' will be invoked). They contain ratemeter plots, instrument houskeeping values, pointing information, observation modes, etc. One sheet is produced per each observation. -spv Run a Sensor Performance Verification on level 0 data. (script 'w_spv' will be invoked but is presently only available at SRON-Utrecht) GENERAL OPTION SPECIFIERS -h Display a concise help on the available switches and recognized environment settings. It will not show the switches of possible subsequently invoked scripts however. -f [string] The argument specifies the FOT identifier. TFor resulting files this will become the prefix of all names. Only when processing directly from tape with the '-fot' action can this switch be omitted, in which case the FOTID is taken from the FOT directory. But also in this case it will be overruled by giving the -f FOT_ID switch. -t [string] Specify (top-)directory where input (link)files are located. By default the current directory is taken. This default can be overruled by setting environment variable $WFC_OBS Only in case of '-fot' action this will be the destination directory where the FOT files from tape will be placed to be used as input for level 0 (-fits) processing. It will overrle the value of enveironment variable FOT_TOP. -d [string] Force result files under destination top-dir. By default this will be the input directory. Already existing result files will be overwritten. -vv [integer] Argument value regulates the output verbosity volume. When 0 a minimal (silent) output will occur. The default is 1 where it will show the programs that were active and some info on files produced. A larger value will produce more diagnostic info. This switch will be passed on to subsequently invoked scripts. -w1 -w2 Only process the data of one (-w1 or -w2) camera. (not relevant for '-fot' and -fits' actions) -save Force intermediate files to be saved. By default the lower level files will be discarded. -n [integer] -n1 [integer] -n2 [integer] Indicates the number (-n) or number range (-n1 and -n2) of observations to be processed. By default n1 = 1 and n2 = 999. -c1 [string] -c2 [string] The name of the input FITS file that contains the coefficients to calculate the physical values of temperatures and voltages from digitally coded analog value. By default they are $WFC_CAL/wfc1.det and $WFC_CAL/wfc1.det respectively. The defaults can be fixed by setting environment variables W_INSCAL1 and W_INSCAL2 respectively. -blockio Allow writing and reading data files in fast block I/O. This may introduce a non-standerd FITS format that cannot be used across different computer systems and will not work with systems using VAX byte order. Presently by default the blockio option is disabled for OSF1 unix systems and enabled for all other systems like HPUX. LEVEL 0 RELATED OPTIONS -swap -noswap Specify whether the data is organized according to VAX definition and bytes of words and double-words must be swapped. This will be normally the case if FOT's were produced by the Science Data Centre. Presently by default the swap option is disabled for OSF1 unix systems and enabled for all other systems like HPUX. -tape [string] Specify the device name of the tape-unit. Only relevant in case of '-fot; action. default: /dev/rmt/0mn. The default can be preset with environment variable TAPE. -nvol [integer] Specify number of tape volumes. default: 1 -att [string] -eph [string] -obt [string] Specify the name of an alternative file containing attitude, ephemeris or OBT_UTC data. It will replace the one that is in the FOT. If not present in the FOT it will be inserted at the porper place in the original FOT. It is possible to specify the alternative file by setting the respective environment variables W_ATTFILE, W_EPHFILE, or W_OBTFILE. -frt [string] Argument specifies root-name of disk created fotfiles By default takes the specified FOTID plus '_' NOT RECOMMENDED TO CHANGE THE DEFAULT -fxt [string] Argument specifies extension of disk located fotfiles (default .fot) NOT RECOMMENDED TO CHANGE THE DEFAULT HIGHER LEVEL RELATED OPTIONS -fi [string] Name of the file containing expression for making the Good Times Intervals from each Instrument Housekeeping file By default file $WFC_ETC/etc/wfc_sel_ins is used. This default can be fixed by setting environment variable W_SELINS -fs [string] Name of the file containing expression for making the Good Times Intervals from each Science Housekeeping file By default file $WFC_ETC/etc/wfc_sel_sci is used. This default can be fixed by setting environment variable W_SELSCI -fe [string] Name of the file containing expression for making the Good Times Intervals from the Ephemeris file. By default file $WFC_ETC/etc/wfc_sel_eph is used. This default can be fixed by setting environment variable W_SELEPH -plotall Plots all observations. By default only the observations having instrument housekeeping plus instrument and science data will result in a plotting sheet. -plotslew Plots also obsrvations in slew mode. By default these observations will not be plotted -spvslew Also perform SPV on slew observations. By default this will not be done. RECOGNIZED ENVIRONMENT VARIABLES In addition default values for switches and installed settings can be overruled by the following shell environment variables. TAPE used when reading from tape with the '-fot' option (default: /dev/rmt/0mn) WFC_TOP The top directory of the WFC software distribution No default as it is site dependent WFC_ETC Place where scripts and general selection files are located if not present default to $WFC_TOP/etc WFC_BIN Place where the program executable binaries are located if not present default to $WFC_TOP/bin WFC_CAL Place where calibration and instrument definition files. if not present default to $WFC_TOP/cal (see also switches '-c1' and '-c2') WFC_FITSORIG String to be used for the ORIGIN keyword in produced Fitsfiles (default: `hostname` ) FOT_TOP The directory where the FOT files are resided. This is the input directory for all actions except for the '-fot' option where it will be the directory in which the FOT files are loaded. (default: `pwd` ) W_INSCAL1 if not present default to $WFC_CAL/wfc1.det (see also switch '-c1') W_INSCAL2 if not present default to $WFC_CAL/wfc2.det (see also switch '-c2') W_EPHFILE if not present default to "-" (see also switch '-eph') W_ATTFILE if not present default to "-" (see also switch '-att') W_OBTFILE if not present default to "-" (see also switch '-obt') W_SELEPH if not present default to $WFC_ETC/wfc_sel_eph (see also switch '-fe') W_SELINS if not present default to $WFC_ETC/wfc_sel_ins (see also switch '-fi') W_SELSCI if not present default to $WFC_ETC/wfc_sel_sci (see also switch '-fs') PLT_MET1 Meter name of upper graph to be plotted if not present default to RATE_EVENT PLT_MET2 Meter name of middle graph to be plotted if not present default to RATE_PROC PLT_MET3 Meter name of lower graph to be plotted if not present default to RATE_GUARD EXAMPLES: Copy a FOT onto disk in directory /FOTDIR from default tape-unit and force FOTID to 'OP999' > w_proc -fot -t /FOTDIR -f OP999 Process a FOT from tape completely with standard options, put resulting files in the current directory and save the output in a logfile > w_proc -fot -fits -clean -plot -t FOTDIR > logfile To re-process all observation of camera 2 only and store the results in a different destination directory > w_proc -f OP1234 -w2 -clean -t FOTDIR -d /DESTDIR To process all relevant files for SPV test on a selected range (obs 3 thru 5) of observations on the FOT. So all observations with modes DIR001, DIR004 and DIR005 if present > w_proc -f OP678 -spv -n1 3 -n2 5 -t /FOTDIR NOTES - The destination directory will be created if not present. - Specifiers specific for subsequently invoked scripts are passed on without prior checking. - By default the resulting files of the '-fot' action will be of the form 'FOTID__####.fot' where '####' is a file sequence number. The names files resulting from any other action will be of the form 'WFOTID_####w@xxxx' where '####' is the observation number, '@' is the camera number and 'zzzz' is filetype specific string. - Although not used by w_proc itself the following environment variables are relevant to other scripts invoked: W_INSCAL1, W_INSCAL2, W_EPHFILE, W_ATTFILE, W_OBTFILE, W_FOTREPDIR - In case a FOT resides on disk its filenaming is not of the form 'prefix__nnnn.fot' a renaming or namelink is needed by script w_vaxlink available in $WFC_ETC. - Presently '-shift' option is not operational as insufficient analysis has been performed due to unreliable attitudes. - The detector calibration files are created during the installment of Stage-2 software package. - Unspecified options exist fot handling cases of incomplete or corrupt FOTs. They are not advised for use in general operations. SEE ALSO w_vaxlink, w_stageI, w_fits, w_clean, w_plot