
#!/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:47:32] Module name: VerifyODF
# # [INFO] [2024-11-30T23:47:32] Instrument: all
# # [INFO] [2024-11-30T23:47:32] Stream no.: 0001
# # [INFO] [2024-11-30T23:47:32] Module version number: 1.18
# # [INFO] [2024-11-30T23:47:32] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:47:33] Module name: MakeCIF
# # [INFO] [2024-11-30T23:47:33] Instrument: all
# # [INFO] [2024-11-30T23:47:33] Stream no.: 0001
# # [INFO] [2024-11-30T23:47:33] Module version number: 1.23
# # [INFO] [2024-11-30T23:47:33] Observation start defined as >2000-09-23T07:09:30.000<
# # [INFO] [2024-11-30T23:47:33] Processing date defined as >2024-12-01T00:47:32<
# [COMMAND] [2024-11-30T23:47:33]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:47:33]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:47:33] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:47:33]
cifbuild analysisdate=2024-12-01T00:47:32 calindexset=product/P0105261201OBX000CALIND0000.FIT fullpath=no \
observationdate=2000-09-23T07:09:30.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:48:05]
# # [INFO] [2024-11-30T23:48:05] Task Run Time cifbuild 32.3419609069824s
#
# [COMMAND] [2024-11-30T23:48:05]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:05]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:05] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:05]
addattribute attributecomment="\"Telescope (mission) name\" \"Date observations were made\" \"Name of PI\" \"Name of observed \
object\" \"Observation identifier\" \"Date observations ended\" \"DEC of instrument pointing\" \"RA of instrument pointing \
(degrees)\" \"Observation mode (pointing or slew)\"" attributename="TELESCOP DATE-OBS OBSERVER OBJECT OBS_ID DATE-END DEC_PNT RA_PNT \
OBS_MODE" attributetype="string string string string string string real real string" realvalue="-61.5672223 67.9041675" \
set=product/P0105261201OBX000CALIND0000.FIT stringvalue="\"XMM\" \"2000-09-23T07:09:30.000\" \"Dr Bernd Aschenbach\" \"A3266_f6\" \
\"0105261201\" \"2000-09-23T07:28:34.000\" \"POINTED\"" -w 10
# # [OUTPUT] [2024-11-30T23:48:05]
# # [INFO] [2024-11-30T23:48:05] Task Run Time addattribute 0.032459020614624s
#
# [COMMAND] [2024-11-30T23:48:05]
cp /scratch/226104.1.all.q/xmm/ppsprod/229249/product/P0105261201OBX000CALIND0000.FIT \
/scratch/226104.1.all.q/xmm/ppsprod/229249/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:48:05] System RV 0
# # [INFO] [2024-11-30T23:48:05] Module name: GlobalHK
# # [INFO] [2024-11-30T23:48:05] Instrument: all
# # [INFO] [2024-11-30T23:48:05] Stream no.: 0001
# # [INFO] [2024-11-30T23:48:05] Module version number: 1.81
# [COMMAND] [2024-11-30T23:48:05]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:05]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:05] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:05]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:48:06] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 86081412.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 86081412.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 86081413.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 86081413.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 86081414.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 86081414.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 86081415.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 86081415.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 86081416.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 86081416.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 43644 times 
# # [INFO] [2024-11-30T23:48:06] Task Run Time preqgti 0.833287000656128s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
atthkgen atthkset=product/P0105261201OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:48:06]
# # [INFO] [2024-11-30T23:48:06] Task Run Time atthkgen 0.0903348922729492s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
orbit outfile=product/P0105261201OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:48:06] orbit:- Output FITS Orbit timeseries: product/P0105261201OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:48:06] Task Run Time orbit 0.0972590446472168s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
radmonfix output=product/P0105261201OBX000RADMON0000.FIT radmonlist=odf/0145_0105261201_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:48:06] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317445.945 which\
#     is outside the time correlation data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317449.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317453.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317457.945 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317461.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317465.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317469.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317473.945 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317477.951 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=7317481.945 which is outside the time correlation\
#     data abscissa range [7318640.892, 7342274.688] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 1252 times 
# # [INFO] [2024-11-30T23:48:06] Task Run Time radmonfix 0.0801630020141602s
#
# [COMMAND] [2024-11-30T23:48:06]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/226104.1.all.q/xmm/ppsprod/229249/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# # [INFO] [2024-11-30T23:48:06] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:48:06]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/226104.1.all.q/xmm/ppsprod/229249/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# [COMMAND] [2024-11-30T23:48:06]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/226104.1.all.q/xmm/ppsprod/229249/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# [COMMAND] [2024-11-30T23:48:06]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/226104.1.all.q/xmm/ppsprod/229249/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# # [INFO] [2024-11-30T23:48:06] Module name: ExpChooser
# # [INFO] [2024-11-30T23:48:06] Instrument: om
# # [INFO] [2024-11-30T23:48:06] Stream no.: 0001
# # [INFO] [2024-11-30T23:48:06] Module version number: 1.38
# # [INFO] [2024-11-30T23:48:06] Checking exposure S400 for processability
# # [INFO] [2024-11-30T23:48:06] Filter: V
# # [INFO] [2024-11-30T23:48:06] Instrument mode: UNDEFINED
# # [INFO] [2024-11-30T23:48:06] Exposure duration: 1144
# # [INFO] [2024-11-30T23:48:06] OM datamode=
# # [INFO] [2024-11-30T23:48:06] Exposure ignored due to invalid or unsupported instrument mode
# # [INFO] [2024-11-30T23:48:06] Module name: StampKeywords
# # [INFO] [2024-11-30T23:48:06] Instrument: all
# # [INFO] [2024-11-30T23:48:06] Stream no.: 0001
# # [INFO] [2024-11-30T23:48:06] Module version number: 2.09
# # [INFO] [2024-11-30T23:48:06] Getting ODS version from file\
#     /scratch/226104.1.all.q/xmm/ppsprod/229249/odf/0145_0105261201_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
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/P0105261201OBX000CALIND0000.FIT \
stringvalue="\"229249\" \"0145\" \"2024-12-01T00:47:32\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"12.0.0\" \
\"XMM-Newton/SOC\" \"005\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:48:06]
# # [INFO] [2024-11-30T23:48:06] Task Run Time addattribute 0.0274078845977783s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
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/P0105261201OBX000ATTTSR0000.FIT \
stringvalue="\"229249\" \"0145\" \"2024-12-01T00:47:32\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"12.0.0\" \
\"XMM-Newton/SOC\" \"005\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:48:06]
# # [INFO] [2024-11-30T23:48:06] Task Run Time addattribute 0.0302481651306152s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
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/P0105261201OBX000ORBTSR0000.FIT \
stringvalue="\"229249\" \"0145\" \"2024-12-01T00:47:32\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"12.0.0\" \
\"XMM-Newton/SOC\" \"005\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:48:06]
# # [INFO] [2024-11-30T23:48:06] Task Run Time addattribute 0.0253000259399414s
#
# [COMMAND] [2024-11-30T23:48:06]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:48:06]
export SAS_RAND_SEED=0105261201
# # [INFO] [2024-11-30T23:48:06] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0105261201
# [COMMAND] [2024-11-30T23:48:06]
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/P0105261201OBX000RADMON0000.FIT \
stringvalue="\"229249\" \"0145\" \"2024-12-01T00:47:32\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"12.0.0\" \
\"XMM-Newton/SOC\" \"005\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:48:06]
# # [INFO] [2024-11-30T23:48:06] Task Run Time addattribute 0.0334999561309814s
#
# [COMMAND] [2024-11-30T23:48:06]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# [COMMAND] [2024-11-30T23:48:06]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
# [COMMAND] [2024-11-30T23:48:06]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:48:06] System RV 0
