ramjet.photometric_database.lightcurve_collection

Module Contents

Classes

LightcurveCollection(label: Union[float, None] = None, function_to_get_paths: Union[Callable[[], Iterable[Path]], None] = None, function_to_load_times_and_fluxes_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None, function_to_load_times_and_magnifications_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None) A class representing a collection of lightcurves. Used to define how to find, load, and label a set of lightcurves.
exception LightcurveCollectionMethodNotImplementedError[source]

Bases: RuntimeError

An 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(label: Union[float, None] = None, function_to_get_paths: Union[Callable[[], Iterable[Path]], None] = None, function_to_load_times_and_fluxes_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None, function_to_load_times_and_magnifications_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None)[source]

A class representing a collection of lightcurves. Used to define how to find, load, and label a set of lightcurves.

__init__(self, label: Union[float, None] = None, function_to_get_paths: Union[Callable[[], Iterable[Path]], None] = None, function_to_load_times_and_fluxes_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None, function_to_load_times_and_magnifications_from_path: Union[Callable[[Path], Tuple[np.ndarray, np.ndarray]], None] = None)[source]
Parameters:
  • label – The label corresponding to the lightcurves in the collection.
  • function_to_get_paths – A function which returns an iterable of the lightcurve paths.
  • function_to_load_times_and_fluxes_from_path – A function which, given a lightcurve path, will load the times and fluxes of the lightcurve.
  • function_to_load_times_and_magnifications_from_path – A function which, given a lightcurve path, will load the times and magnifications of the lightcurve.
get_paths(self)[source]

Gets the paths for the lightcurves in the collection.

Returns:An iterable of the lightcurve paths.
load_times_and_fluxes_from_path(self, path: Path)[source]

Loads the times and fluxes from a given lightcurve path.

Parameters:path – The path to the lightcurve file.
Returns:The times and the fluxes of the lightcurve.
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 lightcurve/signal file.
Returns:The times and the magnifications of the lightcurve/signal.
static generate_synthetic_signal_from_real_data(fluxes: np.ndarray, times: np.ndarray)[source]

Takes real lightcurve data and converts it to a form that can be used for synthetic lightcurve injection.

Parameters:
  • fluxes – The real lightcurve fluxes.
  • times – The real lightcurve times.
Returns:

Fake synthetic magnifications and times.