![]() |
cctime.sh |
In case cutting and pasting from your web browser is painful on your system, you can dowload the file by clicking the provided link.
cctime.sh
#!/bin/sh
# Starting from level 1 data, produce a file for ccd_id=7 where the
# source photons (zero order only) have been fully time corrected.
# 2001-08-30 No longer correct SIM_Z offsets (which is done in dmcoords)
# 2001-08-30 Use a cleaned time shifted AOFF file
#-----------------------------------------------------------------------
# Full path to the original data files.
EVT1=/data1/tennaaf/chandra/crab/00170/acism00170_001N000_evt1.fits
AOFF=/data1/tennaaf/chandra/crab/00170/acism00170_001N000_aoff1.fits
OFILE=/data1/tennaaf/chandra/crab/00170/orbitf052088700N001_eph1.fits
# This is where the target appears in chipy coordinates when the aspect
# and flexure offsets are both zero. It is best to determine an
# accurate value by running dmcoords.
NOMCHIPY=514.85
# RA/Dec passed to axBary
RA=83.6332167d0
DEC=22.0144636d0
# Where the final fully time corrected data will be
OUT=/tmp/ob00170_bc.fits
# The clean time-shifted AOFF file
CAOFF=/tmp/clean_aoff1.fits
#-----------------------------------------------------------------------
# Temporary work files
TMPI=/tmp/tmp1.fits
TMPO=/tmp/tmp2.fits
# Create a new AOFF file where the bad data has been removed.
rm -f $TMPO
fselect $AOFF $TMPO aoff_gap.eq.0
mv $TMPO $TMPI
# We actually want the offsets at the time the photon interacted with
# the detector. To approximate this time we shift the AOFF times
# forward by the average delay.
fcalc $TMPI $TMPO time time+\(1028+${NOMCHIPY}\)\*0.00285
mv $TMPO $CAOFF
# Select data from S3 only. Since the correction only works for
# a source at the aimpoint we restrict the data to that location.
rm -f $TMPO
fselect $EVT1 $TMPO ccd_id.eq.7.and.200.lt.chipx.and.chipx.le.300
mv $TMPO $TMPI
# Interpolate x_offsets, y_offsets,stf_z,stf_y into the event list.
finterp ${TMPI}[1] ${CAOFF}[1] $TMPO X_OFFSETS
mv $TMPO $TMPI
finterp ${TMPI}[1] ${CAOFF}[1] $TMPO Y_OFFSETS
mv $TMPO $TMPI
finterp ${TMPI}[1] ${CAOFF}[1] $TMPO STF_Z
mv $TMPO $TMPI
finterp ${TMPI}[1] ${CAOFF}[1] $TMPO STF_Y
mv $TMPO $TMPI
# Delete the rows that interpolated to INDEF.
fselect $TMPI $TMPO \!ISNULL\(x_offsets\)
mv $TMPO $TMPI
# Apply time correction. Correct for dither and STF_Z (flexure) offsets.
fcalc $TMPI $TMPO time \
time-timedel*\(1028.0+${NOMCHIPY}-STF_Z/0.024\
+SIN\(ROLL_NOM/57.29578\)*x_offsets+COS\(ROLL_NOM/57.29578\)*y_offsets\)
mv $TMPO $TMPI
# This is optional. We compute chipx at zero offset. This allows
# us to check the accuracy of the corrections and also allows easy
# data selection (we end up with a point source in chipxz).
fcalc $TMPI $TMPO chipxz \
\(int\)\(0.5+STF_Y/0.024+\
COS\(ROLL_NOM/57.29578\)*x_offsets-SIN\(ROLL_NOM/57.29578\)*y_offsets\)+chipx
mv $TMPO $TMPI
# Delete the HDU's that confuse axBary
fdelhdu ${TMPI}[7] no yes
fdelhdu ${TMPI}[6] no yes
# Run axBary to do Barycenter correction
rm -f $OUT
axBary -i $OFILE -f $TMPI -o $OUT -ref FK5 -ra $RA -dec $DEC
rm -f $TMPI
|
Editor: Dr. Douglas Swartz System Administrator: Mr. Bob Dean Privacy Policy and Important Notices Accessibility Statement |
|
|