
#!/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:59] Module name: VerifyODF
# # [INFO] [2024-11-30T23:49:59] Instrument: all
# # [INFO] [2024-11-30T23:49:59] Stream no.: 0001
# # [INFO] [2024-11-30T23:49:59] Module version number: 1.18
# # [INFO] [2024-11-30T23:49:59] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:49:59] Module name: MakeCIF
# # [INFO] [2024-11-30T23:49:59] Instrument: all
# # [INFO] [2024-11-30T23:49:59] Stream no.: 0001
# # [INFO] [2024-11-30T23:49:59] Module version number: 1.23
# # [INFO] [2024-11-30T23:49:59] Observation start defined as >2000-02-06T13:32:12.000<
# # [INFO] [2024-11-30T23:49:59] Processing date defined as >2024-12-01T00:49:59<
# [COMMAND] [2024-11-30T23:49:59]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:49:59]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:49:59] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:49:59]
cifbuild analysisdate=2024-12-01T00:49:59 calindexset=product/P0116711001OBX000CALIND0000.FIT fullpath=no \
observationdate=2000-02-06T13:32:12.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:50:27]
# # [INFO] [2024-11-30T23:50:27] Task Run Time cifbuild 27.7401871681213s
#
# [COMMAND] [2024-11-30T23:50:27]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:27]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:27] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:27]
addattribute attributecomment="\"Telescope (mission) name\" \"Name of PI\" \"Name of observed object\" \"Observation identifier\" \
\"Date observations ended\" \"DEC of instrument pointing\" \"Date observations were made\" \"Observation mode (pointing or slew)\" \
\"RA of instrument pointing (degrees)\"" attributename="TELESCOP OBSERVER OBJECT OBS_ID DATE-END DEC_PNT DATE-OBS OBS_MODE RA_PNT" \
attributetype="string string string string string real string string real" realvalue="\"0.5899722\" \"54.197208\"" \
set=product/P0116711001OBX000CALIND0000.FIT stringvalue="\"XMM\" \"Mr Fred Jansen XMM-Newton PS\" \"HR1099\" \"0116711001\" \
\"2000-02-06T14:04:42.000\" \"2000-02-06T13:32:12.000\" \"POINTED\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:27]
# # [INFO] [2024-11-30T23:50:27] Task Run Time addattribute 0.0550069808959961s
#
# [COMMAND] [2024-11-30T23:50:27]
cp /scratch/226320.1.all.q/xmm/ppsprod/229465/product/P0116711001OBX000CALIND0000.FIT \
/scratch/226320.1.all.q/xmm/ppsprod/229465/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:50:27] System RV 0
# # [INFO] [2024-11-30T23:50:27] Module name: GlobalHK
# # [INFO] [2024-11-30T23:50:27] Instrument: all
# # [INFO] [2024-11-30T23:50:27] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:27] Module version number: 1.81
# [COMMAND] [2024-11-30T23:50:27]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:27]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:27] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:27]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:50:30] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234081.184\
#     which is more than 20 s outside the period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234081.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234082.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234082.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234083.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234083.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234084.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234084.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 20.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234085.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21.9999999925 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 66234085.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is 21.9999999925 s away).
# ** preqgti: warning (SummaryOfWarnings), 
# warning NoAttitude silently occurred 131800 times 
# # [INFO] [2024-11-30T23:50:30] Task Run Time preqgti 2.59854888916016s
#
# [COMMAND] [2024-11-30T23:50:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:30]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:30]
atthkgen atthkset=product/P0116711001OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:50:30]
# # [INFO] [2024-11-30T23:50:30] Task Run Time atthkgen 0.170802116394043s
#
# [COMMAND] [2024-11-30T23:50:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:30]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:30]
orbit outfile=product/P0116711001OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:50:30] orbit:- Output FITS Orbit timeseries: product/P0116711001OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:50:30] Task Run Time orbit 0.210515975952148s
#
# [COMMAND] [2024-11-30T23:50:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:30]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:30]
radmonfix output=product/P0116711001OBX000RADMON0000.FIT radmonlist=odf/0030_0116711001_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:50:30] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025918.858 which\
#     is outside the time correlation data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025922.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025926.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025930.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025934.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025938.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025942.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025946.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025950.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=5025954.858 which is outside the time correlation\
#     data abscissa range [5027196.059, 5037489.926] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 517 times 
# # [INFO] [2024-11-30T23:50:30] Task Run Time radmonfix 0.116472959518433s
#
# [COMMAND] [2024-11-30T23:50:30]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/226320.1.all.q/xmm/ppsprod/229465/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:30] System RV 0
# # [INFO] [2024-11-30T23:50:30] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:50:30]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/226320.1.all.q/xmm/ppsprod/229465/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:30] System RV 0
# [COMMAND] [2024-11-30T23:50:30]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/226320.1.all.q/xmm/ppsprod/229465/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:30] System RV 0
# [COMMAND] [2024-11-30T23:50:30]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/226320.1.all.q/xmm/ppsprod/229465/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:30] System RV 0
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0007
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S405 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0008
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S406 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0009
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S407 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S001 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0002
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S400 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0003
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S401 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0004
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S402 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0005
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S403 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: ExpChooser
# # [INFO] [2024-11-30T23:50:30] Instrument: rgs1
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0006
# # [INFO] [2024-11-30T23:50:30] Module version number: 1.38
# # [INFO] [2024-11-30T23:50:30] Checking exposure S404 for processability
# # [INFO] [2024-11-30T23:50:30] Exposure ignored due to lack of event files
# # [INFO] [2024-11-30T23:50:30] Module name: StampKeywords
# # [INFO] [2024-11-30T23:50:30] Instrument: all
# # [INFO] [2024-11-30T23:50:30] Stream no.: 0001
# # [INFO] [2024-11-30T23:50:30] Module version number: 2.09
# # [INFO] [2024-11-30T23:50:30] Getting ODS version from file\
#     /scratch/226320.1.all.q/xmm/ppsprod/229465/odf/0030_0116711001_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:50:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:30]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:30]
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/P0116711001OBX000CALIND0000.FIT \
stringvalue="\"229465\" \"0030\" \"2024-12-01T00:49:59\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:30]
# # [INFO] [2024-11-30T23:50:30] Task Run Time addattribute 0.0485169887542725s
#
# [COMMAND] [2024-11-30T23:50:30]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:30]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:30] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:30]
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/P0116711001OBX000ATTTSR0000.FIT \
stringvalue="\"229465\" \"0030\" \"2024-12-01T00:49:59\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:31]
# # [INFO] [2024-11-30T23:50:31] Task Run Time addattribute 0.0452959537506104s
#
# [COMMAND] [2024-11-30T23:50:31]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:31]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:31] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:31]
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/P0116711001OBX000ORBTSR0000.FIT \
stringvalue="\"229465\" \"0030\" \"2024-12-01T00:49:59\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:31]
# # [INFO] [2024-11-30T23:50:31] Task Run Time addattribute 0.0481781959533691s
#
# [COMMAND] [2024-11-30T23:50:31]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:50:31]
export SAS_RAND_SEED=0116711001
# # [INFO] [2024-11-30T23:50:31] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0116711001
# [COMMAND] [2024-11-30T23:50:31]
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/P0116711001OBX000RADMON0000.FIT \
stringvalue="\"229465\" \"0030\" \"2024-12-01T00:49:59\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.1.0\" \
\"XMM-Newton/SOC\" \"004\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:50:31]
# # [INFO] [2024-11-30T23:50:31] Task Run Time addattribute 0.064971923828125s
#
# [COMMAND] [2024-11-30T23:50:31]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:31] System RV 0
# [COMMAND] [2024-11-30T23:50:31]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:31] System RV 0
# [COMMAND] [2024-11-30T23:50:31]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:50:31] System RV 0
