tkmatrix.tkmatrix_class.MATRIX

class tkmatrix.tkmatrix_class.MATRIX(target, sectors, author, dir, preserve=False, star_info=None, file=None, exposure_time=None, initial_mask=None, initial_transit_mask=None, eleanor_corr_flux='pca_flux', outliers_sigma=None, high_rms_enabled=True, high_rms_threshold=2.5, high_rms_bin_hours=4, smooth_enabled=False, auto_detrend_enabled=False, auto_detrend_method='cosine', auto_detrend_ratio=0.25, auto_detrend_period=None, prepare_algorithm=None, cache_dir='/home/docs/', oscillation_reduction=False, oscillation_min_snr=4, oscillation_amplitude_threshold=0.001, oscillation_ws_percent=0.01, oscillation_min_period=0.002, oscillation_max_period=0.2, cores=1)

Bases: object

MATRIX: Multi-phAse Transits Recovery from Injected eXoplanets

__init__(target, sectors, author, dir, preserve=False, star_info=None, file=None, exposure_time=None, initial_mask=None, initial_transit_mask=None, eleanor_corr_flux='pca_flux', outliers_sigma=None, high_rms_enabled=True, high_rms_threshold=2.5, high_rms_bin_hours=4, smooth_enabled=False, auto_detrend_enabled=False, auto_detrend_method='cosine', auto_detrend_ratio=0.25, auto_detrend_period=None, prepare_algorithm=None, cache_dir='/home/docs/', oscillation_reduction=False, oscillation_min_snr=4, oscillation_amplitude_threshold=0.001, oscillation_ws_percent=0.01, oscillation_min_period=0.002, oscillation_max_period=0.2, cores=1)

Methods

__init__(target, sectors, author, dir[, ...])

build_inject_dir()

inject(phases, min_period, max_period, ...)

Creates the injection of all the synthetic transiting planet scenarios

inject_rv(inject_dir, rv_file, phases, ...)

Creates the injection of all the synthetic radial velocities planet scenarios

num_of_zeros(n)

Counts the number of zeros in a decimal

plot_diff(object_id, inject_dir1, ...[, ...])

Plots the difference between two results directories.

plot_results(object_id, inject_dir[, ...])

Generates a heat map with the found/not found results for the period/radius grids

recovery(inject_dir[, snr_threshold, ...])

Given the injection dir, it will iterate over all the csvs matching light curves and try the recovery of their transit parameters (period and epoch).

recovery_rv(inject_dir[, rv_masks, ...])

recovery_rv_periods(filename, max_period_search)

remove_non_results_files(inject_dir)

Deletes all the files that belong to the injection stage are hence are not necessary for the results interpretation.

retrieve_object_data([inject_dir])

retrieve_object_data_for_recovery(...)

Attributes

DETREND_BIWEIGHT

DETREND_GP

MIN_SEARCH_PERIOD

SDE_ROCHE

lcbuilder

object_info

inject(phases, min_period, max_period, steps_period, min_radius, max_radius, steps_radius, period_grid=None, radius_grid=None, period_grid_geom='lin', radius_grid_geom='lin', inject_dir=None)

Creates the injection of all the synthetic transiting planet scenarios

Parameters:
  • phases – the number of epochs

  • min_period – minimum period for the period grid

  • max_period – maximum period for the period grid

  • steps_period – number of periods to inject

  • min_radius – minimum radius for the grid

  • max_radius – maximum radius for the grid

  • steps_radius – number of radii to be injected

  • period_grid – the period grid if set

  • radius_grid – the radius grid if set

  • period_grid_geom – [lin|log]

  • radius_grid_geom – [lin|log]

  • inject_dir – directory where injected files are stored

Returns:

the directory where injected files are stored and the period and radius grids

inject_rv(inject_dir, rv_file, phases, min_period, max_period, steps_period, min_mass, max_mass, steps_mass, period_grid=None, mass_grid=None, period_grid_geom='lin', mass_grid_geom='lin')

Creates the injection of all the synthetic radial velocities planet scenarios

Parameters:
  • inject_dir – the directory to store all the files

  • rv_file – the file with the rv measurements

  • phases – the number of epochs

  • min_period – minimum period for the period grid

  • max_period – maximum period for the period grid

  • steps_period – number of periods to inject

  • min_mass – minimum radius for the grid

  • max_mass – maximum radius for the grid

  • steps_mass – number of masses to be injected

  • period_grid – the period grid if given.

  • mass_grid – the mass grid if given.

  • period_grid_geom – [lin|log]

  • mass_grid_geom – [lin|log]

Returns:

the directory where injected files are stored and the period and mass grids

static num_of_zeros(n)

Counts the number of zeros in a decimal

Parameters:

n – the number

Returns:

the number of zero positions

static plot_diff(object_id, inject_dir1, inject_dir2, output_dir, binning=1, xticks=None, yticks=None, period_grid_geom='lin', radius_grid_geom='lin')

Plots the difference between two results directories.

Parameters:
  • object_id – the target star id

  • inject_dir1 – the results dir number 1

  • inject_dir2 – the results dir number 2

  • output_dir – the output directory for the plot

  • binning – the binning to be applied to both axes

  • xticks – the fixed ticks for the period bar

  • yticks – the fixed ticks for the radius bar

  • period_grid_geom – [lin|log]

  • radius_grid_geom – [ling|log]

static plot_results(object_id, inject_dir, period_grid=None, radius_grid=None, binning=1, xticks=None, yticks=None, period_grid_geom='lin', radius_grid_geom='lin', is_rv=False)

Generates a heat map with the found/not found results for the period/radius grids

Parameters:
  • object_id – the id of the target star

  • inject_dir – the inject directory where the result files are stored

  • period_grid – the periods grid array

  • radius_grid – the radius or mass grid array

  • binning – the binning to be applied to the grids

  • xticks – the fixed ticks to be used for the period grid

  • yticks – the fixed ticks to be used for the radius grid

  • period_grid_geom – [lin|log]

  • radius_grid_geom – [lin|log]

  • is_rv – whether to load the rv results or the photometry ones

recovery(inject_dir, snr_threshold=5, detrend_method='biweight', detrend_ws=0, transit_template='tls', run_limit=5, custom_search_algorithm=None, max_period_search=25, oversampling=3, signal_selection_mode='period-epoch')

Given the injection dir, it will iterate over all the csvs matching light curves and try the recovery of their transit parameters (period and epoch).

Parameters:
  • inject_dir – the directory to search for light curves

  • snr_threshold – the SNR value to break the search for each curve

  • detrend_ws – the window size to detrend the curves

  • detrend_method – the algorithm to detrend the curve [gp|biweight]

  • transit_template – whether to use tls or bls

  • run_limit – the number of iterations to break the search if the period and epoch are not found yet

  • custom_search_algorithm – the user-provided search algorithm if any

  • max_period_search – upper limit for the period search

  • oversampling – the oversampling of the search period grid

remove_non_results_files(inject_dir)

Deletes all the files that belong to the injection stage are hence are not necessary for the results interpretation. If preserve was true, nothing is removed.

Parameters:

inject_dir