wf_psf.plotting.plots_interface
Plot Interface.
An interface module with classes to handle different plot configurations.
- Author:
Jennifer Pollack <jennifer.pollack@cea.fr>
Functions
Define Plot Style. |
|
|
Get Number of Stars. |
|
Make Plot. |
|
Plot model results. |
Classes
|
MetricsPlotHandler class. |
MonochromaticMetricsPlotHandler class. |
|
|
ShapeMetricsPlotHandler class. |
- class wf_psf.plotting.plots_interface.MetricsPlotHandler(plotting_params, metrics, list_of_stars, metric_name, rmse, std_rmse, rel_rmse, plot_title, plots_dir)[source]
Bases:
objectMetricsPlotHandler class.
A class to handle plot parameters for various metrics results.
- Parameters:
id (str) – Class ID name
plotting_params (Recursive Namespace object)
metrics (dict) – Dictionary containing list of metrics
list_of_stars (list) – List containing the number of training stars per run
metric_name (str) – Name of metric
rmse (str) – Root-mean square error label
std_rmse (str) – Standard error on root-mean square error standard label
plots_dir (str) – Output directory for metrics plots
Methods
get_metrics(dataset)Get Metrics.
plot()Plot.
- get_metrics(dataset)[source]
Get Metrics.
A function to get metrics: rmse, rmse_std for each run input, e.g. wf-outputs-xxxxxxxxxxxx.
- ids = ('poly_metrics', 'opd_metrics', 'poly_pixel')
- class wf_psf.plotting.plots_interface.MonochromaticMetricsPlotHandler(plotting_params, metrics_confs, metrics, list_of_stars, plots_dir)[source]
Bases:
objectMonochromaticMetricsPlotHandler class.
A class to handle plot parameters for monochromatic metrics results.
- Parameters:
id (str) – Class ID name
plotting_params (Recursive Namespace object) – RecursiveNamespace object containing plotting parameters
metrics_confs (dict) – Dictionary containing the metric configurations as RecursiveNamespace objects for each run
metrics (list) – Dictionary containing list of metrics
list_of_stars (list) – List containing the number of stars used for each training data set
plots_dir (str) – Output directory for metrics plots
Methods
plot()Plot.
- ids = ('mono_metrics',)
- class wf_psf.plotting.plots_interface.ShapeMetricsPlotHandler(plotting_params, metrics, list_of_stars, plots_dir)[source]
Bases:
objectShapeMetricsPlotHandler class.
A class to handle plot parameters shape metrics results.
- Parameters:
id (str) – Class ID name
plotting_params (Recursive Namespace object) – Recursive Namespace Object containing plotting parameters
metrics (list) – Dictionary containing list of metrics
list_of_stars (list) – List containing the number of stars used for each training data set
plots_dir (str) – Output directory for metrics plots
Methods
make_shape_metrics_plot(rmse_data, ...)Make Shape Metrics Plot.
plot()Plot.
prepare_metrics_data(plot_dataset, ...)Prepare Metrics Data.
- id = 'shape_metrics'
- make_shape_metrics_plot(rmse_data, std_rmse_data, rel_rmse_data, plot_dataset, metric)[source]
Make Shape Metrics Plot.
A function to produce plots for the shape metrics.
- Parameters:
rmse_data (list) – A list of dictionaries where each dictionary stores run as the key and the Root Mean Square Error (rmse).
std_rmse_data (list) – A list of dictionaries where each dictionary stores run as the key and the Standard Deviation of the Root Mean Square Error (rmse) as the value.
rel_rmse_data (list) – A list of dictionaries where each dictionary stores run as the key and the Root Mean Square Error (rmse) relative to the Euclid requirements as the value.
plot_dataset (str) – A string denoting whether metrics are for the train or test datasets.
metric (str) – A string representing the type of shape metric, i.e., e1, e2, or R2.
- prepare_metrics_data(plot_dataset, e1_req_euclid, e2_req_euclid, R2_req_euclid)[source]
Prepare Metrics Data.
A function to prepare the metrics data for plotting.
- Parameters:
plot_dataset (str) – A string representing the dataset, i.e. training or test metrics.
e1_req_euclid (float) – A float denoting the Euclid requirement for the e1 shape metric.
e2_req_euclid (float) – A float denoting the Euclid requirement for the e2 shape metric.
R2_req_euclid (float) – A float denoting the Euclid requirement for the R2 shape metric.
- Returns:
shape_metrics_data – A dictionary containing the shape metrics data from a set of runs.
- Return type:
- wf_psf.plotting.plots_interface.define_plot_style()[source]
Define Plot Style.
A function to set plot_style parameters.
- wf_psf.plotting.plots_interface.get_number_of_stars(metrics)[source]
Get Number of Stars.
A function to get the number of stars used in training the model.
- wf_psf.plotting.plots_interface.make_plot(x_axis, y_axis, y_axis_err, y2_axis, label, plot_title, x_axis_label, y_right_axis_label, y_left_axis_label, filename, plot_show=False)[source]
Make Plot.
A function to generate metrics plots.
- Parameters:
x_axis (list) – x-axis values
y_axis (list) – y-axis values
y_axis_err (list) – Error values for y-axis points
y2_axis (list) – y2-axis values for right axis
label (str) – Label for the points
plot_title (str) – Name of plot
x_axis_label (str) – Label for x-axis
y_left_axis_label (str) – Label for left vertical axis of plot
y_right_axis_label (str) – Label for right vertical axis of plot
filename (str) – Name of file to save plot
plot_show (bool) – Boolean flag to set plot display
- wf_psf.plotting.plots_interface.plot_metrics(plotting_params, list_of_metrics, metrics_confs, plot_saving_path)[source]
Plot model results.
- Parameters:
plotting_params (RecursiveNamespace Object) – Recursive Namespace object containing plot configuration parameters
list_of_metrics (list) – List containing all model metrics
metrics_confs (list) – List containing all metrics configuration parameters
plot_saving_path (str) – Directory path for saving output plots