XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


omfastshift (omfastshift-1.26) [xmmsas_20211130_0941-20.0.0]


Algorithm

   subroutine omfastshift

   Read parameters

   Get a handle on the ODF OM Tracking History Data Auxiliary File.
   Confirm datamode from DATAMODE keyword in primary header.

   Get a handle on the tracking history data binary table extension.
   Calculate drifts.
   If BPE binning implemented divide drifts by two
   Release handles on column and table.

   Read in Intermediate Event List file.
   Confirm datamode from DATAMODE keyword in primary header.

   Get a handle on the event list binary table extension.
   Get the number of rows in the event list binary table extension.

   Read modes extension.
   
   Get start and end time of exposure from the non-periodic housekeeping file.
   Calculate tracking frame time stamps in OBT for middle of tracking frame.

   Do 'shift and add' process.

      Calculate On board Time for each event taking into acount wrap around for int16 values.

      if (ibits(ftFineP(i-1), 15, 1) == 1) then

         obtEvent(i) = REAL(ftCoarseP(i-1)) + REAL( ibits(ftFineP(i-1), 0, 15) + 2**15 ) / 65536.0

      else

         obtEvent(i) = REAL(ftCoarseP(i-1)) + REAL(ftFineP(i-1)) / 65536.0
      
      end if

      Locate tracking frame in which event occured.
      If linear interpolation of drifts is required ...
   
         Find time of event since previous tracking frame.
         Interpolate drift to this time
	
      If not use tracking frame drift

   end do


   Flag events outside Science window

   Convert Onboard Timestamps (OBT) to event time tags (elapsed seconds since mission 
   reference time 1998-01-01T00:00:00).

   Write time attributes to input file.
   Add new columns.
   Write data to columns.
   Release data.

   end subroutine  omfastshift



XMM-Newton SOC -- 2021-11-30