BaseCorrector (corrections.BaseCorrector)

The basic correction class for the TASOC Photomety pipeline. All other specific correction classes will inherit from BaseCorrector.

Code author: Lindsey Carboneau

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

Code author: Filipe Pereira

class corrections.BaseCorrector(input_folder, plot=False)[source]

Bases: object

The basic correction class for the TASOC Photometry pipeline. All other specific correction classes will inherit from BaseCorrector.

plot

Boolean indicating if plotting is enabled.

Type:

bool

data_folder

Path to directory where axillary data for the corrector should be stored.

Type:

str

Code author: Lindsey Carboneau

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

__init__(input_folder, plot=False)[source]

Initialize the corrector.

Parameters:
  • input_folder (str) – Directory with input files.

  • plot (bool, optional) – Enable plotting.

Raises:

FileNotFoundError – TODO-file not found in directory.

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

close()[source]

Close correction object.

correct(task, output_folder=None)[source]

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(lightcurve)[source]

Apply corrections to target lightcurve.

Parameters:

lightcurve (lightkurve.TessLightCurve) – Lightcurve of the target star to be corrected.

Returns:

  • STATUS: The status of the corrections.

  • lightkurve.TessLightCurve: corrected lightcurve object.

Return type:

tuple

Raises:

NotImplementedError

load_lightcurve(task)[source]

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)[source]

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)[source]

Save generated lightcurve to file.

Parameters:

output_folder (str, 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:

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)[source]

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>

Correction Status (corrections.STATUS)

class corrections.STATUS(value)[source]

Status indicator of the status of the correction.

ABORT = 4

The calculation was aborted.

ERROR = 2

Encountered a catastrophic error that I could not recover from.

OK = 1

Everything has gone well.

SKIPPED = 5

The target was skipped because the algorithm found that to be the best solution.

STARTED = 6

The calculation has started, but not yet finished.

UNKNOWN = 0

The status is unknown. The actual calculation has not started yet.

WARNING = 3

Something is a bit fishy. Maybe we should try again with a different algorithm?