BINFACT = 1.5
COUNTS_MIN = 30
GDMAX = 12
GDMIN = 0
HARD1 = 1.51
HARD2 = 10
MAXCADENCE = 0.205
MAXCENTRATE = 1
MAXEN = 10
MAXSLEWRATE = 10
MINCENTCTS = 20
MINCMIN = 15
MINEN = 0.3
MINEVT = 15
RATEFACT = 10
SOFT1 = 0.3
SOFT2 = 1.5
T0 = 651316725.76
TIMEDEL = 0.001766
WTHIRATE = 250
WTLORATE = 70
WTPUPRATE = 120
wtslew called for trigger 01069788, with pos 304.4377910563, 5.2827323272 and T0: 651316725.76
START WAS 

Event list: sw01069788000xwtw2st_cl.evt.gz
Calling extractor to filter first snaphot: 651316725.76 - 651317725.76 (0 - 1000) s
Roll angle is 302.08194412463
TIME RANGE: 651316790.116961 - 651316799.706482 (64.3569610118866 - 73.9464820623398)
LIST of teldef files:
  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20190101v001.teldef
  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef
SELECTED TELDEF: /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef
ATTFILE: sw01069788000pat.fits.gz
HDFILE: sw01069788000xhd.hk.gz

Got ra/dec pnt of 304.45585707939,5.27774964414183 from sw01069788000pat.fits.gz
This converts (304.4377910563,5.2827323272) to sky pixels (527.9726,508.1098)

Filtered on time as firstvalid is 651316785.11696
Do a pileup check
CHECKING FOR PILEUP: RATE: 120
CHECKPUP: 9 bins, 9 above 120, 9 above 250, 0 below 70  (ex=0)
Done pileup check
The data are piled up, so get time-dependent position
Going to call stmode centroid

Called
stmode_centroid.pl sw01069788000xwtw2st_cl.evt.gz sw01069788000xhd.hk.gz sw01069788000pat.fits.gz /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef 651316725.76 > /dev/null 2>&1

Cadence is 0.0836189985275269 (from 651316790.339352-651316790.255733)
Saved 36 centroids for interpolation
Calling wt_syserr with time-dependent positions
Comm: wt_syserr -t 0 -P pos_time.dat -xaf -A  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef sw01069788000pat.fits.gz 651316785.116961 651316804.706482 philx2.out 0.5


Working out exclusion radius to correct for pile up
OK, not removing piled up events here, will do it later on
But need to work out exrad
Manually creating pup-check lc with exl=4
CHECKPUP: 10 bins, 10 above 120, 4 above 250, 0 below 70  (ex=4)
Manually creating pup-check lc with exl=8
CHECKPUP: 10 bins, 10 above 120, 0 above 250, 0 below 70  (ex=8)
Manually creating pup-check lc with exl=10
CHECKPUP: 10 bins, 9 above 120, 0 above 250, 0 below 70  (ex=10)
Manually creating pup-check lc with exl=12
CHECKPUP: 10 bins, 6 above 120, 0 above 250, 0 below 70  (ex=12)
Manually creating pup-check lc with exl=14
CHECKPUP: 10 bins, 1 above 120, 0 above 250, 0 below 70  (ex=14)
Recalculate systematic error with -p 7 for pileup
Calling wt_syserr with time-dependent positions
Comm: wt_syserr -t 0 -p 7 -P pos_time.dat -xaf -A  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef sw01069788000pat.fits.gz 651316785.116961 651316804.706482 philx3.out 0.5

Call ftlist to get the events from event list filtered_2.evt.gz
Got 3927 events before binning
Call getbadpix()
The number of events it 3927, for ontime; 9.58952033519745 s and mean rate thus rate=409.509533608924
BIN SIZE: 67.5

EXL: 7 pixels


GOTCENTROID= 1

EXL=7
Created events.txt
The bg to source ratio is 0.0968085106382979
Calling binwtslew.pl  start=64.3569610118866 T0=651316725.76 BINFACT=1.5 COUNTS_MIN=30 GDMAX=12 GDMIN=0 HARD1=1.51 HARD2=10 MAXCADENCE=0.205 MAXCENTRATE=1 MAXEN=10 MAXSLEWRATE=10 MINCENTCTS=20 MINCMIN=15 MINEN=0.3 MINEVT=15 RATEFACT=10 SOFT1=0.3 SOFT2=1.5 T0=651316725.76 TIMEDEL=0.001766 WTHIRATE=250 WTLORATE=70 WTPUPRATE=120 
Returned 0
Complete OK
