private XAS scripts

These scripts reside in ~lucio/bin ([BIN]) unless otherwise stated (variants of official scripts may reside in /ut/Xas/scripts ([UT]); specific scripts ([BOH]) may reside together with the relevant data, but they would not be generally listed here.

by topic

[general] [MECS] [PDS] [HPGSPC]

General utilities

[virtualop] [fudgeobs] [fitfilter] [gridfilter] [makehr] [removenull]

[BIN] virtualop

creates links for a virtual OP in current directory, i.e links all files present in olddir for nobs observations starting at the one numbered oldstart,. renumbering them from newstart onward.
For first OP oldstart and newstart will be equal. For the next OP newstart will be incremented. For the last OP it is likely that the outgoing slew files will be numbered wrongly and will have to be renumbered.

[BIN] fudgeobs

is the workhorse used by virtualop (never called directly)

[BOH] fitfilter, gridfilter

Template scripts to invoke the fitting programs, filtering the data with smask so that each bin has at least nsigma signficance. They should be copied to personalize the initial guesses of the fit case by case.
Sample version in /poseidon/lucio/sax/CP/BLsteep/Data/Pks2155

[BIN] makehr

Produces an hardness ratio file hrsuffix from two time profiles.

[BIN] removenull

will remove null characters from file. Typically used with obsdir, expconf and alike to allow "dxdiff" to see them as ASCII, not binary files.


[autotimewindow] [makenet] [mecslightcurve] [mecsnetlightcurve] [mecsvarlightcurve] [mecsvarnetlightcurve] [fixvarnetlightcurve] [orbitlightcurve]

[BIN] autotimewindow

set automatically a time window or merge current time window with a safe time window where the current gain history is defined.

[BIN] makenet

generates a net spectrum from pre-existing gross and bkg spectra, scaling for the ratio of targetarea to bkgarea. The files are assumed or will be named netunit, grossunit, bkgunit, where unit is usually 2 or 3.

[BIN] mecslightcurve

generates gross and bkg light curves for a MECS unit in given channel range and with given binsize. Use default BL limits and pixel sizes. Require a nooccult time window and munits and munitb region files.

[BIN] mecsnetlightcurve

subtracts a bkg light curve from a gross one, using a given area ratio. The unit can actually be any suffix, and the optional prefix can be used to deal with any files named prefixgrossunit (gross, bkg and net are standard names).

[BIN] mecsvarlightcurve

generates gross and bkg light curves as mecslightcurve, but uses variable bins described in a varbinfile set by a separate xasset. The files are prefixed by an s, and suffixed by the channel range (e.g. sbkg2_10-210)

[BIN] mecsvarnetlightcurve

Combines mecsvarlightcurve and mecsnetlightcurve in a single call, generating net variable-bin light curves with consistent naming.

[BOH] fixvarnetlightcurve

Operates on the output of mecsvarlightcurve, and, before invoking mecsnetlightcurve, it eliminates bins which do not exist in all light curves.
Working version in /poseidon/lucio/sax/CP/BLsteep/Data/Pks2155

[BIN] orbitlightcurve

(obsolescent) generates an ASCII file with an orbit by orbit light curve for source or background, in given energy limits, for given MECS unit and using given time window (specify none if unwanted).


[fudgepdsmatrix] [fixpdsbinsizes] [makeoccultnospike] [onoffchecks] [pds_dir_lightcurve] [] [pdslcstyle]

[BIN] fudgepdsmatrix

fudges a PDS XAS response matrix generated by pdsmaccum, multiplying it for the fixed input energy grid width (0.5 keV) to make it consistent with private fitting programs.

[BIN] fixpdsbinsizes

(obsolescent) inserted correct bin sizes in HK time profiles generated by pds_hk_dir when they where wrong (which is no longer the case)

[BIN] makeoccultnospike

Creates no_occultation.window from a pre-existing nooccult.window, intersecting it with the result an analysis on the products of script pds_hk_dir, taking the intervals where the scientific rate in the p*dir files is below a given threshold in cts/s.

[BIN] onoffcheck(2)

procedures used to check background subtraction, making the difference of individual unit bkg spectra, and combining them into a 4-unit spectrum as done in the usual reduction by pds_logsum nchan elow ehigh (use same values used for the extraction of net source spectra). There are two variants : The first produces totalBD_grp.spectrum, making the difference between plus and minus offset bkg (i.e. unitiB+off - unitiB+off).

The second one produces either totalBDp_grp.spectrum or totalBDm_grp.spectrum, and makes the difference between the plus or minus bkg and the mean bkg (e.g. unitiB - unitiB+off).

[BIN] pds_dir_lightcurve

Accumulates the all-unit light curve unitallS.time with variable bins described in varbinfile, between given energy ranges, with or without PSA correction, in a manner similar to spectral script pds_dir (same naming for intermediate products). The variant pds_dir_lightcurve_byhalf produces halfallS.time and tries to be faster, accumulating data by couple of units (PDS halves) directly.

[UT] pds_dir_part*

This is a split of main script pds_dir in separate parts to simplify repeats Part 1 just accumulates collimator positions and relevant time windows.
Part 2 merges them with no_occultation
Part 3 performs the accumulations.

[BIN] pdslcstyle

(obsolescent) generates single-unit bkg subtracted spectra lcunitiS similar to unitiS generated by the last step of pds_dir, using an alternate program (soperate).


[hp_dir*] [hplightcurve] [hpfixlightcurve]

[UT] hp_dir*

Adaptions or renames of original scripts in the XAS distributions 2.1 and 2.2 (in turn adaptions to HPGSPC by MG of PDS scripts). The functional version is currently hp_dir_2.1, while hp_dir is just a reminder of the existence of two versions. The verbose argument seems compulsory. Recommended BL limits are 80 115. The hp_dir_2.1.lastpart is just the last part of the main script, which avoids to repeat the collimator position profile and related time windows (but does the merging with [a new] no_occultation and the accumulation) in case of repeats.

[BIN] hplightcurve

Accumulates the net light curve onbs.time with variable bins described in varbinfile (use xasset to define it), between given energy ranges, in a manner similar to spectral hp_dir_* (same naming for intermediate products). One need to define the obschain with concatenate, while the script assumes standard BL range.

[BOH] hpfixlightcurve

Accumulates the net light curve fonbs.time with a fixed binsize. It supposes hplightcurve has already been run, since it relies on a difference spectra created by it.
Working version in /poseidon/lucio/sax/CP/BLsteep/Data/Pks2155