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


omprep (omprep-2.48) [xmmsas_20230412_1735-21.0.0]


Algorithm

subroutine omprep

  Read in parameters.
  Read in ODF Image / Event List / Tracking History Data Auxiliary file.
  Determine file type from file name in primary header.

  Read in keywords and data from input file.

  IF OM Imaging Mode Data Image file.

    Get a handle on the image array extension.
    Read in the image array extension keywords.
    Get a pointer to the image.
    Get the dimensions of the image.

  IF OM Fast Mode Event List file.

    Get a handle on the event list binary table extension.
    Read in the event list binary table extension keywords.
    Get handles and pointers on the event list binary table extension columns.
    Get the number of rows in the event list binary table extension.

  IF  OM Tracking History Data Auxiliary file.

    Get a handle on the event list binary table extension.
    Read in the tracking history binary table extension keywords.
    Get handles and pointers on the tracking history binary table extension columns.
    Get the number of frames in the tracking history binary table extension.
 
  IF Incompatible file.
 
    call fatal("badFileType", "Value for keyword FILENAME is incompatible")

  ENDIF

  Extract exposure from header. If not present, use mssllib routine to extract 
  start and end time of exposure from the observation summary file via 
  getstartendexp(nphSet, expNumber ,OBTstart, OBTend ,dateObs ,dateEnd ,filterString)
  in which case exposure = obtEnd - obtStart
  Also get filter information from summary file and check validity. 


  Read in OM ODF Priority Window Data Auxiliary file.
  Determine file type from file name in primary header.
  Get a handle on the window data binary table extension.
  Get binAx1 from SWP1 and binAx2 from SWP2.
  sciWin numbering system still not settled. May add sampling time and bfast ID to event list.
  Release handles on data.
 
  IF Incompatible file call fatal("badFileType", "Value for keyword FILENAME is incompatible")

  Open the ODF. call OAL_openODF(trim(odfDir))
  Get the proposal info. from observation summary file.  call OAL_proposalInfo(propInfo)

  Write out OM image / event list / tracking history intermediate output filename.
  Write keywords to outFile.
  Gets attitude information via oal
%  Write CONTENT keyword to outFile.
%  Write RA_SCX, DEC_SCX and PA keywords.
  Write further keywords to outfile.
  Write data to outFile. 
 
  IF OM Imaging Mode Data Image file
    Convert Image from int32 data in odf to real32 data for output.
  ENDIF

  IF NOT OM Tracking History Data Auxiliary file
  Add a MODES extension, detailing the science window parameters.

  Release handles on data.

end subroutine  omprep



XMM-Newton SOC -- 2023-04-16