
#!/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:49:49] Module name: VerifyODF
# # [INFO] [2024-11-30T23:49:49] Instrument: all
# # [INFO] [2024-11-30T23:49:49] Stream no.: 0001
# # [INFO] [2024-11-30T23:49:49] Module version number: 1.18
# # [INFO] [2024-11-30T23:49:49] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:49:49] Module name: MakeCIF
# # [INFO] [2024-11-30T23:49:49] Instrument: all
# # [INFO] [2024-11-30T23:49:49] Stream no.: 0001
# # [INFO] [2024-11-30T23:49:49] Module version number: 1.23
# # [INFO] [2024-11-30T23:49:49] Observation start defined as >2022-02-02T02:10:33.000<
# # [INFO] [2024-11-30T23:49:49] Processing date defined as >2024-12-01T00:49:49<
# [COMMAND] [2024-11-30T23:49:49]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:49:49]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:49:49] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:49:49]
cifbuild analysisdate=2024-12-01T00:49:49 calindexset=product/P0840140701OBX000CALIND0000.FIT fullpath=no \
observationdate=2022-02-02T02:10:33.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:50:17]
# # [INFO] [2024-11-30T23:50:17] Task Run Time cifbuild 28.0263140201569s
#
# [COMMAND] [2024-11-30T23:50:17]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:17]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:50:17] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:50:17]
addattribute attributecomment="\"Telescope (mission) name\" \"Observation identifier\" \"Date observations ended\" \"Observation \
mode (pointing or slew)\" \"Name of PI\" \"DEC of instrument pointing\" \"Name of observed object\" \"Date observations were made\" \
\"RA of instrument pointing (degrees)\"" attributename="TELESCOP OBS_ID DATE-END OBS_MODE OBSERVER DEC_PNT OBJECT DATE-OBS RA_PNT" \
attributetype="string string string string string real string string real" realvalue="\"40.3112778\" \"46.9492095\"" \
set=product/P0840140701OBX000CALIND0000.FIT stringvalue="\"XMM\" \"0840140701\" \"2022-02-02T03:20:48.000\" \"POINTED\" \"Dr Jon \
Miller\" \"AT2021ehb\" \"2022-02-02T02:10:33.000\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:17]
# # [INFO] [2024-11-30T23:50:17] Task Run Time addattribute 0.1127610206604s
#
# [COMMAND] [2024-11-30T23:50:17]
cp /scratch/226315.1.all.q/xmm/ppsprod/229460/product/P0840140701OBX000CALIND0000.FIT \
/scratch/226315.1.all.q/xmm/ppsprod/229460/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:50:17] System RV 0
# # [INFO] [2024-11-30T23:50:17] Module name: GlobalHK
# # [INFO] [2024-11-30T23:50:17] Instrument: all
# # [INFO] [2024-11-30T23:50:17] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:17] Module version number: 1.81
# [COMMAND] [2024-11-30T23:50:17]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:17]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:50:17] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:50:17]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:50:18] ** preqgti: warning (TemporalOverlapInAHF), Temporal overlap of 0.490002s between AHF entries 137\
#     (2022-02-02T02:03:48.999) and 138 (2022-02-02T02:04:29.000) - adjusting duration of entry 137 accordingly
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154697.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -41 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154697.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -41 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154698.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -40 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154698.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -40 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154699.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -39 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154699.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -39 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154700.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -38 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154700.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -38 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154701.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -37 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 760154701.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -37 s away).
# ** preqgti: warning (SummaryOfWarnings), 
# warning NoAttitude silently occurred 38 times 
# # [INFO] [2024-11-30T23:50:18] Task Run Time preqgti 0.759934902191162s
#
# [COMMAND] [2024-11-30T23:50:18]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:18]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:50:18] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:50:18]
atthkgen atthkset=product/P0840140701OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:50:18]
# # [INFO] [2024-11-30T23:50:18] Task Run Time atthkgen 0.291603088378906s
#
# [COMMAND] [2024-11-30T23:50:18]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:18]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:50:18] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:50:18]
orbit outfile=product/P0840140701OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:50:18] orbit:- Output FITS Orbit timeseries: product/P0840140701OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:50:18] Task Run Time orbit 0.238189935684204s
#
# [COMMAND] [2024-11-30T23:50:18]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:18]
export SAS_RAND_SEED=0840140701
# # [INFO] [2024-11-30T23:50:18] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0840140701
# [COMMAND] [2024-11-30T23:50:18]
radmonfix output=product/P0840140701OBX000RADMON0000.FIT radmonlist=odf/4057_0840140701_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:50:18] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448121.9 which\
#     is outside the time correlation data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448125.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448129.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448133.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448137.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448141.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448145.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448149.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448153.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=231448157.9 which is outside the time correlation\
#     data abscissa range [231441859.2, 231448018.6] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 75 times 
# # [INFO] [2024-11-30T23:50:18] Task Run Time radmonfix 0.105998039245605s
#
# [COMMAND] [2024-11-30T23:50:18]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/226315.1.all.q/xmm/ppsprod/229460/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:18] System RV 0
# # [INFO] [2024-11-30T23:50:18] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:50:18]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/226315.1.all.q/xmm/ppsprod/229460/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:18] System RV 0
# [COMMAND] [2024-11-30T23:50:18]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/226315.1.all.q/xmm/ppsprod/229460/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:18] System RV 0
# [COMMAND] [2024-11-30T23:50:18]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/226315.1.all.q/xmm/ppsprod/229460/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:18] System RV 0
# # [INFO] [2024-11-30T23:50:18] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:18] Instrument: emos1
# # [INFO] [2024-11-30T23:50:18] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:18] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:18] Checking exposure S001 for processability
# # [INFO] [2024-11-30T23:50:18] Filter: CalClosed
# # [INFO] [2024-11-30T23:50:18] Instrument mode: PrimeFullWindow
# # [INFO] [2024-11-30T23:50:18] Exposure duration: 4207
# # [INFO] [2024-11-30T23:50:18] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:50:18] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:18] Instrument: emos2
# # [INFO] [2024-11-30T23:50:18] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:18] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:18] Checking exposure S002 for processability
# # [INFO] [2024-11-30T23:50:18] Filter: CalClosed
# # [INFO] [2024-11-30T23:50:18] Instrument mode: PrimeFullWindow
# # [INFO] [2024-11-30T23:50:18] Exposure duration: 4193
# # [INFO] [2024-11-30T23:50:18] Exposure ignored due to invalid or unsupported filter
