
#!/bin/sh
if [ ! "$SAS_ODFDIR" ]; then
echo ""
echo "Please set the SAS_ODFDIR environment variable to point at the directory"
echo "containing the ODF files for this observation."
echo ""
exit 1
fi
# # [INFO] [2020-06-19T16:21:20] Module name: VerifyODF
# # [INFO] [2020-06-19T16:21:20] Instrument: all
# # [INFO] [2020-06-19T16:21:20] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:20] Module version number: 1.18
# # [INFO] [2020-06-19T16:21:20] Version of odfingest used was 3.32.1
# # [INFO] [2020-06-19T16:21:20] Module name: MakeCIF
# # [INFO] [2020-06-19T16:21:20] Instrument: all
# # [INFO] [2020-06-19T16:21:20] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:20] Module version number: 1.23
# # [INFO] [2020-06-19T16:21:20] Observation start defined as >2020-06-11T18:22:29.000<
# # [INFO] [2020-06-19T16:21:20] Processing date defined as >2020-06-19T18:21:20<
# [COMMAND] [2020-06-19T16:21:20]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:20]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:20] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:20]
cifbuild analysisdate=2020-06-19T18:21:20 calindexset=product/P0845040701OBX000CALIND0000.FIT fullpath=no \
observationdate=2020-06-11T18:22:29.000 withccfpath=no -w 10
# # [OUTPUT] [2020-06-19T16:21:45]
# # [INFO] [2020-06-19T16:21:45] Task Run Time cifbuild 24.8306410312653s
#
# [COMMAND] [2020-06-19T16:21:45]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:45]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:45] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:45]
addattribute attributecomment="\"Telescope (mission) name\" \"Date observations ended\" \"Name of PI\" \"RA of instrument pointing \
(degrees)\" \"Observation identifier\" \"Observation mode (pointing or slew)\" \"Name of observed object\" \"DEC of instrument \
pointing\" \"Date observations were made\"" attributename="TELESCOP DATE-END OBSERVER RA_PNT OBS_ID OBS_MODE OBJECT DEC_PNT \
DATE-OBS" attributetype="string string string real string string string real string" realvalue="\"215.2750005\" \"38.9229167\"" \
set=product/P0845040701OBX000CALIND0000.FIT stringvalue="\"XMM\" \"2020-06-11T18:59:01.000\" \"Mr Daniel Kynoch\" \"0845040701\" \
\"POINTED\" \"J1421+3855\" \"2020-06-11T18:22:29.000\"" -w 10
# # [OUTPUT] [2020-06-19T16:21:45]
# # [INFO] [2020-06-19T16:21:45] Task Run Time addattribute 0.253192901611328s
#
# [COMMAND] [2020-06-19T16:21:45]
cp /scratch/19250890.1.xmm64.q/xmm/ppsprod/148884/product/P0845040701OBX000CALIND0000.FIT \
/scratch/19250890.1.xmm64.q/xmm/ppsprod/148884/intermediate/ccf.cif
# # [INFO] [2020-06-19T16:21:45] System RV 0
# # [INFO] [2020-06-19T16:21:46] Module name: GlobalHK
# # [INFO] [2020-06-19T16:21:46] Instrument: all
# # [INFO] [2020-06-19T16:21:46] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:46] Module version number: 1.77
# [COMMAND] [2020-06-19T16:21:46]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:46]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:46] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:46]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2020-06-19T16:21:48] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292841.184\
#     which is more than 20 s outside the period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292841.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292842.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292842.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292843.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292843.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292844.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292844.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292845.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 22 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 708292845.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 22 s away).
# ** preqgti: warning (SummaryOfWarnings), 
# warning NoAttitude silently occurred 69458 times 
# # [INFO] [2020-06-19T16:21:48] Task Run Time preqgti 2.70157694816589s
#
# [COMMAND] [2020-06-19T16:21:48]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:48]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:48] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:48]
atthkgen atthkset=product/P0845040701OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2020-06-19T16:21:49]
# # [INFO] [2020-06-19T16:21:49] Task Run Time atthkgen 0.279544115066528s
#
# [COMMAND] [2020-06-19T16:21:49]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:49]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:49] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:49]
orbit outfile=product/P0845040701OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2020-06-19T16:21:49]
# # [INFO] [2020-06-19T16:21:49] Task Run Time orbit 0.260203123092651s
#
# [COMMAND] [2020-06-19T16:21:49]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:49]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:49] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:49]
radmonfix output=product/P0845040701OBX000RADMON0000.FIT radmonlist=odf/3756_0845040701_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2020-06-19T16:21:49] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578649.9 which\
#     is outside the time correlation data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with\
#     large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578653.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578657.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578661.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578665.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578669.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578673.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578677.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578681.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=179578685.9 which is outside the time correlation\
#     data abscissa range [179574415.9, 179578546] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 451 times 
# # [INFO] [2020-06-19T16:21:49] Task Run Time radmonfix 0.340178966522217s
#
# [COMMAND] [2020-06-19T16:21:49]
cp /lhome/pcms/pipeline/etc/EPICModes.fits \
/scratch/19250890.1.xmm64.q/xmm/ppsprod/148884/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2020-06-19T16:21:49] System RV 0
# # [INFO] [2020-06-19T16:21:49] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# # [INFO] [2020-06-19T16:21:49] Module name: ExpChooser
# # [INFO] [2020-06-19T16:21:49] Instrument: emos1
# # [INFO] [2020-06-19T16:21:49] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:49] Module version number: 1.38
# # [INFO] [2020-06-19T16:21:49] Checking exposure S001 for processability
# # [INFO] [2020-06-19T16:21:49] Filter: CalClosed
# # [INFO] [2020-06-19T16:21:49] Instrument mode: PrimeFullWindow
# # [INFO] [2020-06-19T16:21:49] Exposure duration: 2192
# # [INFO] [2020-06-19T16:21:49] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2020-06-19T16:21:49] Module name: ExpChooser
# # [INFO] [2020-06-19T16:21:49] Instrument: emos2
# # [INFO] [2020-06-19T16:21:49] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:49] Module version number: 1.38
# # [INFO] [2020-06-19T16:21:49] Checking exposure S002 for processability
# # [INFO] [2020-06-19T16:21:49] Filter: CalClosed
# # [INFO] [2020-06-19T16:21:49] Instrument mode: PrimeFullWindow
# # [INFO] [2020-06-19T16:21:49] Exposure duration: 2169
# # [INFO] [2020-06-19T16:21:49] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2020-06-19T16:21:49] Module name: StampKeywords
# # [INFO] [2020-06-19T16:21:49] Instrument: all
# # [INFO] [2020-06-19T16:21:49] Stream no.: 0001
# # [INFO] [2020-06-19T16:21:49] Module version number: 2.08
# # [INFO] [2020-06-19T16:21:49] Getting ODS version from file\
#     /scratch/19250890.1.xmm64.q/xmm/ppsprod/148884/odf/3756_0845040701_SCX00000TCS.FIT
# [COMMAND] [2020-06-19T16:21:49]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:49]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:49] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:49]
addattribute attributecomment="\"Pipeline sequence\" \"Satellite Revolution Number\" \"Processing date\" \"Processing revision\" \
\"PPS configuration\" \"SAS version used in pipeline processing\" \"ODS version\" \"Origin of FITS file\" \"ODF_VERSION\" \"Contents \
of file\"" attributename="SEQ_ID REVOLUT PROCDATE PROCREV PPSVERS SASVERS ODSVER ORIGIN ODFVER CONTENT" attributetype="string string \
string string string string string string string string" booleanvalue="" set=product/P0845040701OBX000CALIND0000.FIT \
stringvalue="\"148884\" \"3756\" \"2020-06-19T18:21:20\" \"1\" \"18.02_20200221_1200\" \"xmmsas_20191120_1210-18.0.0\" \"18.0\" \
\"XMM-Newton/SOC\" \"001\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2020-06-19T16:21:50]
# # [INFO] [2020-06-19T16:21:50] Task Run Time addattribute 0.117963790893555s
#
# [COMMAND] [2020-06-19T16:21:50]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:50]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:50] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:50]
addattribute attributecomment="\"Pipeline sequence\" \"Satellite Revolution Number\" \"Processing date\" \"Processing revision\" \
\"PPS configuration\" \"SAS version used in pipeline processing\" \"ODS version\" \"Origin of FITS file\" \"ODF_VERSION\" \"Contents \
of file\"" attributename="SEQ_ID REVOLUT PROCDATE PROCREV PPSVERS SASVERS ODSVER ORIGIN ODFVER CONTENT" attributetype="string string \
string string string string string string string string" booleanvalue="" set=product/P0845040701OBX000ATTTSR0000.FIT \
stringvalue="\"148884\" \"3756\" \"2020-06-19T18:21:20\" \"1\" \"18.02_20200221_1200\" \"xmmsas_20191120_1210-18.0.0\" \"18.0\" \
\"XMM-Newton/SOC\" \"001\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2020-06-19T16:21:50]
# # [INFO] [2020-06-19T16:21:50] Task Run Time addattribute 0.118767976760864s
#
# [COMMAND] [2020-06-19T16:21:50]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:50]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:50] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:50]
addattribute attributecomment="\"Pipeline sequence\" \"Satellite Revolution Number\" \"Processing date\" \"Processing revision\" \
\"PPS configuration\" \"SAS version used in pipeline processing\" \"ODS version\" \"Origin of FITS file\" \"ODF_VERSION\" \"Contents \
of file\"" attributename="SEQ_ID REVOLUT PROCDATE PROCREV PPSVERS SASVERS ODSVER ORIGIN ODFVER CONTENT" attributetype="string string \
string string string string string string string string" booleanvalue="" set=product/P0845040701OBX000ORBTSR0000.FIT \
stringvalue="\"148884\" \"3756\" \"2020-06-19T18:21:20\" \"1\" \"18.02_20200221_1200\" \"xmmsas_20191120_1210-18.0.0\" \"18.0\" \
\"XMM-Newton/SOC\" \"001\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2020-06-19T16:21:50]
# # [INFO] [2020-06-19T16:21:50] Task Run Time addattribute 0.130939960479736s
#
# [COMMAND] [2020-06-19T16:21:50]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2020-06-19T16:21:50]
export SAS_RAND_SEED=845040701
# # [INFO] [2020-06-19T16:21:50] ## DEBUG ModuleResources: SAS_RAND_SEED set: 845040701
# [COMMAND] [2020-06-19T16:21:50]
addattribute attributecomment="\"Pipeline sequence\" \"Satellite Revolution Number\" \"Processing date\" \"Processing revision\" \
\"PPS configuration\" \"SAS version used in pipeline processing\" \"ODS version\" \"Origin of FITS file\" \"ODF_VERSION\" \"Contents \
of file\"" attributename="SEQ_ID REVOLUT PROCDATE PROCREV PPSVERS SASVERS ODSVER ORIGIN ODFVER CONTENT" attributetype="string string \
string string string string string string string string" booleanvalue="" set=product/P0845040701OBX000RADMON0000.FIT \
stringvalue="\"148884\" \"3756\" \"2020-06-19T18:21:20\" \"1\" \"18.02_20200221_1200\" \"xmmsas_20191120_1210-18.0.0\" \"18.0\" \
\"XMM-Newton/SOC\" \"001\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2020-06-19T16:21:50]
# # [INFO] [2020-06-19T16:21:50] Task Run Time addattribute 0.134135961532593s
#
# [COMMAND] [2020-06-19T16:21:50]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2020-06-19T16:21:50] System RV 0
# [COMMAND] [2020-06-19T16:21:50]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2020-06-19T16:21:50] System RV 0
