
#!/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:42:27] Module name: VerifyODF
# # [INFO] [2024-11-30T23:42:27] Instrument: all
# # [INFO] [2024-11-30T23:42:27] Stream no.: 0001
# # [INFO] [2024-11-30T23:42:27] Module version number: 1.18
# # [INFO] [2024-11-30T23:42:27] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:42:27] Module name: MakeCIF
# # [INFO] [2024-11-30T23:42:27] Instrument: all
# # [INFO] [2024-11-30T23:42:27] Stream no.: 0001
# # [INFO] [2024-11-30T23:42:27] Module version number: 1.23
# # [INFO] [2024-11-30T23:42:27] Observation start defined as >2002-05-02T10:58:55.000<
# # [INFO] [2024-11-30T23:42:27] Processing date defined as >2024-12-01T00:42:27<
# [COMMAND] [2024-11-30T23:42:27]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:27]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:27] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:27]
cifbuild analysisdate=2024-12-01T00:42:27 calindexset=product/P0032341201OBX000CALIND0000.FIT fullpath=no \
observationdate=2002-05-02T10:58:55.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:42:57]
# # [INFO] [2024-11-30T23:42:57] Task Run Time cifbuild 29.8602690696716s
#
# [COMMAND] [2024-11-30T23:42:57]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:57]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:57] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:57]
addattribute attributecomment="\"Telescope (mission) name\" \"Observation mode (pointing or slew)\" \"RA of instrument pointing \
(degrees)\" \"Date observations were made\" \"Observation identifier\" \"Name of observed object\" \"Name of PI\" \"Date \
observations ended\" \"DEC of instrument pointing\"" attributename="TELESCOP OBS_MODE RA_PNT DATE-OBS OBS_ID OBJECT OBSERVER \
DATE-END DEC_PNT" attributetype="string string real string string string string string real" realvalue="\"141.944916\" \
\"-6.0711945\"" set=product/P0032341201OBX000CALIND0000.FIT stringvalue="\"XMM\" \"POINTED\" \"2002-05-02T10:58:55.000\" \
\"0032341201\" \"HD 81809\" \"Dr Fabio Favata\" \"2002-05-02T11:23:56.000\"" -w 10
# # [OUTPUT] [2024-11-30T23:42:57]
# # [INFO] [2024-11-30T23:42:57] Task Run Time addattribute 0.0490360260009766s
#
# [COMMAND] [2024-11-30T23:42:57]
cp /scratch/225753.1.all.q/xmm/ppsprod/228898/product/P0032341201OBX000CALIND0000.FIT \
/scratch/225753.1.all.q/xmm/ppsprod/228898/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:42:57] System RV 0
# # [INFO] [2024-11-30T23:42:57] Module name: GlobalHK
# # [INFO] [2024-11-30T23:42:57] Instrument: all
# # [INFO] [2024-11-30T23:42:57] Stream no.: 0001
# # [INFO] [2024-11-30T23:42:57] Module version number: 1.81
# [COMMAND] [2024-11-30T23:42:57]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:57]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:57] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:57]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:42:57] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725921.184\
#     which is more than 20 s outside the period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725921.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725922.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725922.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725923.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725923.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725924.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725924.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725925.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21.0000000298 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 136725925.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21.0000000298 s away).
# ** preqgti: warning (SummaryOfWarnings), 
# warning NoAttitude silently occurred 15604 times 
# # [INFO] [2024-11-30T23:42:57] Task Run Time preqgti 0.503620147705078s
#
# [COMMAND] [2024-11-30T23:42:57]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:57]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:57] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:57]
atthkgen atthkset=product/P0032341201OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:42:58]
# # [INFO] [2024-11-30T23:42:58] Task Run Time atthkgen 0.169466018676758s
#
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
orbit outfile=product/P0032341201OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:42:58] orbit:- Output FITS Orbit timeseries: product/P0032341201OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:42:58] Task Run Time orbit 0.135135889053345s
#
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
radmonfix output=product/P0032341201OBX000RADMON0000.FIT radmonlist=odf/0439_0032341201_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:42:58] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961801.95 which\
#     is outside the time correlation data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961805.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961809.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961813.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961817.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961821.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961825.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961829.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961833.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=57961837.95 which is outside the time correlation\
#     data abscissa range [57962245.47, 57972423.96] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 83 times 
# # [INFO] [2024-11-30T23:42:58] Task Run Time radmonfix 0.074343204498291s
#
# [COMMAND] [2024-11-30T23:42:58]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/225753.1.all.q/xmm/ppsprod/228898/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# # [INFO] [2024-11-30T23:42:58] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:42:58]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/225753.1.all.q/xmm/ppsprod/228898/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# [COMMAND] [2024-11-30T23:42:58]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/225753.1.all.q/xmm/ppsprod/228898/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# [COMMAND] [2024-11-30T23:42:58]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/225753.1.all.q/xmm/ppsprod/228898/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# # [INFO] [2024-11-30T23:42:58] Module name: ExpChooser
# # [INFO] [2024-11-30T23:42:58] Instrument: om
# # [INFO] [2024-11-30T23:42:58] Stream no.: 0001
# # [INFO] [2024-11-30T23:42:58] Module version number: 1.38
# # [INFO] [2024-11-30T23:42:58] Checking exposure S003 for processability
# # [INFO] [2024-11-30T23:42:58] Filter: Blocked
# # [INFO] [2024-11-30T23:42:58] Instrument mode: FlatFieldLow
# # [INFO] [2024-11-30T23:42:58] Exposure duration: 1501
# # [INFO] [2024-11-30T23:42:58] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:42:58] Module name: StampKeywords
# # [INFO] [2024-11-30T23:42:58] Instrument: all
# # [INFO] [2024-11-30T23:42:58] Stream no.: 0001
# # [INFO] [2024-11-30T23:42:58] Module version number: 2.09
# # [INFO] [2024-11-30T23:42:58] Getting ODS version from file\
#     /scratch/225753.1.all.q/xmm/ppsprod/228898/odf/0439_0032341201_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
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/P0032341201OBX000CALIND0000.FIT \
stringvalue="\"228898\" \"0439\" \"2024-12-01T00:42:27\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:42:58]
# # [INFO] [2024-11-30T23:42:58] Task Run Time addattribute 0.0304582118988037s
#
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
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/P0032341201OBX000ATTTSR0000.FIT \
stringvalue="\"228898\" \"0439\" \"2024-12-01T00:42:27\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:42:58]
# # [INFO] [2024-11-30T23:42:58] Task Run Time addattribute 0.025371789932251s
#
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
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/P0032341201OBX000ORBTSR0000.FIT \
stringvalue="\"228898\" \"0439\" \"2024-12-01T00:42:27\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:42:58]
# # [INFO] [2024-11-30T23:42:58] Task Run Time addattribute 0.0371952056884766s
#
# [COMMAND] [2024-11-30T23:42:58]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:42:58]
export SAS_RAND_SEED=0032341201
# # [INFO] [2024-11-30T23:42:58] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0032341201
# [COMMAND] [2024-11-30T23:42:58]
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/P0032341201OBX000RADMON0000.FIT \
stringvalue="\"228898\" \"0439\" \"2024-12-01T00:42:27\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"13.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:42:58]
# # [INFO] [2024-11-30T23:42:58] Task Run Time addattribute 0.0366671085357666s
#
# [COMMAND] [2024-11-30T23:42:58]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# [COMMAND] [2024-11-30T23:42:58]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
# [COMMAND] [2024-11-30T23:42:58]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:42:58] System RV 0
