
#!/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:34:54] Module name: VerifyODF
# # [INFO] [2024-11-30T23:34:54] Instrument: all
# # [INFO] [2024-11-30T23:34:54] Stream no.: 0001
# # [INFO] [2024-11-30T23:34:54] Module version number: 1.18
# # [INFO] [2024-11-30T23:34:54] Version of odfingest used was 3.33.1
# # [INFO] [2024-11-30T23:34:54] Module name: MakeCIF
# # [INFO] [2024-11-30T23:34:54] Instrument: all
# # [INFO] [2024-11-30T23:34:54] Stream no.: 0001
# # [INFO] [2024-11-30T23:34:54] Module version number: 1.23
# # [INFO] [2024-11-30T23:34:54] Observation start defined as >2003-06-05T17:44:01.000<
# # [INFO] [2024-11-30T23:34:54] Processing date defined as >2024-12-01T00:34:54<
# [COMMAND] [2024-11-30T23:34:54]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:34:54]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:34:54] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:34:54]
cifbuild analysisdate=2024-12-01T00:34:54 calindexset=product/P0148961101OBX000CALIND0000.FIT fullpath=no \
observationdate=2003-06-05T17:44:01.000 withccfpath=no -w 10
# # [OUTPUT] [2024-11-30T23:35:22]
# # [INFO] [2024-11-30T23:35:22] Task Run Time cifbuild 27.613664150238s
#
# [COMMAND] [2024-11-30T23:35:22]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:22]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:22] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:22]
addattribute attributecomment="\"Telescope (mission) name\" \"Observation identifier\" \"Date observations ended\" \"RA of \
instrument pointing (degrees)\" \"Date observations were made\" \"Name of observed object\" \"DEC of instrument pointing\" \
\"Observation mode (pointing or slew)\" \"Name of PI\"" attributename="TELESCOP OBS_ID DATE-END RA_PNT DATE-OBS OBJECT DEC_PNT \
OBS_MODE OBSERVER" attributetype="string string string real string string real string string" realvalue="8.4583335 -43.3166667" \
set=product/P0148961101OBX000CALIND0000.FIT stringvalue="\"XMM\" \"0148961101\" \"2003-06-05T17:54:55.000\" \
\"2003-06-05T17:44:01.000\" \"ELAIS-S1-C\" \"POINTED\" \"Prof Fabrizio Fiore\"" -w 10
# # [OUTPUT] [2024-11-30T23:35:22]
# # [INFO] [2024-11-30T23:35:22] Task Run Time addattribute 0.0959570407867432s
#
# [COMMAND] [2024-11-30T23:35:22]
cp /scratch/225459.1.all.q/xmm/ppsprod/228605/product/P0148961101OBX000CALIND0000.FIT \
/scratch/225459.1.all.q/xmm/ppsprod/228605/intermediate/ccf.cif
# # [INFO] [2024-11-30T23:35:22] System RV 0
# # [INFO] [2024-11-30T23:35:22] Module name: GlobalHK
# # [INFO] [2024-11-30T23:35:22] Instrument: all
# # [INFO] [2024-11-30T23:35:22] Stream no.: 0001
# # [INFO] [2024-11-30T23:35:22] Module version number: 1.81
# [COMMAND] [2024-11-30T23:35:22]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:22]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:22] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:22]
preqgti preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time preqgti 1.03825497627258s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
atthkgen atthkset=product/P0148961101OBX000ATTTSR0000.FIT preqgtifile=intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits \
timestep=1 withpreqgti=no -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time atthkgen 0.0725469589233398s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
orbit outfile=product/P0148961101OBX000ORBTSR0000.FIT timestep=1 useobsid=yes -w 10
# # [OUTPUT] [2024-11-30T23:35:23] orbit:- Output FITS Orbit timeseries: product/P0148961101OBX000ORBTSR0000.FIT
# orbit:- Binsize (timestep) of output): 1
# orbit:- Use OBSID data or whole orbit? T 
# # [INFO] [2024-11-30T23:35:23] Task Run Time orbit 0.071850061416626s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
radmonfix output=product/P0148961101OBX000RADMON0000.FIT radmonlist=odf/0639_0148961101_RMX00100ECX.FIT withoutputfile=yes -w 10
# # [OUTPUT] [2024-11-30T23:35:23] ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408265.95 which\
#     is outside the time correlation data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted\
#     with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408269.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408273.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408277.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408281.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408285.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408289.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408293.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408297.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# ** radmonfix: warning (Extrapolation), Evaluating OBT-MET fit polynomial at x=92408301.95 which is outside the time correlation\
#     data abscissa range [92457282.75, 92464803.45] - result of extrapolation might be afflicted with large numerical uncertainty.
# radmonfix:- Setting DATE-END...
# ** radmonfix: warning (SummaryOfWarnings), 
# warning Extrapolation silently occurred 248 times 
# # [INFO] [2024-11-30T23:35:23] Task Run Time radmonfix 0.0822868347167969s
#
# [COMMAND] [2024-11-30T23:35:23]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/EPICModes.fits \
/scratch/225459.1.all.q/xmm/ppsprod/228605/intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# # [INFO] [2024-11-30T23:35:23] Copied EPIC Observing modes table, Pileup data and OoT data table in place
# [COMMAND] [2024-11-30T23:35:23]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfs.fits \
/scratch/225459.1.all.q/xmm/ppsprod/228605/intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# [COMMAND] [2024-11-30T23:35:23]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/ecfgrid.fits.gz \
/scratch/225459.1.all.q/xmm/ppsprod/228605/intermediate/GlobalHK-all-1-Energy_Conversion_Factors_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# [COMMAND] [2024-11-30T23:35:23]
cp /lhome/jperea/ppsdev/pcms3/src/pipeline/etc/fluxgrid.fits.gz \
/scratch/225459.1.all.q/xmm/ppsprod/228605/intermediate/GlobalHK-all-1-Flux_Grid-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# # [INFO] [2024-11-30T23:35:23] Module name: ExpChooser
# # [INFO] [2024-11-30T23:35:23] Instrument: om
# # [INFO] [2024-11-30T23:35:23] Stream no.: 0001
# # [INFO] [2024-11-30T23:35:23] Module version number: 1.38
# # [INFO] [2024-11-30T23:35:23] Checking exposure S001 for processability
# # [INFO] [2024-11-30T23:35:23] Filter: Blocked
# # [INFO] [2024-11-30T23:35:23] Instrument mode: CentroidingData
# # [INFO] [2024-11-30T23:35:23] Exposure duration: 301
# # [INFO] [2024-11-30T23:35:23] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:35:23] Module name: ExpChooser
# # [INFO] [2024-11-30T23:35:23] Instrument: om
# # [INFO] [2024-11-30T23:35:23] Stream no.: 0002
# # [INFO] [2024-11-30T23:35:23] Module version number: 1.38
# # [INFO] [2024-11-30T23:35:23] Checking exposure S400 for processability
# # [INFO] [2024-11-30T23:35:23] Filter: Blocked
# # [INFO] [2024-11-30T23:35:23] Instrument mode: IntensifierCharacteristics
# # [INFO] [2024-11-30T23:35:23] Exposure duration: 20
# # [INFO] [2024-11-30T23:35:23] Exposure ignored due to invalid or unsupported filter
# # [INFO] [2024-11-30T23:35:23] Module name: StampKeywords
# # [INFO] [2024-11-30T23:35:23] Instrument: all
# # [INFO] [2024-11-30T23:35:23] Stream no.: 0001
# # [INFO] [2024-11-30T23:35:23] Module version number: 2.09
# # [INFO] [2024-11-30T23:35:23] Getting ODS version from file\
#     /scratch/225459.1.all.q/xmm/ppsprod/228605/odf/0639_0148961101_SCX00000TCS.FIT
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
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/P0148961101OBX000CALIND0000.FIT \
stringvalue="\"228605\" \"0639\" \"2024-12-01T00:34:54\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.0.0\" \
\"XMM-Newton/SOC\" \"004\" \"CALIBRATION INDEX FILE\"" -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time addattribute 0.0429048538208008s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
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/P0148961101OBX000ATTTSR0000.FIT \
stringvalue="\"228605\" \"0639\" \"2024-12-01T00:34:54\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.0.0\" \
\"XMM-Newton/SOC\" \"004\" \"ATTITUDE TIME SERIES\"" -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time addattribute 0.0387351512908936s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
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/P0148961101OBX000ORBTSR0000.FIT \
stringvalue="\"228605\" \"0639\" \"2024-12-01T00:34:54\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.0.0\" \
\"XMM-Newton/SOC\" \"004\" \"SPACECRAFT ORBIT\"" -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time addattribute 0.0532610416412354s
#
# [COMMAND] [2024-11-30T23:35:23]
export SAS_MEMORY_MODEL=high
# [COMMAND] [2024-11-30T23:35:23]
export SAS_RAND_SEED=0148961101
# # [INFO] [2024-11-30T23:35:23] ## DEBUG ModuleResources: SAS_RAND_SEED set: 0148961101
# [COMMAND] [2024-11-30T23:35:23]
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/P0148961101OBX000RADMON0000.FIT \
stringvalue="\"228605\" \"0639\" \"2024-12-01T00:34:54\" \"1\" \"21.51_20241115_1113\" \"xmmsas_20241108_1150-21.0.0\" \"14.0.0\" \
\"XMM-Newton/SOC\" \"004\" \"RADMON RATE\"" -w 10
# # [OUTPUT] [2024-11-30T23:35:23]
# # [INFO] [2024-11-30T23:35:23] Task Run Time addattribute 0.0555539131164551s
#
# [COMMAND] [2024-11-30T23:35:23]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Attitude_GTI-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# [COMMAND] [2024-11-30T23:35:23]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Observing_modes_Pileup_and_OoT_data-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
# [COMMAND] [2024-11-30T23:35:23]
gzip --rsyncable -f intermediate/GlobalHK-all-1-Energy_Conversion_Factors-X00000000000000.fits
# # [INFO] [2024-11-30T23:35:23] System RV 0
