ramjet.analysis.lightcurve_visualizer

Code for visualizing lightcurves.

Module Contents

plot_lightcurve(times: np.ndarray, fluxes: np.ndarray, labels: np.ndarray = None, predictions: np.ndarray = None, title: str = None, x_label: str = 'Days', y_label: str = 'Flux', x_limits: (float, float) = (None, None), y_limits: (float, float) = (None, None), save_path: Union[Path, str] = None, exclude_flux_outliers: bool = False, base_data_point_size: float = 3)[source]

Plots a lightcurve with a consistent styling. If true labels and/or predictions are included, these will additionally be plotted.

Parameters:
  • times – The times of the measurements.
  • fluxes – The fluxes of the measurements.
  • labels – The binary labels for each time step.
  • predictions – The probability prediction for each time step.
  • title – The title of the plot.
  • x_label – The label for the x axis.
  • y_label – The label for the y axis.
  • x_limits – Optional axis limiting for the x axis.
  • y_limits – Optional axis limiting for the y axis.
  • save_path – The path to save the plot to. If None, the plot will be shown instead.
  • exclude_flux_outliers – Whether or not to exclude flux outlier data points when plotting.
  • base_data_point_size – The size of the data points to use when plotting (and related sizes).
is_outlier(points: np.ndarray, threshold: float = 5)[source]

Uses the median absolute deviation to determine if the input data points are “outliers” for the purpose of plotting.

Parameters:
  • points – The observations to search for outliers in.
  • threshold – The modified z-score to use as a threshold. Observations with a modified z-score based on the median absolute deviation greater than this value will be classified as outliers.