
#!/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] [2024-11-30T23:39:40] Module name: VerifyODF
# # [INFO] [2024-11-30T23:39:40] Instrument: all
# # [INFO] [2024-11-30T23:39:40] Stream no.: 0001
# # [INFO] [2024-11-30T23:39:40] Module version number: 1.18
# # [INFO] [2024-11-30T23:39:40] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:39:40] Module name: MakeCIF
# # [INFO] [2024-11-30T23:39:40] Instrument: all
# # [INFO] [2024-11-30T23:39:40] Stream no.: 0001
# # [INFO] [2024-11-30T23:39:40] Module version number: 1.23
# # [INFO] [2024-11-30T23:39:40] Observation start defined as >2002-07-21T08:33:12.000<
# # [INFO] [2024-11-30T23:39:40] Processing date defined as >2024-12-01T00:39:40<
# [COMMAND] [2024-11-30T23:39:40]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:39:40]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:39:40] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:39:40]
cifbuild analysisdate=2024-12-01T00:39:40 calindexset=product/P0112290901OBX000CALIND0000.FIT fullpath=no \
observationdate=2002-07-21T08:33:12.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:40:09]
# # [INFO] [2024-11-30T23:40:09] Task Run Time cifbuild 28.8655769824982s
#
# [COMMAND] [2024-11-30T23:40:09]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:09]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:09] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:09]
addattribute attributecomment="\"Telescope (mission) name\" \"Date observations were made\" \"Date observations ended\" \"Name of \
observed object\" \"Name of PI\" \"RA of instrument pointing (degrees)\" \"Observation mode (pointing or slew)\" \"DEC of instrument \
pointing\" \"Observation identifier\"" attributename="TELESCOP DATE-OBS DATE-END OBJECT OBSERVER RA_PNT OBS_MODE DEC_PNT OBS_ID" \
attributetype="string string string string string real string real string" realvalue="210.829167 -41.3847222" \
set=product/P0112290901OBX000CALIND0000.FIT stringvalue="\"XMM\" \"2002-07-21T08:33:12.000\" \"2002-07-21T08:58:11.000\" \"NGC5408\" \
\"Dr Martin Turner\" \"POINTED\" \"0112290901\"" -w 10
# # [OUTPUT] [2024-11-30T23:40:09]
# # [INFO] [2024-11-30T23:40:09] Task Run Time addattribute 0.118698835372925s
#
# [COMMAND] [2024-11-30T23:40:09]
cp /scratch/225625.1.all.q/xmm/ppsprod/228770/product/P0112290901OBX000CALIND0000.FIT \
/scratch/225625.1.all.q/xmm/ppsprod/228770/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:40:09] System RV 0
# # [INFO] [2024-11-30T23:40:09] Module name: GlobalHK
# # [INFO] [2024-11-30T23:40:09] Instrument: all
# # [INFO] [2024-11-30T23:40:09] Stream no.: 0001
# # [INFO] [2024-11-30T23:40:09] Module version number: 1.81
# [COMMAND] [2024-11-30T23:40:09]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:09]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:09] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:09]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:40:09] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 143629178.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 143629178.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 143629179.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 143629179.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 143629180.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 143629180.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 143629181.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 143629181.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 143629182.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 143629182.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 10332 times 
# # [INFO] [2024-11-30T23:40:09] Task Run Time preqgti 0.403107166290283s
#
# [COMMAND] [2024-11-30T23:40:09]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:09]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:09] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:09]
atthkgen atthkset=product/P0112290901OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:40:09]
# # [INFO] [2024-11-30T23:40:09] Task Run Time atthkgen 0.141716957092285s
#
# [COMMAND] [2024-11-30T23:40:09]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:09]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:09] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:09]
orbit outfile=product/P0112290901OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:40:09] orbit:- Output FITS Orbit timeseries: product/P0112290901OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:40:09] Task Run Time orbit 0.14955997467041s
#
# [COMMAND] [2024-11-30T23:40:09]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:09]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:09] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:09]
radmonfix output=product/P0112290901OBX000RADMON0000.FIT radmonlist=odf/0479_0112290901_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:40:10] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863001.95 which\
#     is outside the time correlation data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863005.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863009.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863013.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863017.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863021.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863025.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863029.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863033.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=64863037.95 which is outside the time correlation\
#     data abscissa range [64864454.7, 64872990.73] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 494 times 
# # [INFO] [2024-11-30T23:40:10] Task Run Time radmonfix 0.0847780704498291s
#
# [COMMAND] [2024-11-30T23:40:10]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/225625.1.all.q/xmm/ppsprod/228770/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# # [INFO] [2024-11-30T23:40:10] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:40:10]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/225625.1.all.q/xmm/ppsprod/228770/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# [COMMAND] [2024-11-30T23:40:10]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/225625.1.all.q/xmm/ppsprod/228770/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# [COMMAND] [2024-11-30T23:40:10]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/225625.1.all.q/xmm/ppsprod/228770/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# # [INFO] [2024-11-30T23:40:10] Module name: ExpChooser
# # [INFO] [2024-11-30T23:40:10] Instrument: om
# # [INFO] [2024-11-30T23:40:10] Stream no.: 0001
# # [INFO] [2024-11-30T23:40:10] Module version number: 1.38
# # [INFO] [2024-11-30T23:40:10] Checking exposure S006 for processability
# # [INFO] [2024-11-30T23:40:10] Filter: Blocked
# # [INFO] [2024-11-30T23:40:10] Instrument mode: FlatFieldLow
# # [INFO] [2024-11-30T23:40:10] Exposure duration: 1499
# # [INFO] [2024-11-30T23:40:10] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:40:10] Module name: StampKeywords
# # [INFO] [2024-11-30T23:40:10] Instrument: all
# # [INFO] [2024-11-30T23:40:10] Stream no.: 0001
# # [INFO] [2024-11-30T23:40:10] Module version number: 2.09
# # [INFO] [2024-11-30T23:40:10] Getting ODS version from file\
#     /scratch/225625.1.all.q/xmm/ppsprod/228770/odf/0479_0112290901_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:40:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:10]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:10]
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="" realvalue="" set=product/P0112290901OBX000CALIND0000.FIT \
stringvalue="\"228770\" \"0479\" \"2024-12-01T00:39:40\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.2.0\" \
\"XMM-Newton/SOC\" \"004\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:40:10]
# # [INFO] [2024-11-30T23:40:10] Task Run Time addattribute 0.0332059860229492s
#
# [COMMAND] [2024-11-30T23:40:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:10]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:10]
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="" realvalue="" set=product/P0112290901OBX000ATTTSR0000.FIT \
stringvalue="\"228770\" \"0479\" \"2024-12-01T00:39:40\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.2.0\" \
\"XMM-Newton/SOC\" \"004\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:40:10]
# # [INFO] [2024-11-30T23:40:10] Task Run Time addattribute 0.0330209732055664s
#
# [COMMAND] [2024-11-30T23:40:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:10]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:10]
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="" realvalue="" set=product/P0112290901OBX000ORBTSR0000.FIT \
stringvalue="\"228770\" \"0479\" \"2024-12-01T00:39:40\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.2.0\" \
\"XMM-Newton/SOC\" \"004\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:40:10]
# # [INFO] [2024-11-30T23:40:10] Task Run Time addattribute 0.0332341194152832s
#
# [COMMAND] [2024-11-30T23:40:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:40:10]
export SAS_RAND_SEED=0112290901
# # [INFO] [2024-11-30T23:40:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0112290901
# [COMMAND] [2024-11-30T23:40:10]
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="" realvalue="" set=product/P0112290901OBX000RADMON0000.FIT \
stringvalue="\"228770\" \"0479\" \"2024-12-01T00:39:40\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.2.0\" \
\"XMM-Newton/SOC\" \"004\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:40:10]
# # [INFO] [2024-11-30T23:40:10] Task Run Time addattribute 0.0453779697418213s
#
# [COMMAND] [2024-11-30T23:40:10]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# [COMMAND] [2024-11-30T23:40:10]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
# [COMMAND] [2024-11-30T23:40:10]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:40:10] System RV 0
