NAME

ixpeboomdriftcorr -- Corrects for modeled boom drift errors using a specific state vector and event time stamps.

USAGE

ixpeboomdriftcorr.py infile outfile adc0110_file attfile_in attfile_out [n] [paramsfile] [teldef] [statout] [uncorr] [x_pix_mean_corr] [y_pix_mean_corr] [clobber]

DESCRIPTION

ixpeboomdriftcorr uses event time stamps and sky X,Y values from an IXPE Level 1 event FITS file (infile), boom drift model parameters from a file (paramsfile), a houskeeping state vector from an IXPE Level-1 houskeeping file (adc0110_file) that indicates the time before or after the spacecraft is eclipsed, and the field rotation information from an IXPE Level-1 attitude file (attfile_in) to compute the modeled boom drift offsets. A corrected position is then written to the output file (outfile) for each event by subtracting the computed offset for each event from the uncorrected position. If x_pix_mean_corr and/or y_pix_mean_corr are set to values other than '-', these values will also be subtracted from each uncorrected event position.

If statout=True, then the running mean and standard deviation for each axis position is added to the output 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 in the output file 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 output file is written with these new columns added as well as a new keyword, XPBOMCOR, to prevent unintentional multiple running of ixpeboomdriftcorr.

In addition, ixpeboomdriftcorr calculates the interpolated position of the spacecraft pointing direction on the sky plane and adds these values as a new column (TXYDZ_CORRBD) to the attitude output file (attfile_out).

PARAMETERS

infile* (str)
Input FITS Event file

outfile* (str)
Output FITS Event file

adc0110_file* (str)
Houskeeping file containing seconds-to-sun monitor.

attfile_in* (str)
Attitude file to be corrected.

attfile_out* (str)
Attitude file to which corrected attitude column is written.

params_file (str)
Caldb or file name containing boom model parameters. (default: caldb)

teldef (str)
Caldb or file name containing the telescope definition parameters. (default: caldb)

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

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)

x_pix_mean_corr (float)
Optional mean x position adjustment (subtracted) in J2000 pixels. Default is 0.

y_pix_mean_corr (float)
Optional mean y position adjustment (subtracted) in J2000 pixels. Default is 0.

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

EXAMPLES

BUGS

SEE ALSO

LAST MODIFIED

Oct. 2023