
#!/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:37:01] Module name: VerifyODF
# # [INFO] [2024-11-30T23:37:01] Instrument: all
# # [INFO] [2024-11-30T23:37:01] Stream no.: 0001
# # [INFO] [2024-11-30T23:37:01] Module version number: 1.18
# # [INFO] [2024-11-30T23:37:01] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:37:01] Module name: MakeCIF
# # [INFO] [2024-11-30T23:37:01] Instrument: all
# # [INFO] [2024-11-30T23:37:01] Stream no.: 0001
# # [INFO] [2024-11-30T23:37:01] Module version number: 1.23
# # [INFO] [2024-11-30T23:37:01] Observation start defined as >2022-01-31T02:19:20.000<
# # [INFO] [2024-11-30T23:37:01] Processing date defined as >2024-12-01T00:37:01<
# [COMMAND] [2024-11-30T23:37:01]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:01]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:01] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:01]
cifbuild analysisdate=2024-12-01T00:37:01 calindexset=product/P0840140501OBX000CALIND0000.FIT fullpath=no \
observationdate=2022-01-31T02:19:20.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:37:29]
# # [INFO] [2024-11-30T23:37:29] Task Run Time cifbuild 28.0027389526367s
#
# [COMMAND] [2024-11-30T23:37:29]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:29]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:29] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:29]
addattribute attributecomment="\"Telescope (mission) name\" \"Date observations ended\" \"Date observations were made\" \"DEC of \
instrument pointing\" \"Name of PI\" \"Name of observed object\" \"RA of instrument pointing (degrees)\" \"Observation identifier\" \
\"Observation mode (pointing or slew)\"" attributename="TELESCOP DATE-END DATE-OBS DEC_PNT OBSERVER OBJECT RA_PNT OBS_ID OBS_MODE" \
attributetype="string string string real string string real string string" realvalue="\"40.3112778\" \"46.9492095\"" \
set=product/P0840140501OBX000CALIND0000.FIT stringvalue="\"XMM\" \"2022-01-31T03:29:50.000\" \"2022-01-31T02:19:20.000\" \"Dr Jon \
Miller\" \"AT2021ehb\" \"0840140501\" \"POINTED\"" -w 10
# # [OUTPUT] [2024-11-30T23:37:29]
# # [INFO] [2024-11-30T23:37:29] Task Run Time addattribute 0.0695099830627441s
#
# [COMMAND] [2024-11-30T23:37:29]
cp /scratch/225520.1.all.q/xmm/ppsprod/228666/product/P0840140501OBX000CALIND0000.FIT \
/scratch/225520.1.all.q/xmm/ppsprod/228666/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:37:29] System RV 0
# # [INFO] [2024-11-30T23:37:29] Module name: GlobalHK
# # [INFO] [2024-11-30T23:37:29] Instrument: all
# # [INFO] [2024-11-30T23:37:29] Stream no.: 0001
# # [INFO] [2024-11-30T23:37:29] Module version number: 1.81
# [COMMAND] [2024-11-30T23:37:29]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:29]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:29] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:29]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:37:30] ** preqgti: warning (TemporalOverlapInAHF), Temporal overlap of 0.490002s between AHF entries 143\
#     (2022-01-31T02:12:35.999) and 144 (2022-01-31T02:13:16.000) - adjusting duration of entry 143 accordingly
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 759987972.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 759987972.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 759987973.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 759987973.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 759987974.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 759987974.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 759987975.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 759987975.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 759987976.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 759987976.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 42494 times 
# # [INFO] [2024-11-30T23:37:30] Task Run Time preqgti 0.888478994369507s
#
# [COMMAND] [2024-11-30T23:37:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:30]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:30]
atthkgen atthkset=product/P0840140501OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:37:31]
# # [INFO] [2024-11-30T23:37:31] Task Run Time atthkgen 0.163548946380615s
#
# [COMMAND] [2024-11-30T23:37:31]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:31]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:31] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:31]
orbit outfile=product/P0840140501OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:37:31] orbit:- Output FITS Orbit timeseries: product/P0840140501OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:37:31] Task Run Time orbit 0.164213895797729s
#
# [COMMAND] [2024-11-30T23:37:31]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:37:31]
export SAS_RAND_SEED=0840140501
# # [INFO] [2024-11-30T23:37:31] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140501
# [COMMAND] [2024-11-30T23:37:31]
radmonfix output=product/P0840140501OBX000RADMON0000.FIT radmonlist=odf/4056_0840140501_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:37:31] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275873.9 which\
#     is outside the time correlation data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with\
#     large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275877.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275881.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275885.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275889.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275893.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275897.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275901.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275905.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231275909.9 which is outside the time correlation\
#     data abscissa range [231269594, 231275771.9] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 454 times 
# # [INFO] [2024-11-30T23:37:31] Task Run Time radmonfix 0.105525016784668s
#
# [COMMAND] [2024-11-30T23:37:31]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/225520.1.all.q/xmm/ppsprod/228666/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:37:31] System RV 0
# # [INFO] [2024-11-30T23:37:31] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:37:31]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/225520.1.all.q/xmm/ppsprod/228666/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:37:31] System RV 0
# [COMMAND] [2024-11-30T23:37:31]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/225520.1.all.q/xmm/ppsprod/228666/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:37:31] System RV 0
# [COMMAND] [2024-11-30T23:37:31]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/225520.1.all.q/xmm/ppsprod/228666/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:37:31] System RV 0
# # [INFO] [2024-11-30T23:37:31] Module name: ExpChooser
# # [INFO] [2024-11-30T23:37:31] Instrument: emos1
# # [INFO] [2024-11-30T23:37:31] Stream no.: 0001
# # [INFO] [2024-11-30T23:37:31] Module version number: 1.38
# # [INFO] [2024-11-30T23:37:31] Checking exposure S001 for processability
# # [INFO] [2024-11-30T23:37:31] Filter: CalClosed
# # [INFO] [2024-11-30T23:37:31] Instrument mode: PrimeFullWindow
# # [INFO] [2024-11-30T23:37:31] Exposure duration: 4230
# # [INFO] [2024-11-30T23:37:31] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:37:31] Module name: ExpChooser
# # [INFO] [2024-11-30T23:37:31] Instrument: emos2
# # [INFO] [2024-11-30T23:37:31] Stream no.: 0001
# # [INFO] [2024-11-30T23:37:31] Module version number: 1.38
# # [INFO] [2024-11-30T23:37:31] Checking exposure S002 for processability
# # [INFO] [2024-11-30T23:37:31] Filter: CalClosed
# # [INFO] [2024-11-30T23:37:31] Instrument mode: PrimeFullWindow
# # [INFO] [2024-11-30T23:37:31] Exposure duration: 4209
# # [INFO] [2024-11-30T23:37:31] Exposure ignored due to invalid or unsupported filter
