Config Loader

The module config_loader is responsible for loading configuration files, handling various formats and ensuring that configuration data is easily accessible throughout the application.

config_loader.load_config(config_file)[source]

Load a configuration file using the configparser library.

Parameters:

config_file (str) – The path to the configuration file that needs to be loaded.

Returns:

A ConfigParser object containing the configuration settings from the specified file.

Return type:

configparser.ConfigParser

Pickle Data

The module pickle_data serialises and deserialises the preprocessed HARPS and ESPRESSO dataset using pickle.

pickle_data.clean_and_pickle(espresso_path: str, harps_path: str, pickle_path: str)[source]

Cleans the data from the ESPRESSO and HARPS instruments and pickles the results.

Parameters:
  • espresso_path (str) – File path for the ESPRESSO data file.

  • harps_path (str) – File path for the HARPS data file.

  • pickle_path (str) – Destination path to save the pickled data.

Notes

The function adjusts time values, filters out specific time points and handles missing values according to those specifified in D. S. Demangeon et al. (2021). The cleaned data is then saved into a pickle file format for persistence.

pickle_data.unpickle_data(filepath)[source]

Loads data from a pickle file.

Parameters:

filepath (str) – Path to the pickle file to be loaded.

Returns:

data – A dictionary containing the data loaded from the pickle file.

Return type:

dict

Raises:
  • FileNotFoundError – If the specified file does not exist.

  • EOFError – If the file is empty or improperly formatted, indicating end of file reached without any data.

  • Exception – For other issues that might occur during the loading process.

Periodogram

The module periodogram includes functions that calculate and plot the periodograms of the data.

periodograms.compute_periodogram(time, data, min_frequency=0.002025227467386652, max_frequency=0.5177264355163222, samples_per_peak=3000, ESPRESSO=False)[source]

Compute the Lomb-Scargle periodogram for given data and time arrays.

Parameters:

time (array): Time data points. data (array): Data points corresponding to time. min_frequency (float): Minimum frequency to analyze. max_frequency (float): Maximum frequency to analyze. samples_per_peak (int): Number of samples per peak for the analysis. ESPRESSO (bool): Flag to indicate whether data is from ESPRESSO or not (default False).

Returns:

tuple: Tuple containing frequency array, power array, and FAP thresholds.

periodograms.convert_to_days(frequency_in_microhertz)[source]

Convert frequency from microhertz to days.

Parameters:

frequency_in_microhertz (float): Frequency in microhertz.

Returns:

float: Frequency in days.

periodograms.convert_to_microhertz(frequency_in_days)[source]

Convert frequency from days to microhertz.

Parameters:

frequency_in_days (float): Frequency in days.

Returns:

float: Frequency in microhertz.

periodograms.frequency_to_period(frequency)[source]

Convert frequency to period.

Parameters:

frequency (float): Frequency in microhertz.

Returns:

float: Period in days.

periodograms.plot_periodogram(time, data, activity_indices, true_periods, period_colors, min_frequency=0.002025227467386652, max_frequency=0.5177264355163222, samples_per_peak=3000, ESPRESSO=False)[source]

Generate periodogram plots for the given data.

Parameters:

time (array): Time data points. data (DataFrame): Data containing the activity indices. activity_indices (list): List of indices to be plotted. true_periods (list): True periods for reference lines. period_colors (list): Colors for the reference lines. min_frequency (float): Minimum frequency to analyze. max_frequency (float): Maximum frequency to analyze. samples_per_peak (int): Number of samples per peak for the analysis. ESPRESSO (bool): Flag to indicate whether data is from ESPRESSO or not (default False).

Raises:

ValueError: If time or data arrays are empty. RuntimeError: If computation of periodograms fails.

periodograms.run_periodogram_plot(filepath, ESPRESSO=True)[source]

Run plotting for given instrument data.

Prior Transforms

The module prior_transforms includes functions that map unit hyper-cube to actual parameter values, in accordance with format required by PyMultiNest.

prior_transforms.gaussian(theta, mu, sigma)[source]

Transforms a uniform variable into a Gaussian distributed variable.

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • mu (float) – Mean of the desired Gaussian distribution.

  • sigma (float) – Standard deviation of the desired Gaussian distribution.

Returns:

A value sampled from a Gaussian distribution.

Return type:

float

prior_transforms.half_gaussian(theta, sigma)[source]

Transforms a uniform variable into a half-Gaussian distributed variable.

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • sigma (float) – Standard deviation of the desired half-Gaussian distribution.

Returns:

A value sampled from a half-Gaussian distribution.

Return type:

float

prior_transforms.jeffreys(theta, a, b)[source]

Transforms a uniform variable into a value sampled from a Jeffreys prior (log-uniform distribution).

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • a (float) – Lower bound of the distribution.

  • b (float) – Upper bound of the distribution.

Returns:

A value sampled from a log-uniform distribution spanning [a, b].

Return type:

float

prior_transforms.kipping_beta(theta)[source]

Transforms a uniform variable into a value sampled from a Kipping Beta distribution.

Parameters:

theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

Returns:

A value sampled from a Beta distribution as defined by Kipping (2013) with shape parameters.

Return type:

float

prior_transforms.modjeffreys(theta, a, b)[source]

Transforms a uniform variable into a value sampled from a modified Jeffreys prior.

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • a (float) – Knee location of the distribution.

  • b (float) – Upper bound of the distribution.

Returns:

A value sampled from a modified log-uniform distribution.

Return type:

float

prior_transforms.rayleigh(theta, sigma)[source]

Transforms a uniform variable into a value sampled from a truncated Rayleigh distribution.

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • sigma (float) – Scale parameter of the Rayleigh distribution.

Returns:

A value sampled from a Rayleigh distribution.

Return type:

float

prior_transforms.uniform(theta, a, b)[source]

Transforms a uniform variable into another uniformly distributed variable over [a, b].

Parameters:
  • theta (float) – Uniformly distributed variable [0, 1] from the unit hypercube.

  • a (float) – Lower bound of the target uniform distribution.

  • b (float) – Upper bound of the target uniform distribution.

Returns:

A value uniformly distributed between [a, b].

Return type:

float

L98-59 Model

The module l9859_model is a class responsible modelling the L98-59 system.

Run L98-59

The module run_l9859 is the function used to run the L98-59 model.