Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 1 Nov 2017

URL: http://cxc.harvard.edu/ciao/threads/periscope_drift/

Correct Events for Aspect Periscope Drift

CIAO 4.9 Science Threads


Overview

Synopsis:

Thermal cycling on the spacecraft can result in an apparent temporal drift of the sky position of an X-ray source during an observation. This appears as a drift of up to about 0.5 arcsec in the X-ray event sky coordinates over time. Because of the thermal variation time-scales, this effect is usually most prominent in long observations (more than ~50 ksec).

As of DS 8.4, a drift correction is applied to the aspect solution using the periscope gradients telemetry in the standard data processing pipeline. However, temporal drifts have continued to increase with thermal variation of the spacecraft; therefore, the Aspect team suggests that to accomplish science related to sub-arcsecond source structure, users should follow this thread to correct residual drift induced by the periscope. This requires a relatively bright, on-axis source (within a few arcminutes off-axis angle) to perform a "self-calibration" of the aspect solution.

The correct_periscope_drift script returns plots of the fits of the drift in the Aspect Camera Y- and Z-angle and new aspect solution file with offsets updated to include drift corrections. This new aspect solution may be applied with the chandra_repro (via acis_process_events or hrc_process_events) script to correct the sky positions in a new evt2 file.

Purpose:

Related Links:

Last Update: 1 Nov 2017 - new for CIAO 4.9: original version


Contents


Get Started

Download the sample data: 17128 (3C 15)

In this thread, we assume that we work in the same directory, making references to paths relative to the working directory.

For gratings data, only use events around the zeroth-order position. Retaining only the zeroth-order and unsorted gratings events can be done by applying the "[tg_m=0,Null]" filter on the events file used with correct_periscope_drift to produce the corrected aspect solution.


View and Select a Region to Use for the Autocorrection.

While selecting an isolated, bright point source in a field is trivial, picking an appropriate on-axis source—particularly in a crowded field—to use for the drift correction may take some work. celldetect is one rough method to view and select a source.

unix% punlearn celldetect
unix% celldetect infile= 17128/primary/acisf17128N002_evt2.fits.gz outfile=mysrc.fits

unix% punlearn dmsort
unix% dmsort mysrc.fits"[SRCLIST]" key=-snr outfile=mysrc_snrsort.fits

unix% dmlist mysrc_snrsort.fits"[cols net_counts,x,y,snr,r][net_counts>500]" data | head

--------------------------------------------------------------------------------
Data for Table Block SRCLIST
--------------------------------------------------------------------------------
ROW    NET_COUNTS           POS(X,Y)                         SNR   R[2]

 1             4730.250 (     4064.8883702839,     4071.8739789965) 63.5722618103 [        1.9038963318         1.7280120850]
 2      1916.0833740234 (     5050.8106140536,     6133.5909474573) 21.5115623474 [       98.9364013672        96.6939392090]
 3      2097.0068359375 (     4743.0030283711,     6043.9606311763) 20.2611484528 [       78.0483093262        70.0926284790]

From the celldetect source list, we are looking for a high count, high SNR source, relatively close to the optical-axis (which for ACIS is defined at (x,y)=(4096.5,4096.5). The first source will do. We select a radius greater than the larger reported value of R of the celldetect shape, 6 ACIS pixels in this example, and view it in DS9.

unix% ds9 17128/primary/acisf17128N002_evt2.fits.gz \
? -bin about 4064.8883702839 4071.8739789965 \
? -scale log \
? -regions command "circle 4064.8883702839  4071.8739789965 6 # color=red" \
? -zoom 8
[source regions for ObsID 17128]
[Print media version: source regions for ObsID 17128]

Figure 1: Source Region for ObsID 17128

The first source detected by celldetect highlighted by a red circle with a 6-pixel radius.

The source looks point-like and is basically contained within the specified region.


Running the Correction Script Using the Source for Reference Events

Set the source for the script and other input and output files as desired.

unix% punlearn correct_periscope_drift

unix% pset correct_periscope_drift x=4064.8883702839 y=4071.8739789965 radius=6

unix% pset correct_periscope_drift infile= 17128/primary/pcadf557756838N002_asol1.fits.gz
unix% pset correct_periscope_drift evtfile= 17128/primary/acisf17128N002_evt2.fits.gz
unix% pset correct_periscope_drift outfile=driftcorr_asol1.fits
unix% pset correct_periscope_drift corr_plot_root=demo_corr

unix% correct_periscope_drift mode=h

The script will write out an updated aspect solution to driftcorr_asol1.fits as requested by the outfile parameter and will save the plots of the fits into the working directory.

[NOTE]
Note on Coordinate Systems

The correction is performed by directly updating the dy and dz values in the aspect solution. The dy/dz values are aligned with the Aspect Camera Y and Z axes, and therefore, to fit the X-ray events, this script transforms the event coordinates into positions in the Aspect Camera frame, and then independently fits offsets in those Y and Z axes. Note that the positions in this frame are abbreviated 'yag' and 'zag' in the fit and data plots output by the script.

Running: correct_periscope_drift
   version = 0.2
with parameters:
  infile=17128/primary/pcadf557756838N002_asol1.fits.gz
  evtfile=17128/primary/acisf17128N002_evt2.fits.gz
  outfile=driftcorr_asol1.fits
  verbose=2
  and ASCDS_INSTALL is /soft/ciao-4.9
------------------------------------------------------------
Fitting a line to the data to get reduced stat errors
Fitting a polynomial of degree 2 to the data
Fitting a line to the data to get reduced stat errors
Fitting a polynomial of degree 2 to the data
------------------------------------------------------------
Fit results
    Events show drift range of 0.36 arcsec in yag axis
    Max absolute correction of 0.21 arcsec for yag axis
    Events show drift range of 0.02 arcsec in zag axis
    Max absolute correction of 0.01 arcsec for zag axis
------------------------------------------------------------
Writing out corrected aspect solution file to driftcorr_asol1.fits
    To review fit see correction plots in:
       demo_corr_fit_yag.png
       demo_corr_data_yag.png
       demo_corr_fit_zag.png
       demo_corr_data_zag.png
[plot of periscope drift]
[Print media version: plot of periscope drift]

Figure 2: The Periscope Drift

The periscope drift of the observation is plotted. The plots on the left are the angular drift of the mean aspect camera frame axes over the course of the observation, with the drift particularly apparent in the non-linear fit to the mean yag-axis.


Apply the New Aspect Solution and Verify the Outputs

To avoid problems and force chandra_repro to pick up the corrected aspect solution, first move the original aspect solution out of the primary directory and rename it, while copying the new aspect solution to the primary data directory.

unix% mv 17128/primary/pcadf557756838N002_asol1.fits.gz 17128/pcadf557756838N002_asol1.fits.gz.ORIG
unix% cp driftcorr_asol1.fits 17128/primary/pcadf557756838_driftcorr_asol1.fits
unix% chandra_repro indir=17128 check_vf_pha=yes

Since this observation was made in the VFAINT data mode, the check_vf_pha parameter is set.

Note that the duration of the event processing task in chandra_repro scales with the number of events. The long observations with bright sources for which this script is useful may take more than 30 minutes to run on a modern CPU.

Verifying that the corrections to the reprocessed events file can be checked by re-running the correct_periscope_drift script, recycling the previously used x, y, and radius parameters:

unix% pset correct_periscope_drift evtfile=17128/repro/acisf17128_repro_evt2.fits
unix% pset correct_periscope_drift infile=17128/primary/pcadf557756838_driftcorr_asol1.fits
unix% pset correct_periscope_drift outfile=already_fixed.fits
unix% pset correct_periscope_drift corr_plot_root="already_fixed"

unix% correct_periscope_drift mode=h

Running: correct_periscope_drift
  version = 0.2
with parameters:
  infile=17128/primary/pcadf557756838_driftcorr_asol1.fits
  evtfile=17128/repro/acisf17128_repro_evt2.fits
  outfile=already_fixed.fits
  verbose=2
  and ASCDS_INSTALL is /soft/ciao-4.9
------------------------------------------------------------
Fitting a line to the data to get reduced stat errors
Fitting a polynomial of degree 2 to the data
Fitting a line to the data to get reduced stat errors
Fitting a polynomial of degree 2 to the data
------------------------------------------------------------
Fit results
    Events show drift range of 0.00 arcsec in yag axis
    Max absolute correction of 0.00 arcsec for yag axis
    Events show drift range of 0.00 arcsec in zag axis
    Max absolute correction of 0.00 arcsec for zag axis
------------------------------------------------------------
Writing out corrected aspect solution file to already_fixed.fits
        To review fit see correction plots in:
               already_fixed_fit_yag.png
               already_fixed_data_yag.png
               already_fixed_fit_zag.png
               already_fixed_data_zag.png

Looking at the plots, it's apparent that the correction has been applied to the events with.

[plot of events corrected for periscope drift]
[Print media version: plot of events corrected for periscope drift]

Figure 3: Corrected Events for Periscope Drift

The periscope drift of the corrected events is plotted. The plots on the left of the mean Aspect Camera frame axes does not vary much over the course of the observation, verifying the corrections have been applied.


Summary

The correction and fitting routine extracts the X-ray events from the provided source region (a circle centered at the provided coordinates with the supplied radius) and converts the RA, Dec of the X-ray events into approximately Aspect Camera/PCAD frame Y and Z relative to the RA_PNT, DEC_PNT, and ROLL_PNT supplied in the event list.

We then fit two independent curves to the mean-subtracted Y and Z angle data using a Sherpa fit model. A polynomial is used as the fit model; users may specify the order of the desired polynomial as an option to the script. Advanced users may directly edit this contributed Python fitting script to use a custom model.

The Sherpa fit is then applied to the aspect solution's dy and dz columns and a new aspect solution file with those updated columns is written out.


History

01 Nov 2017 new for CIAO 4.9: original version


Last modified: 1 Nov 2017
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.