CBV Corrector (corrections.CBVCorrector)
Correct lightcurves using Cotrending Basis Vectors.
Code author: Mikkel N. Lund <mikkelnl@phys.au.dk>
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- class corrections.CBVCorrector(*args, **kwargs)[source]
Bases:
BaseCorrectorThe CBV (Co-trending Basis Vectors) correction method for the TASOC photometry pipeline.
The CBVCorrector inherits functionality of
BaseCorrector.- cbvs
Dictionary of
CBVobjects.- Type:
dict
Code author: Mikkel N. Lund <mikkelnl@phys.au.dk>
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- __init__(*args, **kwargs)[source]
Initialise the CBVCorrector.
Code author: Mikkel N. Lund <mikkelnl@phys.au.dk>
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- close()
Close correction object.
- correct(task, output_folder=None)
Run correction.
- Parameters:
task (dict) – Dictionary defining a task/lightcurve to process.
output_folder (str, optional) – Path to directory where lightcurve should be saved.
- Returns:
Result dictionary containing information about the processing.
- Return type:
dict
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- do_correction(lc, use_prior=False)[source]
Function where the correction is called, and where additional headers for the FITS are defined
- Parameters:
lc (TessLightCurve) – Lightcurve to correct.
use_prior (boolean, optional) – Use prior in fitting of CBVs. Default=False.
- Returns:
TessLightcurve: Corrected lightcurve.
STATUS: Status of the correction.
- Return type:
tuple
Code author: Rasmus Handberg <rasmush@phys.au.dk>
Code author: Mikkel N. Lund <mikkelnl@phys.au.dk>
- load_lightcurve(task)
Load lightcurve from task ID or full task dictionary.
- Parameters:
task (integer or dict)
- Returns:
Lightcurve for the star in question.
- Return type:
lightkurve.TessLightCurve- Raises:
ValueError – On invalid file format.
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- plot_folder(lc)
Return folder path where plots for a given lightcurve should be saved.
- Parameters:
lc (
lightkurve.TessLightCurve) – Lightcurve to return plot path for.- Returns:
Path to directory where plots should be saved.
- Return type:
string
Code author: Rasmus Handberg <rasmush@phys.au.dk>
- save_lightcurve(lc, output_folder=None)
Save generated lightcurve to file.
- Parameters:
output_folder (str, optional) – Path to directory where to save lightcurve. If
Nonethe directory specified in the attributeoutput_folderis used.- Returns:
Path to the generated file.
- Return type:
str
Code author: Rasmus Handberg <rasmush@phys.au.dk>
Code author: Mikkel N. Lund <mikkelnl@phys.au.dk>
- search_database(select=None, join=None, search=None, order_by=None, limit=None, distinct=False)
Search list of lightcurves and return a list of tasks/stars matching the given criteria.
Returned rows are restricted to things not marked as
STATUS.SKIPPED, since these have been deemed too bad to not require corrections, they are definitely also too bad to use in any kind of correction.- Parameters:
select (list of strings or None) – List of table columns to return.
search (list of strings or None) – Conditions to apply to the selection of stars from the database
order_by (list, str or None) – Column to order the database output by.
limit (int or None) – Maximum number of rows to retrieve from the database. If limit is None, all the rows are retrieved.
distinct (bool) – Boolean indicating if the query should return unique elements only.
join (list) – Table join commands to merge several database tables together.
- Returns:
All stars retrieved by the call to the database as dicts/tasks that can be consumed directly by load_lightcurve
- Return type:
list
Code author: Rasmus Handberg <rasmush@phys.au.dk>