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 [posfitfile_out] [a0110file_in] [n] [orbit_folding] [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. If orbit_folding=False, these times are the same as the event times. If orbit_folding=True and a0110file_in is a valid Level 1 APID 0110 ADC file, then the average orbital period is calculated from the ADCSEC2SUN values in that file, and the times used to calculate the position corrections are mod(times, orbital_period). The parameters from each fitted interval will be saved to an output FITS file (posfitfile_out) if the given filename is valid. A corrected position is then given for each event by subtracting the difference between the interpolated 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.

posfitfile_out* (str)
Output file showing the peak-fitting parameters for each interval fitted. (default: "")

a0110file_in* (str)
Input Level 1 HK APID 0110 ADC file. Used to derive the orbit period, and only used if orbit_folding is true. (default: "")

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

orbit_folding* (Boolean)
Fold time values at the average orbital period (default: no).

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

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

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 (Boolean)
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
    

  2. 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 interval for each aspect correction subinterval is set to 30 seconds, orbit_folding is enabled, and the input a0110file_in is specified. The input event file is ixpe00000000_det1_evt1_v01.fits, the input attitude file is ixpe00000000_det1_att_v01.fits, the input a0110file_in is ixpe00000000_all_adc_0110_v01.fits, the output event file is ixpe00000000_det1_evt1_v01_out.fits, the ouput attitude file is ixpe00000000_det1_att_v01_out.fits, and the output position fit parameter file is ixpe00000000_det1_posfits_out_fits

     > ixpeaspcorr infile=ixpe00000000_det1_evt1_v01.fits attfile_in=ixpe00000000_det1_att_v01.fits a0110file_in=ixpe00000000_all_adc_0110_v01.fits outfile=ixpe00000000_det1_evt1_v01_out.fits attfile_out=ixpe00000000_det1_att_v01_out.fits orbit_folding=yes posfitfile_out=ixpe00000000_det1_posfits_out_fits n=30
    

BUGS

SEE ALSO

LAST MODIFIED

Mar 2025