Below is the algorithm for the CORNER METHOD subroutine espfilt Read parameters. Create these with evselect FOV image FOV lightcurve Corner event list Corner image Corner lightcurve if (method .eq. ratio) Create FOV annulus event list Create FOV annulus image Create FOV annulus lightcurve endif Call method if (method .eq. histogram) then call histogram_method subroutine histogram_method: Construct intermediary file names (QDP, GTI) call clean_lc (based on clean_rel.pro) subroutine clean_lc: extract columns TIME, RATE from FOV LC extract columns TIME, RATE from corners LC bin TIME, RATE columns from object LC bin TIME, RATE columns from corners LC smooth RATE column from object LC smooth RATE column from corners LC create histogram sortindex array fill sortindex as simple histogram of counts find peak of the distibution run downhill simplex multi-D minimization of gaussian fit function verify goodness of fit call write_qdp_gti to create output quicklooks end clean_lc call gauss_fit end histogram_method elseif (method .eq. ratio) then call ratio_method subroutine ratio_method: extract corner spectrum backscale corner spectrum extract FOV annulus spectrum backscale FOV annulus spectrum read exposure, backscal, counts from Corner data. read exposure, backscal, counts from FOV Ann data. create ratio of FOV annulus to corner: ratio = fovann_counts / corner_counts * \ (corner_time * corner_area) / \ (fovann_time * fovann_area) call clean_lc as above create ratio of FOV annulus to corner LC create GTI for time intervals when FOV\/corner ratio acceptable call write_qdp_gti to create output quicklooks end ratio_method end call_method Create these with evselect: FOV filtered (flare-free) event list FOV filtered (flare-free) image Corner filtered (flare-free) event list Corner filtered (flare-free) image Add EHIGH, ELOW attributes to products Add fit parameters attributes to products: NORM, WIDTH, CENTER H_IMME, H_TOTL, L_IMME, L_TOTL end espfilt subroutine write_qdp_fit open QDP output file write header, title information write out count rate histogram overlay selection and fit limits write out FOV lightcurve overlay GTIs write out Corner lightcurve overlay GTIs open ASCII gti.txt file write out GTIs to ASCII task gtibuild create GTI fits file end subroutine write_qdp_fit