analyze_ltcrv.sl - An algorithm for cleaning lightcurves
The analyze_ltcrv.sl script analyzes a lightcurve,
e.g. created by dmextract. It performs an iterative
sigma-clipping algorithm, removing those points that fall
outside +/-3 sigma from the mean at each iteration until all
data points are within +/-3 sigma. This algorithm is robust
but not perfect; it can easily "overclean" a noisy lightcurve
and should not be used blindly. The output is a list of the
accepted time periods and their lengths.
The output time periods can then be used to filter the event
list, either by using dmgti to create a GTI file, or directly
within a DM filter expression.
The script is run from within slsh ("ahelp slsh"), as shown in
the example. To load the script:
slsh> () = evalfile("analyze_ltcrv.sl")
This step is only necessary once per slsh session.
This script is used in the Filtering Lightcurves thread.
When analyze_ltcrv.sl prints an error message, the "myerror"
routine also prints a S-lang run-time error:
** ERROR **
analyze_ltcrv() stopped as unable to read data from file
./analyze_ltcrv.sl:63:myerror:Run-Time Error
As long as this is preceded by a script error ("** ERROR **"),
it may be ignored. If it does not appear that a script error
condition was met, contact the CXC HelpDesk
for assistance.
slsh> analyze_ltcrv("lc_c7.fits")
Running analyze_ltcrv.sl from within slsh. The screen
output is:
((time > 77377570.949648) && (time < 77399570.949648)) ; 22.00 ksec
((time > 77404770.949648) && (time < 77406770.949648)) ; 2.00 ksec
These time periods can be used to filter the event list,
either by using dmgti to create a GTI file, or directly within
a DM filter expression.
The plotting routines have been removed from the script, since
they will not work in ChIPS 4.0. Otherwise, analyze_ltcrv.sl
functionality is unchanged. The plotting functionality will be
replaced soon.
The script has been updated to use the cxcdm module in place
of VARMM (Variable, Math and Macro S-Lang library).
|