
#!/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:45:49] Module name: VerifyODF
# # [INFO] [2024-11-30T23:45:49] Instrument: all
# # [INFO] [2024-11-30T23:45:49] Stream no.: 0001
# # [INFO] [2024-11-30T23:45:49] Module version number: 1.18
# # [INFO] [2024-11-30T23:45:49] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:45:49] Module name: MakeCIF
# # [INFO] [2024-11-30T23:45:49] Instrument: all
# # [INFO] [2024-11-30T23:45:49] Stream no.: 0001
# # [INFO] [2024-11-30T23:45:49] Module version number: 1.23
# # [INFO] [2024-11-30T23:45:49] Observation start defined as >2000-07-03T03:33:08.000<
# # [INFO] [2024-11-30T23:45:49] Processing date defined as >2024-12-01T00:45:49<
# [COMMAND] [2024-11-30T23:45:49]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:45:49]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:45:49] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:45:49]
cifbuild analysisdate=2024-12-01T00:45:49 calindexset=product/P0127120101OBX000CALIND0000.FIT fullpath=no \
observationdate=2000-07-03T03:33:08.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:46:18]
# # [INFO] [2024-11-30T23:46:18] Task Run Time cifbuild 28.8761451244354s
#
# [COMMAND] [2024-11-30T23:46:18]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:18]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:18] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:18]
addattribute attributecomment="\"Telescope (mission) name\" \"Name of observed object\" \"DEC of instrument pointing\" \"Observation \
mode (pointing or slew)\" \"Date observations were made\" \"Name of PI\" \"Date observations ended\" \"Observation identifier\" \"RA \
of instrument pointing (degrees)\"" attributename="TELESCOP OBJECT DEC_PNT OBS_MODE DATE-OBS OBSERVER DATE-END OBS_ID RA_PNT" \
attributetype="string string real string string string string string real" realvalue="\"0.0000000\" \"0\"" \
set=product/P0127120101OBX000CALIND0000.FIT stringvalue="\"XMM\" \"ENGINEERING\" \"POINTED\" \"2000-07-03T03:33:08.000\" \"Dr Fred \
Jansen\" \"2000-07-03T05:20:45.000\" \"0127120101\"" -w 10
# # [OUTPUT] [2024-11-30T23:46:18]
# # [INFO] [2024-11-30T23:46:18] Task Run Time addattribute 0.0330109596252441s
#
# [COMMAND] [2024-11-30T23:46:18]
cp /scratch/225951.1.all.q/xmm/ppsprod/229096/product/P0127120101OBX000CALIND0000.FIT \
/scratch/225951.1.all.q/xmm/ppsprod/229096/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:46:18] System RV 0
# # [INFO] [2024-11-30T23:46:18] Module name: GlobalHK
# # [INFO] [2024-11-30T23:46:18] Instrument: all
# # [INFO] [2024-11-30T23:46:18] Stream no.: 0001
# # [INFO] [2024-11-30T23:46:18] Module version number: 1.81
# [COMMAND] [2024-11-30T23:46:18]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:18]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:18] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:18]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:46:19] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 78988954.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 78988954.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 78988955.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 78988955.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 78988956.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 78988956.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 78988957.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 78988957.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 78988958.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 78988958.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 13850 times 
# # [INFO] [2024-11-30T23:46:19] Task Run Time preqgti 0.590559005737305s
#
# [COMMAND] [2024-11-30T23:46:19]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:19]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:19] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:19]
atthkgen atthkset=product/P0127120101OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:46:19]
# # [INFO] [2024-11-30T23:46:19] Task Run Time atthkgen 0.163663864135742s
#
# [COMMAND] [2024-11-30T23:46:19]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:19]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:19] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:19]
orbit outfile=product/P0127120101OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:46:19] orbit:- Output FITS Orbit timeseries: product/P0127120101OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:46:19] Task Run Time orbit 0.208616971969604s
#
# [COMMAND] [2024-11-30T23:46:19]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:19]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:19] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:19]
radmonfix output=product/P0127120101OBX000RADMON0000.FIT radmonlist=odf/0104_0127120101_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:46:19] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220137.9451 which\
#     is outside the time correlation data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220141.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220145.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220149.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220153.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220157.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220161.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220165.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220169.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=220173.9451 which is outside the time correlation\
#     data abscissa range [220742.4541, 228145.0401] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 1162 times 
# # [INFO] [2024-11-30T23:46:19] Task Run Time radmonfix 0.0641069412231445s
#
# [COMMAND] [2024-11-30T23:46:19]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/225951.1.all.q/xmm/ppsprod/229096/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:19] System RV 0
# # [INFO] [2024-11-30T23:46:19] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:46:19]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/225951.1.all.q/xmm/ppsprod/229096/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:19] System RV 0
# [COMMAND] [2024-11-30T23:46:19]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/225951.1.all.q/xmm/ppsprod/229096/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:19] System RV 0
# [COMMAND] [2024-11-30T23:46:19]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/225951.1.all.q/xmm/ppsprod/229096/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:19] System RV 0
# # [INFO] [2024-11-30T23:46:20] Module name: ExpChooser
# # [INFO] [2024-11-30T23:46:20] Instrument: om
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0001
# # [INFO] [2024-11-30T23:46:20] Module version number: 1.38
# # [INFO] [2024-11-30T23:46:20] Checking exposure S400 for processability
# # [INFO] [2024-11-30T23:46:20] Filter: UNDEFINED
# # [INFO] [2024-11-30T23:46:20] Instrument mode: Image
# # [INFO] [2024-11-30T23:46:20] Exposure duration: 999
# # [INFO] [2024-11-30T23:46:20] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:46:20] Module name: ExpChooser
# # [INFO] [2024-11-30T23:46:20] Instrument: om
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0002
# # [INFO] [2024-11-30T23:46:20] Module version number: 1.38
# # [INFO] [2024-11-30T23:46:20] Checking exposure S401 for processability
# # [INFO] [2024-11-30T23:46:20] Filter: UNDEFINED
# # [INFO] [2024-11-30T23:46:20] Instrument mode: Image
# # [INFO] [2024-11-30T23:46:20] Exposure duration: 999
# # [INFO] [2024-11-30T23:46:20] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:46:20] Module name: ExpChooser
# # [INFO] [2024-11-30T23:46:20] Instrument: om
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0003
# # [INFO] [2024-11-30T23:46:20] Module version number: 1.38
# # [INFO] [2024-11-30T23:46:20] Checking exposure S402 for processability
# # [INFO] [2024-11-30T23:46:20] Filter: UNDEFINED
# # [INFO] [2024-11-30T23:46:20] Instrument mode: Image
# # [INFO] [2024-11-30T23:46:20] Exposure duration: 1001
# # [INFO] [2024-11-30T23:46:20] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:46:20] Module name: ExpChooser
# # [INFO] [2024-11-30T23:46:20] Instrument: om
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0004
# # [INFO] [2024-11-30T23:46:20] Module version number: 1.38
# # [INFO] [2024-11-30T23:46:20] Checking exposure S403 for processability
# # [INFO] [2024-11-30T23:46:20] Filter: UNDEFINED
# # [INFO] [2024-11-30T23:46:20] Instrument mode: Image
# # [INFO] [2024-11-30T23:46:20] Exposure duration: 1002
# # [INFO] [2024-11-30T23:46:20] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:46:20] Module name: ExpChooser
# # [INFO] [2024-11-30T23:46:20] Instrument: om
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0005
# # [INFO] [2024-11-30T23:46:20] Module version number: 1.38
# # [INFO] [2024-11-30T23:46:20] Checking exposure S404 for processability
# # [INFO] [2024-11-30T23:46:20] Filter: UNDEFINED
# # [INFO] [2024-11-30T23:46:20] Instrument mode: Image
# # [INFO] [2024-11-30T23:46:20] Exposure duration: 1000
# # [INFO] [2024-11-30T23:46:20] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:46:20] Module name: StampKeywords
# # [INFO] [2024-11-30T23:46:20] Instrument: all
# # [INFO] [2024-11-30T23:46:20] Stream no.: 0001
# # [INFO] [2024-11-30T23:46:20] Module version number: 2.09
# # [INFO] [2024-11-30T23:46:20] Getting ODS version from file\
#     /scratch/225951.1.all.q/xmm/ppsprod/229096/odf/0104_0127120101_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:46:20]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:20]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:20] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:20]
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/P0127120101OBX000CALIND0000.FIT \
stringvalue="\"229096\" \"0104\" \"2024-12-01T00:45:49\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"005\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:46:20]
# # [INFO] [2024-11-30T23:46:20] Task Run Time addattribute 0.031836986541748s
#
# [COMMAND] [2024-11-30T23:46:20]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:20]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:20] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:20]
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/P0127120101OBX000ATTTSR0000.FIT \
stringvalue="\"229096\" \"0104\" \"2024-12-01T00:45:49\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"005\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:46:20]
# # [INFO] [2024-11-30T23:46:20] Task Run Time addattribute 0.0305089950561523s
#
# [COMMAND] [2024-11-30T23:46:20]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:20]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:20] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:20]
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/P0127120101OBX000ORBTSR0000.FIT \
stringvalue="\"229096\" \"0104\" \"2024-12-01T00:45:49\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"005\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:46:20]
# # [INFO] [2024-11-30T23:46:20] Task Run Time addattribute 0.0597000122070312s
#
# [COMMAND] [2024-11-30T23:46:20]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:46:20]
export SAS_RAND_SEED=0127120101
# # [INFO] [2024-11-30T23:46:20] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0127120101
# [COMMAND] [2024-11-30T23:46:20]
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/P0127120101OBX000RADMON0000.FIT \
stringvalue="\"229096\" \"0104\" \"2024-12-01T00:45:49\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"005\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:46:20]
# # [INFO] [2024-11-30T23:46:20] Task Run Time addattribute 0.0449309349060059s
#
# [COMMAND] [2024-11-30T23:46:20]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:20] System RV 0
# [COMMAND] [2024-11-30T23:46:20]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:20] System RV 0
# [COMMAND] [2024-11-30T23:46:20]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:46:20] System RV 0
