sherlockpipe.search.sherlock.Sherlock

class sherlockpipe.search.sherlock.Sherlock(sherlock_targets: List[SherlockTarget], explore: bool = False, update_ois: bool = False, update_force: bool = False, update_clean: bool = False, cache_dir: str = '/home/docs/', results_dir: str = None)

Bases: object

Main SHERLOCK PIPEline class to be used for loading input, setting up the running parameters and launch the analysis of the desired TESS, Kepler, K2 or csv objects light curves.

__init__(sherlock_targets: List[SherlockTarget], explore: bool = False, update_ois: bool = False, update_force: bool = False, update_clean: bool = False, cache_dir: str = '/home/docs/', results_dir: str = None)

Initializes a Sherlock object, loading the OIs from the csvs, setting up the detrend and transit configurations, storing the provided object_infos list and initializing the builders to be used to prepare the light curves for the provided object_infos.

Parameters:
  • update_ois (bool) – Flag to signal SHERLOCK for updating the TOIs, KOIs and EPICs

  • sherlock_targets (List[SherlockTarget]) – a list of objects information to be analysed

  • explore (bool) – whether to only run the prepare stage for all objects

  • update_ois – whether ois files should be updated

  • update_force (bool) – whether a complete update of metadata should be done

  • update_clean (bool) – whether current metadata should be wiped-out before update

  • cache_dir (str) – directory to store caches for sherlock.

  • results_dir (str) – directory to store results

Methods

__init__(sherlock_targets[, explore, ...])

Initializes a Sherlock object, loading the OIs from the csvs, setting up the detrend and transit configurations, storing the provided object_infos list and initializing the builders to be used to prepare the light curves for the provided object_infos.

filter_high_snr_long_period_ois()

Filters the in-memory OIs given some basic filters associated to big and long-period targets.

filter_hj_ois()

Filters the in-memory OIs given some basic filters associated to hot jupiters properties.

filter_multiplanet_ois()

Filters the in-memory OIs given some basic filters associated to multiplanet targets.

filter_ois(function)

Applies a function accepting the Sherlock objects of interests dataframe and stores the result into the Sherlock same ois dataframe.

filter_short_period_ois()

Filters the in-memory OIs given some basic filters associated to big and long-period targets.

limit_ois([offset, limit])

Limits the in-memory loaded OIs given an offset and a limit (like a pagination)

load_ois(refresh_ois, refresh_force, ...)

Loads the csv OIs files into memory

noise(time, flux, signal_power)

Computes the signal-to-noise ratio from the periodogram and Welch power spectrum.

refresh_ois()

Downloads the TOIs, KOIs and EPIC OIs into csv files.

run([all_targets_properties])

Entrypoint of Sherlock which launches the main execution for all the input object_infos

run_multiprocessing(n_processors, func, ...)

Helper to execute a function over a list of inputs using a multiprocessing pool.

setup_files(refresh_ois, refresh_force, ...)

Loads the objects of interest data from the downloaded CSVs.

Attributes

MASK_MODES

NUMBERS_REGEX

NUM_CORES

OBJECT_ID_REGEX

RESULTS_DIR

VALID_DETREND_METHODS

VALID_PERIODIC_DETREND_METHODS

config_step

ois

report

run_ois

time_reports

transits_min_count

use_ois

wl_max

wl_min

class KoiInput(star_id, kic_id)

Bases: object

Input container for a Kepler Object of Interest (KOI) to be processed by SHERLOCK.

filter_high_snr_long_period_ois()

Filters the in-memory OIs given some basic filters associated to big and long-period targets. This method is added as an example

Returns:

the Sherlock object itself

filter_hj_ois()

Filters the in-memory OIs given some basic filters associated to hot jupiters properties. This method is added as an example

Returns:

the Sherlock object itself

filter_multiplanet_ois()

Filters the in-memory OIs given some basic filters associated to multiplanet targets. This method is added as an example

Returns:

the Sherlock object itself

filter_ois(function)

Applies a function accepting the Sherlock objects of interests dataframe and stores the result into the Sherlock same ois dataframe.

Parameters:

function – the function to be applied to filter the Sherlock OIs.

Returns:

the Sherlock object itself

filter_short_period_ois()

Filters the in-memory OIs given some basic filters associated to big and long-period targets. This method is added as an example

Returns:

the Sherlock object itself

limit_ois(offset=0, limit=0)

Limits the in-memory loaded OIs given an offset and a limit (like a pagination)

Parameters:
  • offset – the position where the subset must start

  • limit – maximum number of ois to be returned

Returns:

the Sherlock object itself

load_ois(refresh_ois, refresh_force, refresh_clean)

Loads the csv OIs files into memory

Returns:

the Sherlock object itself

noise(time, flux, signal_power)

Computes the signal-to-noise ratio from the periodogram and Welch power spectrum.

Parameters

timenumpy.ndarray

Time array (unused, retained for interface compatibility).

fluxnumpy.ndarray

Flux measurements.

signal_powerfloat

The signal power to compare against.

Returns

float

The SNR computed from the periodogram.

refresh_ois()

Downloads the TOIs, KOIs and EPIC OIs into csv files.

Returns:

the Sherlock object itself

run(all_targets_properties: dict = None)

Entrypoint of Sherlock which launches the main execution for all the input object_infos

run_multiprocessing(n_processors, func, func_input)

Helper to execute a function over a list of inputs using a multiprocessing pool.

Parameters

n_processorsint

Number of worker processes.

funccallable

The function to map over inputs.

func_inputlist

List of inputs for the function.

Returns

list

Results of func applied to each input element.

setup_files(refresh_ois, refresh_force, refresh_clean, results_dir=None)

Loads the objects of interest data from the downloaded CSVs.

Parameters:
  • refresh_ois – Flag update the TOIs, KOIs and EPICs

  • results_dir – Stores the directory to be used for the execution.

Returns:

the Sherlock object itself