Loop over all raw CCD files CCDs to analyse (space separated) ccds in [1:7] Process low gain data Start from ODF files (or from intermediate files Exposures to analyse ("" is all) true Instrument to analyse Rerun atthkgen Filter data on bad attitude Tolerance for attitude filtering (degrees) atttol in [0.:] Filter data on bad HK Input HK GTI file for emframes true Algorithm for finding bad pixels Stop just after bad pixels detection Call bright pixels detection additionally below 500 eV Run badpix Run emevents Randomize position, energy and/or time true Run attcalc Run emenergy Save CCD background for offset calibration (one file per CCD) Delete events flagged for rejection Hexadecimal rejection flag Merge CCD-specific events lists Keep all original columns Apply CCD-specific and HK GTI Keep intermediate files Build the GTI for proton flare rejection Time bin for flare rejection (s) flaretimebin in [2.6:] Threshold on truncated singles per ks per arcmin2 flaremaxrate in [0.:] Apply the proton flare GTI Build global flare time series for all MOS exposures Compute low-energy noise flags Call evigweight to add WEIGHT column Stop at first error (or continue loop) Erase previously existing output files