ramjet.photometric_database.lightcurve_database

Code for a base generalized database for photometric data to be subclassed.

Module Contents

class LightcurveDatabase(data_directory='data')[source]

Bases: abc.ABC

A base generalized database for photometric data to be subclassed.

__init__(self, data_directory='data')[source]
log_dataset_file_names(self, dataset: tf.data.Dataset, dataset_name: str)[source]

Saves the names of the files used in a dataset to a CSV file in the trail directory.

static normalize(lightcurve: np.ndarray)[source]

Normalizes from 0 to 1 on the logarithm of the lightcurve.

static shuffle_in_unison(a, b, seed=None)[source]

Shuffle two arrays in unison.

static remove_random_values(lightcurve: np.ndarray)[source]

Removes random values from the lightcurve.

get_ratio_enforced_dataset(self, positive_training_dataset: tf.data.Dataset, negative_training_dataset: tf.data.Dataset, positive_to_negative_data_ratio: float)[source]

Generates a dataset with an enforced data ratio.

static repeat_dataset_to_size(dataset: tf.data.Dataset, size: int)[source]

Repeats a dataset to make it a desired length.

is_positive(self, example_path)[source]

Checks if an example contains a microlensing event or not.

Parameters:example_path – The path to the example to check.
Returns:Whether or not the example contains a microlensing event.
static make_uniform_length(example: np.ndarray, length: int)[source]

Makes the example a specific length, by clipping those too large and repeating those too small.

get_training_and_validation_datasets_for_file_paths(self, example_paths: List[Union[str, Path]])[source]

Creates a TensorFlow Dataset from a list of file names and desired label for those files.