Ensemble Corrector (corrections.EnsembleCorrector)

Initial code structure for the ensemble photometry detrending program.

Created on Thu Mar 29 09:58:55 2018 .. codeauthor:: Derek Buzasi .. codeauthor:: Oliver J. Hall .. codeauthor:: Lindsey Carboneau .. codeauthor:: Filipe Pereira

class corrections.EnsembleCorrector(*args, **kwargs)[source]

Bases: corrections.BaseCorrector.BaseCorrector

DOCSTRING

__init__(*args, **kwargs)[source]

Initialize the correction object :param *args: Arguments for the BaseCorrector class :param **kwargs: Keyword Arguments for the BaseCorrector class

close()

Close correction object.

correct(task)

Run correction.

Parameters:task (dict) – Dictionary defining a task/lightcurve to process.
Returns:Result dictionary containing information about the processing.
Return type:dict

Code author: Rasmus Handberg <rasmush@phys.au.dk>

do_correction(lc)[source]

Function that takes all input stars for a sector and uses them to find a detrending function using ensemble photometry for a star ‘star_names[ifile]’, where ifile is the index for the star in the star_array and star_names list. :param lc: Raw lightcurve stored in a TessLightCurve object. :type lc: lightkurve.TessLightCurve

Returns:Corrected lightcurve stored in a TessLightCurve object. The status of the correction.
Return type:lc_corr (lightkurve.TessLightCurve)
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 (string, optional) – Path to directory where to save lightcurve. If None the directory specified in the attribute output_folder is used.
Returns:Path to the generated file.
Return type:string

Code author: Rasmus Handberg <rasmush@phys.au.dk>

search_database(select=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.

Parameters:
  • search (list of strings or None) – Conditions to apply to the selection of stars from the database
  • order_by (list, string 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 (boolean) – Boolean indicating if the query should return unique elements only.
Returns:

Returns all stars retrieved by the call to the database as dicts/tasks that can be consumed directly by load_lightcurve

Return type:

list of dicts

Code author: Rasmus Handberg <rasmush@phys.au.dk>

Initial code structure for the ensemble photometry detrending program.

Created on Thu Mar 29 09:58:55 2018 .. codeauthor:: Derek Buzasi .. codeauthor:: Oliver J. Hall .. codeauthor:: Lindsey Carboneau .. codeauthor:: Filipe Pereira

class corrections.ensemble.EnsembleCorrector(*args, **kwargs)[source]

Bases: corrections.BaseCorrector.BaseCorrector

DOCSTRING

__init__(*args, **kwargs)[source]

Initialize the correction object :param *args: Arguments for the BaseCorrector class :param **kwargs: Keyword Arguments for the BaseCorrector class

do_correction(lc)[source]

Function that takes all input stars for a sector and uses them to find a detrending function using ensemble photometry for a star ‘star_names[ifile]’, where ifile is the index for the star in the star_array and star_names list. :param lc: Raw lightcurve stored in a TessLightCurve object. :type lc: lightkurve.TessLightCurve

Returns:Corrected lightcurve stored in a TessLightCurve object. The status of the correction.
Return type:lc_corr (lightkurve.TessLightCurve)