
 January 17th 2000						C.A.Oxborrow
 
 	Suggestions for JEM-X Science Data Sanity Check
 	-----------------------------------------------
 	
Here is a preliminary checklist of tests that should be performed on the
JEMX science data to ensure that data exiting from the ISDC PreProcessing and
JDataPreparation processes is well-behaved, in as many possible senses of that
word. This means reading data in from ISDC raw data structures (-RAW, -PRW,
-SRW and -PRP) and checking their behaviour against the telemetry package
formats described in the JEM-X EID-B (latest version 5.1).
Eventually these sanity criteria will be embodied in an executable JVerify.

All suggestions for extending the sanity check criteria are welcome.

1) For each `packet-starts-on-this-event-row' listed in FULL-PRW, the value of
   delta_time in -FULL-RAW for that row should be zero.
   
2) First OBT listed in -PRW must be greater than or equal to
   PCKSTART keyword value in -RAW, for all data-taking modes.
   
3) Last OBT listed in _PRW must be smaller than or equal to PCKEND keyword value
   in -RAW, for all data-taking modes.

4) Due to masking of lowest 3 bits of OBT and units of OBT, last two hex digits
   of OBT should be 0x00 or 0x80.
   
5) In all formats, OBT of last event(s) in a packet given in -PRP must be
   smaller than first events in next packet.
   
6) All values of OBT in -PRP must be monotonically increasing.

7) Number of events in -RAW for a single data-taking format, in a single science
   window must add up to number of events listed as present for individual
   packets in -PRW.
   
8) In -PRW structure, Number of real events plus number of grey events must
   equal total number of events in a packet, for modes which accomodate
   autonomous grey filter change events (FULL, SPTI and TIME).
   
9) In -PRP structure, first OBT given must be greater than or equal to
   OBT_START keyword in -RAW, and last OBT must be <= OBT_END keyword value.
   
10) All grey filter values in -SRW and -PRW must be in range 0 to 31 inclusive.

11) No SSC value should be used twice within any data-taking format.

12) First SSC value in -PRW must equal value of SSC_BEG keyword in -RAW

13) Last SSC value in -PRW must equal value of SSC_END keyword in -RAW

14) Number of missing SSC found from -PRW must equal SSC_GAP keyword in -RAW

15) In Restricted Imaging, for each packet in -PRW X and Y values must equal
    X/Y values for first event in the packet given in  -RAW.
   
16) In Restricted Imaging DELTA_POS in -RAW for first event in every event
    listed in -PRW must equal zero.
    
17) Every event in one image for restricted imaging must have the same OBT -
    currently the average of LOBT (first event in the image) and LOBT+DLOBT 
    (last event in the image) which are given in -PRW.

 


