Documentation for BackDrop
Class to create background corrections for TESS.
tess-backdrop
fits a simple, three part model:
1. A 2D, low order polynomial to remove the bulk background
2. A 2D b-spline to remove high spatial frequency noise
3. A model for strap offsets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fnames |
list of str, or list of astropy.io.fits objects |
Input TESS FFIs |
required |
npoly |
int |
The order of polynomial to fit to the data in both x and y dimension. Recommend ~4. |
required |
nrad |
int |
The order of polynomial to fit to the data in radius from the boresight |
required |
nknots |
int |
Number of knots to fit in each dimension. Recommend ~40. |
required |
degree |
int |
Degree of spline to fit. |
required |
nb |
int |
Number of bins to downsample to for polynomial fit. |
required |
cutout_size |
int |
Size of cut out to use. Default is 2048, full FFI |
'2048' |
build_correction(self, column, row, times=None)
Build a background correction for a given column, row and time array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column |
1D np.ndarray of ints |
Array between 0 and 2048 indicating the column number. NOTE: Columns in TESS FFIs and TPFs are offset by 45 pixels, and usually are between 45 and 2093. |
required |
row |
1D np.ndarray of ints |
Array between 0 and 2048 indicating the row number. |
required |
times |
None, list of ints, or np.ndarray of floats |
Times to evaluate the background model at. If none, will evaluate at all the times for available FFIs. If array of ints, will use those indexes to the original FFIs. Otherwise, must be an np.ndarray of floats for the T_START time of the FFI. |
None |
Returns:
Type | Description |
---|---|
np.ndarray |
2D array with shape ntimes x nrow x ncolumn containing the background estimate for the input column, row and times. |
fit_model(self)
Fit the tess-backdrop model to the files specified by fnames
.
load(self, sector, camera, ccd, full_jitter=False)
Load a model fit to the tess-backrop data directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sector |
int |
TESS sector number |
required |
camera |
int |
TESS camera number |
required |
ccd |
int |
TESS CCD number |
required |
save(self, output_dir=None, package_jitter_comps=True)
Save a model fit to the tess-backrop data directory.
Will create a fits file containing the following extensions - Primary - T_START: The time array for each background solution - KNOTS: Knot spacing in row and column - SPLINE_W: Solution to the spline model. Has shape (ntimes x nknots x nknots) - STRAP_W: Solution to the strap model. Has shape (ntimes x self.cutout_size) - POLY_W: Solution to the polynomial model. Has shape (ntimes x npoly x npoly)