
#!/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-21T07:02:45] Module name: VerifyODF
# # [INFO] [2024-11-21T07:02:45] Instrument: all
# # [INFO] [2024-11-21T07:02:45] Stream no.: 0001
# # [INFO] [2024-11-21T07:02:46] Module version number: 1.18
# # [INFO] [2024-11-21T07:02:46] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-21T07:02:46] Module name: MakeCIF
# # [INFO] [2024-11-21T07:02:46] Instrument: all
# # [INFO] [2024-11-21T07:02:46] Stream no.: 0001
# # [INFO] [2024-11-21T07:02:46] Module version number: 1.23
# # [INFO] [2024-11-21T07:02:46] Observation start defined as >2000-05-05T06:06:55.000<
# # [INFO] [2024-11-21T07:02:46] Processing date defined as >2024-11-21T08:02:45<
# [COMMAND] [2024-11-21T07:02:46]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:02:46]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:02:46] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:02:46]
cifbuild analysisdate=2024-11-21T08:02:45 calindexset=product/P0122510301OBX000CALIND0000.FIT fullpath=no \
observationdate=2000-05-05T06:06:55.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-21T07:03:10]
# # [INFO] [2024-11-21T07:03:10] Task Run Time cifbuild 24.841814994812s
#
# [COMMAND] [2024-11-21T07:03:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:10]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:10]
addattribute attributecomment="\"Telescope (mission) name\" \"Date observations were made\" \"RA of instrument pointing (degrees)\" \
\"Observation identifier\" \"Name of PI\" \"DEC of instrument pointing\" \"Date observations ended\" \"Name of observed object\" \
\"Observation mode (pointing or slew)\"" attributename="TELESCOP DATE-OBS RA_PNT OBS_ID OBSERVER DEC_PNT DATE-END OBJECT OBS_MODE" \
attributetype="string string real string string real string string string" realvalue="81.2500005 -69.6400000" \
set=product/P0122510301OBX000CALIND0000.FIT stringvalue="\"XMM\" \"2000-05-05T06:06:55.000\" \"0122510301\" \"Dr Fred Jansen\" \
\"2000-05-05T06:07:40.000\" \"N132D-n\" \"POINTED\"" -w 10
# # [OUTPUT] [2024-11-21T07:03:10]
# # [INFO] [2024-11-21T07:03:10] Task Run Time addattribute 0.0386769771575928s
#
# [COMMAND] [2024-11-21T07:03:10]
cp /scratch/182286.1.all.q/xmm/ppsprod/194782/product/P0122510301OBX000CALIND0000.FIT \
/scratch/182286.1.all.q/xmm/ppsprod/194782/intermediate/ccf.cif
# # [INFO] [2024-11-21T07:03:10] System RV 0
# # [INFO] [2024-11-21T07:03:10] Module name: GlobalHK
# # [INFO] [2024-11-21T07:03:10] Instrument: all
# # [INFO] [2024-11-21T07:03:10] Stream no.: 0001
# # [INFO] [2024-11-21T07:03:10] Module version number: 1.81
# [COMMAND] [2024-11-21T07:03:10]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:10]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:10] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:10]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-21T07:03:11] ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892626.184\
#     which is more than 20 s outside the period for which the attitude is known (closest time is -31 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892626.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -31 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892627.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -30 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892627.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -30 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892628.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -29 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892628.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -29 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892629.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -28 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892629.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -28 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892630.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -27 s away).
# ** preqgti::atthkgen: warning (NoAttitude), The attitude was requested for time 73892630.184 which is more than 20 s outside the\
#     period for which the attitude is known (closest time is -27 s away).
# ** preqgti: warning (SummaryOfWarnings), 
# warning NoAttitude silently occurred 18 times 
# # [INFO] [2024-11-21T07:03:11] Task Run Time preqgti 0.0964949131011963s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
atthkgen atthkset=product/P0122510301OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-21T07:03:11]
# # [INFO] [2024-11-21T07:03:11] Task Run Time atthkgen 0.0701940059661865s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
orbit outfile=product/P0122510301OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-21T07:03:11] orbit:- Output FITS Orbit timeseries: product/P0122510301OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-21T07:03:11] Task Run Time orbit 0.0338790416717529s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
radmonfix output=product/P0122510301OBX000RADMON0000.FIT radmonlist=odf/0074_0122510301_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-21T07:03:11] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198713.945 which\
#     is outside the time correlation data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198717.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198721.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198725.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198729.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198733.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198737.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198741.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198745.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=4198749.945 which is outside the time correlation\
#     data abscissa range [4200167.579, 4200831.595] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 713 times 
# # [INFO] [2024-11-21T07:03:11] Task Run Time radmonfix 0.0374050140380859s
#
# [COMMAND] [2024-11-21T07:03:11]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/182286.1.all.q/xmm/ppsprod/194782/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# # [INFO] [2024-11-21T07:03:11] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-21T07:03:11]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/182286.1.all.q/xmm/ppsprod/194782/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# [COMMAND] [2024-11-21T07:03:11]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/182286.1.all.q/xmm/ppsprod/194782/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# [COMMAND] [2024-11-21T07:03:11]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/182286.1.all.q/xmm/ppsprod/194782/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# # [INFO] [2024-11-21T07:03:11] Module name: ExpChooser
# # [INFO] [2024-11-21T07:03:11] Instrument: rgs1
# # [INFO] [2024-11-21T07:03:11] Stream no.: 0001
# # [INFO] [2024-11-21T07:03:11] Module version number: 1.38
# # [INFO] [2024-11-21T07:03:11] Checking exposure S001 for processability
# # [INFO] [2024-11-21T07:03:11] Exposure ignored due to lack of event files
# # [INFO] [2024-11-21T07:03:11] Module name: StampKeywords
# # [INFO] [2024-11-21T07:03:11] Instrument: all
# # [INFO] [2024-11-21T07:03:11] Stream no.: 0001
# # [INFO] [2024-11-21T07:03:11] Module version number: 2.09
# # [INFO] [2024-11-21T07:03:11] Getting ODS version from file\
#     /scratch/182286.1.all.q/xmm/ppsprod/194782/odf/0074_0122510301_SCX00000TCS.FIT
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
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/P0122510301OBX000CALIND0000.FIT \
stringvalue="\"194782\" \"0074\" \"2024-11-21T08:02:45\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"000\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-21T07:03:11]
# # [INFO] [2024-11-21T07:03:11] Task Run Time addattribute 0.0260570049285889s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
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/P0122510301OBX000ATTTSR0000.FIT \
stringvalue="\"194782\" \"0074\" \"2024-11-21T08:02:45\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"000\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-21T07:03:11]
# # [INFO] [2024-11-21T07:03:11] Task Run Time addattribute 0.0270848274230957s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
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/P0122510301OBX000ORBTSR0000.FIT \
stringvalue="\"194782\" \"0074\" \"2024-11-21T08:02:45\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"000\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-21T07:03:11]
# # [INFO] [2024-11-21T07:03:11] Task Run Time addattribute 0.0242700576782227s
#
# [COMMAND] [2024-11-21T07:03:11]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-21T07:03:11]
export SAS_RAND_SEED=0122510301
# # [INFO] [2024-11-21T07:03:11] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0122510301
# [COMMAND] [2024-11-21T07:03:11]
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/P0122510301OBX000RADMON0000.FIT \
stringvalue="\"194782\" \"0074\" \"2024-11-21T08:02:45\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"11.0.1\" \
\"XMM-Newton/SOC\" \"000\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-21T07:03:11]
# # [INFO] [2024-11-21T07:03:11] Task Run Time addattribute 0.0267999172210693s
#
# [COMMAND] [2024-11-21T07:03:11]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# [COMMAND] [2024-11-21T07:03:11]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
# [COMMAND] [2024-11-21T07:03:11]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-21T07:03:11] System RV 0
