ramjet.photometric_database.light_curve_collection¶
Code for representing a collection of light curves.
Module Contents¶
Classes¶
LightCurveCollection |
A class representing a collection of light curves. Used to define how to find, load, and label a set of light |
-
exception
LightCurveCollectionMethodNotImplementedError[source]¶ Bases:
RuntimeErrorAn error to raise if a collection method that is not implemented is attempted to be used. Note, the standard NotImplementedError is not supposed to be used for cases when non-implemented functions are meant to be allowed, which is why a custom class is needed.
-
class
LightCurveCollection[source]¶ A class representing a collection of light curves. Used to define how to find, load, and label a set of light curves.
Variables: - label – The default label to be used if the load_label_from_path method is not overridden.
- paths – The default list of paths to be used if the get_paths method is not overridden.
-
get_paths(self)[source]¶ Gets the paths for the light curves in the collection.
Returns: An iterable of the light curve paths.
-
load_times_and_fluxes_from_path(self, path: Path)[source]¶ Loads the times and fluxes from a given light curve path.
Parameters: path – The path to the light curve file. Returns: The times and the fluxes of the light curve.
-
load_times_and_magnifications_from_path(self, path: Path)[source]¶ Loads the times and magnifications from a given path as an injectable signal.
Parameters: path – The path to the light curve/signal file. Returns: The times and the magnifications of the light curve/signal.
-
static
generate_synthetic_signal_from_real_data(fluxes: np.ndarray, times: np.ndarray)[source]¶ Takes real light curve data and converts it to a form that can be used for synthetic light curve injection.
Parameters: - fluxes – The real light curve fluxes.
- times – The real light curve times.
Returns: Fake synthetic magnifications and times.
-
load_label_from_path(self, path: Path)[source]¶ Loads the label of an example from a corresponding path.
Parameters: path – The path to load the label for. Returns: The label.
-
static
shuffle_and_split_paths(paths: List[Path], dataset_splits: List[int], number_of_splits: int = 10)[source]¶ Repeatably shuffles a list of paths and then gets the requested dataset splits from that list of paths. Designed to allow splitting a list of paths into training, validation, and testing datasets easily.
Parameters: - paths – The original list of paths.
- dataset_splits – The indexes of the dataset splits to return.
- number_of_splits – The number of dataset splits.
Returns: The paths of the dataset splits.
-
load_times_fluxes_and_flux_errors_from_path(self, path: Path)[source]¶ Loads the times, fluxes, and flux errors of a light curve from a path to the data. Unless overridden, defaults to using the method to load only the times and fluxes, and returns None for errors.
Parameters: path – The path of the file containing the light curve data. Returns: The times, fluxes, and flux errors.
-
load_times_magnifications_and_magnification_errors_from_path(self, path: Path)[source]¶ Loads the times, magnifications, and magnification_errors of a light curve from a path to the data. Unless overridden, defaults to using the method to load only the times and magnifications, and returns None for magnification errors.
Parameters: path – The path of the file containing the light curve data. Returns: The times, magnifications, and magnification errors.