NOTES ON PMTRAS BLIP TIMING Establishing the time of PMTRAS blips t0 = time (seconds relative to 1980) of the timetag of first packet. t0 = HSI_SCTIME2ANY( indat[0].sctime_ref, /utime) All other times are expressed relative to t0. packetime = time (seconds relative to t0) of subsequent packets (REAL*8) packetime = HSI_SCTIME2ANY( indat[*].sctime_ref, /utime) - t0 timecntr = array of counter values of samples (For 2ms, in range [0,127]) timecntr[*,n] = indat[n].counter[0:255] stime = start time of accum interval of peak count (seconds, relative to t0) stime[*,n] = packetime[n] + FINDGEN(256) * readout_interval[n] + timecntr[*,n] * accum_interval[n] ; for n'th packet maxcase = WHERE(timecntr[*,n] eq max_cntr, nmax) ; ID cases where peak was in last accum stime[maxcase,n] = stime[maxcase,n]-readout_interval[n] ; subtract 1 readout for pipeline corr nsamp = 256*npackets packetid = INTARR( 256, npackets) ; original packet number sampleid = BYTARR( 256, npackets) ; sample number (0,,,255) within packet timecntr = BYTARR( 256, npackets) ; counter value for each sample stime = DBLARR( 256, npackets) ; start time of accumulation interval identified by 'timecntr' scval = BYTARR(3, 256, npackets) accum_interval = FLTARR(npackets) ; fixed accumulation inverval (seconds) readout_interval= FLTARR(npackets) ; fixed readout interval (seconds) ; ratio = FLOAT(counts[2,*] - counts[0,*]) / (counts[1,*] - bkgd) ; note ratio=0 if peak is at center of intval ratio = REFORM(ratio, /OVERWRITE) accum_intervals = accum_interval[packetid] blip_interpolation = hsi_pmtras_blip_interpolation (ratio, accum_intervals, BLIP_FWHM = blip_fwhm, /SEQUENCED) bliptimecorr = blip_interpolation.time_correction * accum_intervals ; .time_correction values are in range [0,1] bliptime = starttime + bliptimecorr