NAME

ixpeaspcorr -- Corrects for residual aspect errors using interpolated event position averages over time intervals of user-specified number of seconds.

USAGE

ixpeaspcorr.py infile outfile attfile_in attfile_out [n] [statout] [uncorr] [x_pix_mean] [y_pix_mean]

DESCRIPTION

ixpeaspcorr uses event time stamps and sky X,Y values from an IXPE Level 1 event FITS file (infile) to compute average position over a time width of (n) seconds. A corrected position is then given for each event by subtracting the difference between the interplolated means of the n events and the mean of all events from the uncorrected position. If x_pix_mean and/or y_pix_mean are set to values other than '-', these values will be used instead of the mean of all events.

If statout=True, then the running mean and standard deviation for each axis position is added as columns X_AVG, X_STD, and Y_AVG, Y_STD. If uncorr=True, the original, uncorrected position columns are retained as X_UNCORR, Y_UNCORR and, if statout=True also, then the uncorrected statistics columns X_AVG_UNCORR, X_STD_UNCORR, Y_AVG_UNCORR, and Y_STD_UNCORR are also added. The "outfile" file is written with these new columns added as well as a new keyword, XPASPCOR, to prevent unintentional multiple running of ixpeaspcorr.

The attfile_in attitude file is used to determine which events were collected by which star-tracker head. Those collected during time the forward-pointing star tracker head was in use are treated separately from those in which the aft-pointing star tracker head was in use, greatly reducing the spurious blurring during the transitions. In addition, ixpeaspcorr will calculate the interpolated position of the spacecraft pointing direction on the sky plane and write these values as a new column (TXYDZ_CORR) in addition to the input columns to the output attitude file.

PARAMETERS

infile* (str)
Input FITS Event file

outfile* (str)
Input FITS Event file with corrected event positions.

attfile_in* (str)
Input attitude file used to determine star tracker optical head use.

attfile_out* (str)
Output attitude file with corrected pointing vector column TXYDZ_CORR added.

n (integer)
Duration of time (seconds) to group events in for fitting. (default: 300)

statout (bool)
Output standard deviation and mean of event positions? (default: no)

uncorr (bool)
Keep uncorrected positions in output file? If statout is also True, uncorrected stats will be output. (default: no)

att_path (str)
Attitude file to be corrected.

x_pix_mean (float)
X-position (pixel) to which corrected central peak of image is adjusted. Default ("-") will adjust corrected peak to mean x-position of input events.

y_pix_mean (float)
Y-position (pixel) to which corrected central peak of image is adjusted. Default ("-") will adjust corrected peak to mean y-position of input image.

clobber
Overwrite existing output file and/or output attitude file? (default: no)

EXAMPLES

  1. Correct the 'X and 'Y' columns for residual aspect errors, using separate solutions for the Fore and Aft Star Tracker optical heads and writing the corrected pointing direction column to the output attitude file. The default time for each aspect correction subinterval (300 seconds) is used. The input event file is ixpe00000000_det1_evt1_v01.fits, the input attitude file is ixpe00000000_det1_att_v01.fits, output event file is ixpe00000000_det1_evt1_v01_out.fits, and the ouput attitude file is ixpe00000000_det1_att_v01_out.fits.

     > ixpeaspcorr infile=ixpe00000000_det1_evt1_v01.fits attfile_in=ixpe00000000_det1_att_v01.fits outfile=ixpe00000000_det1_evt1_v01_out.fits attfile_out=ixpe00000000_det1_att_v01_out.fits
    

BUGS

SEE ALSO

LAST MODIFIED

Jan 2024