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 = 656831448
TIMEDEL = 0.001766
WTHIRATE = 250
WTLORATE = 70
WTPUPRATE = 120
wtslew called for trigger 01081113, with pos 162.3842248046, 31.5128553311 and T0: 656831448
START WAS 

Event list: sw01081113000xwtw2st_cl.evt.gz
Calling extractor to filter first snaphot: 656831448 - 656832448 (0 - 1000) s
Roll angle is 126.12156299433
TIME RANGE: 656831561.667227 - 656831570.057612 (113.6672270298 - 122.057611942291)
LIST of teldef files:
  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210101v001.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: sw01081113000pat.fits.gz
HDFILE: sw01081113000xhd.hk.gz

Got ra/dec pnt of 162.369156150189,31.5702567592215 from sw01081113000pat.fits.gz
This converts (162.3842248046,31.5128553311) to sky pixels (480.8815,412.84)

Filtered on time as firstvalid is 656831556.66723
Do a pileup check
CHECKING FOR PILEUP: RATE: 120
CHECKPUP: 8 bins, 8 above 120, 0 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 sw01081113000xwtw2st_cl.evt.gz sw01081113000xhd.hk.gz sw01081113000pat.fits.gz /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef 656831448 > /dev/null 2>&1

Cadence is 0.203711032867432 (from 656831562.181396-656831561.977685)
Saved 15 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 sw01081113000pat.fits.gz 656831556.667227 656831575.057612 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=2
CHECKPUP: 9 bins, 7 above 120, 0 above 250, 0 below 70  (ex=2)
Manually creating pup-check lc with exl=4
CHECKPUP: 9 bins, 4 above 120, 0 above 250, 0 below 70  (ex=4)
Manually creating pup-check lc with exl=6
CHECKPUP: 9 bins, 4 above 120, 0 above 250, 1 below 70  (ex=6)
Manually creating pup-check lc with exl=8
CHECKPUP: 9 bins, 3 above 120, 0 above 250, 3 below 70  (ex=8)
Manually creating pup-check lc with exl=10
CHECKPUP: 9 bins, 3 above 120, 0 above 250, 3 below 70  (ex=10)
Manually creating pup-check lc with exl=12
CHECKPUP: 9 bins, 3 above 120, 0 above 250, 5 below 70  (ex=12)
Manually creating pup-check lc with exl=14
CHECKPUP: 9 bins, 3 above 120, 0 above 250, 5 below 70  (ex=14)
Manually creating pup-check lc with exl=16
CHECKPUP: 9 bins, 2 above 120, 0 above 250, 5 below 70  (ex=16)
Manually creating pup-check lc with exl=18
CHECKPUP: 9 bins, 1 above 120, 0 above 250, 6 below 70  (ex=18)
Recalculate systematic error with -p 9 for pileup
Calling wt_syserr with time-dependent positions
Comm: wt_syserr -t 0 -p 9 -P pos_time.dat -xaf -A  /usr/local/swift/caldb/data/swift/xrt/bcf/teldef/swx20210701v001.teldef sw01081113000pat.fits.gz 656831556.667227 656831575.057612 philx3.out 0.5

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

EXL: 9 pixels


GOTCENTROID= 1

EXL=9
Created events.txt
The bg to source ratio is 0.0880503144654088
Calling binwtslew.pl  start=113.6672270298 T0=656831448 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=656831448 TIMEDEL=0.001766 WTHIRATE=250 WTLORATE=70 WTPUPRATE=120 
Returned 0
Complete OK
