API documentation¶
tessilator.fixedconstants Module¶
Alexander Binks & Moritz Guenther, 2024
Licence: MIT 2024
Module containing fixed constants for the tessilator
These are the pixel size, the typical full-width half maximum of the pixel response function, the TESS zeropoints and the latest TESS sector available for download.
tessilator.tessilator Module¶
Alexander Binks, Moritz Guenther, 2024
License: MIT 2024
The TESSILATOR
Functions¶
|
Run the tessilator for all targets. |
|
Iterate over all cameras and CCDs for a given sector. |
|
Apply the correction to the lightcurve based on the noise simulation. |
|
Decide whether to use the periodogram results from the original, or from the CBV-corrected lightcurve. |
|
Collect data on contamination sources around selected targets. |
Create a template astropy table to store tessilator results. |
|
|
Identify the pixel x-y positions for contaminant sources. |
|
Apply a flux-corrected key to the target lightcurve dictionary, and make a plot of the corrections if required. |
|
Divide the target lightcurve by the noise lightcurve |
|
Aperture photometry, lightcurve cleaning and periodogram analysis. |
|
Download TESS cutouts and store to a list for lightcurve analysis. |
|
Function which returns a list of fits files corresponding to a given Sector, Camera and CCD configuration. |
|
A function that makes the final noisy lightcurve. |
|
Quick function to capture a string containing the name of the target. |
|
Get the pixel x-y positions for all targets in a Sector/Camera/CCD mode. |
|
Makes a 2D cutout object of a target using the median time-stacked image. |
|
Make a plot of the noise corrections to the lightcurve. |
|
Construct table row with the input target data. |
|
Run the tessilator for targets in a given Sector/Camera/CCD configuration. |
|
Download cutouts and run lightcurve/periodogram analysis for one target. |
|
Calculate the time taken for a process. |
|
Read input data and convert to an astropy table ready for analysis. |
|
|
|
Run the periodogram analyses for neighbouring contaminants if required. |
|
Set up the file names to store data. |
Retrieve the input parameters to run the tessilator program. |
|
|
Check if the input file needs modifying at all. |
tessilator.maketable Module¶
Alexander Binks & Moritz Guenther, 2024
Licence: MIT 2024
Make tabular data for tessilator
This module contains the functions required to convert the input data into correct formatted astropy tables to be used for further analysis in the tessilator.
Functions¶
|
Reads the input table and returns a table in the correct format for TESSilator. |
|
If the Gaia DR3 system is not chosen, this function returns a string which has the same format as the 2MASS identifiers. |
|
Generate the formatted astropy table from a list of coordinates. |
|
Generate the formatted astropy table from a list of target names. |
|
Generate the formatted astropy table from a pre-formatted astropy table. |
tessilator.aperture Module¶
Alexander Binks & Moritz Guenther, 2024
Licence: MIT 2024
This module contains functions to perform aperture photmetry.
The aperture photometry is defined by a single function ‘aper_run’, which reads the TESS image files, performs aperture phtoometry and returns an astropy table containing the timestamps, magnitudes and fluxes derived from aperture photometry. Additionally, one can use the function ‘calc_rad’, which evaluates the relative brightness of neighbouring pixels to automatically determine the size of the aperture radius. If the full-frame images are used, a function named ‘get_xy_pos’ provides a WCS transformation to convert celestial coordinates to image (x-y) pixels.
Functions¶
|
Perform aperture photometry for the image data. |
|
Calculate the appropriate pixel radius for the aperture |
|
Locate the X-Y position for targets in a given Sector/CCD/Camera mode |
tessilator.contaminants Module¶
Alexander Binks & Moritz Guenther, 2024
License: MIT 2024
This module contains functions to quantify the background flux contamination from neighbouring sources in the TESS full-frame images. Each TESS pixel has a length of 21”, therefore targets are highly susceptible to background contamination when they (1) are in crowded fields, (2) are faint sources and/or (3) have high contributing sky-counts.
The background is quantified by acquistioning RP-band magnitudes in the Gaia DR3 catalogue for potential contaminants in the surrounding image apertures, and then calculating their flux contribution which is incident within the target aperture using an analytical formula provided as equation 3b-10 in Biser & Millman (1965).
An additional function can be called which stores the potential neighbouring contaminants. Periodogram analyses for these neighbouring sources are then performed to help distinguish whether the lightcurve/periodogram signal is that of the target, or from neighbouring sources.
Functions¶
|
Estimate flux from neighbouring contaminant sources. |
|
Quantify the flux contamination from a neighbouring source. |
|
Identify neighbouring contaminants that may cause the periodicity. |
|
Perform an SQL query to identify neighbouring contaminants. |
tessilator.detrend_cbv Module¶
Alexander Binks & Moritz Guenther, December 2024
Licence: MIT 2024
This module contains the functions needed to perform the co-trending basis vector corrections to the TESS lightcurves, if required. The functions were originally designed for Kepler-data analysis, and written by Suzanne Aigrain -> https://github.com/saigrain/CBVshrink
Functions¶
|
Calculate the dot product between the weights and the CBVs. |
|
Fit linear basis model with design matrix X to data y. |
|
calculate the block mean |
|
|
|
Calculate the flux-correction weights for the co-trending basis vectors (CBVs). |
|
Correct light curve for systematics using first nB CBVs. |
|
Run the CBV fits for a given lightcurve |
|
Selects the type of CBV correction and applies them to the lightcurve |
|
Compute log of determinant of matrix a using Cholesky decomposition |
|
calculate the medransig |
|
The savgol filter |
|
Correct light curve for systematics using upt to nB CBVs (automatically select best number). |
tessilator.lc_analysis Module¶
Alexander Binks & Moritz Guenther, 2024
Licence: MIT 2024
This module contains functions to normalise, detrend, and clean lightcurves.
The cleaning and detrending of the lightcurve takes part in 9 steps, each of which are called by the parent function ‘run_make_lc_steps’. The steps are:
Functions¶
|
Select the detrending polynomial from the Aikaike Information Criterion |
|
Determine whether the cbv-corrected lightcurve should be considered. |
|
Remove spurious outliers at the start and end parts of groups. |
|
Remove highly-scattered data at the edges of each group. |
A basic algorithm that trims both sides of a contiguous data string if a condition is not satisfied, until the condition is met for the first time. |
|
|
Detrend and normalise the lightcurves. |
|
Split the lightcurve into groups of contiguous data |
|
Construct the normalised, detrended, cleaned TESS lightcurve. |
|
Choose whether to detrend the lightcurve as one by individual groups. |
|
Return the relative root mean squared error (RRMSE) |
|
Removes very sparse data groups, when there are 3 or more groups. |
|
Process the lightcurve: cleaning, normalisation and detrending functions |
|
Returns the best parameters (y_offset, amplitude, and phase) to a regular sinusoidal function. |
|
Returns the best parameters (y_offset, amplitude, and phase) to a regular sinusoidal function. |
|
Determine how to detrend a lightcurve, based on a smoothness algorithm |
tessilator.makeplots Module¶
Alexander Binks & Moritz Guenther, 2024
Licence: MIT 2024
Generate pixel images, light-curves and periodogram plots
Functions¶
|
Produce a plot of tessilator results. |