photometric_database.cube_database

Code for representing a dataset of TESS data cubes for binary classification.

Module Contents

class CubeDatabase(positive_data_directory: str, negative_data_directory: str, positive_to_negative_data_ratio: float = None)[source]

A representing a dataset of TESS data cubes for binary classification.

__init__(self, positive_data_directory: str, negative_data_directory: str, positive_to_negative_data_ratio: float = None)[source]
generate_datasets(self)[source]

Generates the training and testing datasets.

load_and_preprocess_numpy_file(self, file_path: tf.Tensor, label: int)[source]

Loads numpy files from the tensor alongside labels.

preprocess_cube(self, cube: np.ndarray)[source]

Slices and normalizes cubes.

static augment_cube(cube: np.ndarray)[source]

Augments the data with random rotations and flipping.

static remove_bad_files(file_path_list: List[str])[source]

Removes problematic cubes (all values the same, containing infinite or NaN values).

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

Shuffle two arrays in unison.

enforce_data_ratio(self, positive_examples, negative_examples)[source]

Repeats examples to enforce a given training ratio.