Visualisations¶
DatasetMediaWriter
¶
Write static and video media for the variables in downloaded datasets.
MediaPublisher
¶
Publish static and video plots for a dataset/plot_spec/land_mask context.
idx_date = plot_spec.selected_timestep
instance-attribute
¶
panel_renderer = PanelRenderer(land_mask, replace(training_metadata, model=model_name, trained_epochs=trained_epochs), plot_spec)
instance-attribute
¶
log_static_inputs(inputs, dates, image_loggers, *, prefix=None)
¶
Extract and log static raw input plots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
list[SingleDataset]
|
List of SingleDataset instances containing the input data. |
required |
dates
|
list[datetime]
|
List of datetime objects corresponding to the timesteps in the datasets. |
required |
image_loggers
|
list[SupportsImageLogging]
|
List of image loggers to send the rendered images to. |
required |
prefix
|
str | None
|
Optional prefix for the log path to namespace the logged images. |
None
|
log_static_outputs(outputs, image_loggers, *, channel_names=None, climatology=None, compare_truth_climatology=False, forecast_dates, history_dates, prefix=None, uncertainties=None)
¶
Create and log static output plots, including climatology when available.
When a matching entry is present, also logs a standardised uncertainty (z-score) plot and a calendar-day-mean (climatology) map for the plotted date and channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outputs
|
ModelStepOutput
|
ModelStepOutput containing the ground truth and prediction arrays. |
required |
image_loggers
|
list[SupportsImageLogging]
|
List of image loggers to send the rendered images to. |
required |
channel_names
|
list[str] | None
|
Optional list of channel names corresponding to the output channels. |
None
|
climatology
|
ArrayTCHW | None
|
Optional climatology array for the output channels. |
None
|
compare_truth_climatology
|
bool
|
Whether to also log a ground-truth/climatology/
difference triplet, with a plain "on |
False
|
forecast_dates
|
list[datetime]
|
List of forecast dates corresponding to the output timesteps. |
required |
history_dates
|
list[datetime]
|
List of history dates corresponding to the output timesteps. |
required |
prefix
|
str | None
|
Optional prefix for the log path to namespace the logged images. |
None
|
uncertainties
|
dict[int, ArrayTHW] | None
|
Optional dictionary mapping channel indices to uncertainty arrays for the output channels. |
None
|
log_video_inputs(inputs, dates, video_loggers, *, prefix=None)
¶
Extract and log raw input videos.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
list[SingleDataset]
|
List of SingleDataset instances containing the input data. |
required |
dates
|
list[datetime]
|
List of datetime objects corresponding to the timesteps in the datasets. |
required |
video_loggers
|
list[SupportsVideoLogging]
|
List of video loggers to send the rendered videos to. |
required |
prefix
|
str | None
|
Optional prefix for the log path to namespace the logged videos. |
None
|
log_video_outputs(outputs, video_loggers, *, channel_names=None, climatology=None, forecast_dates, history_dates, compare_truth_climatology=False, prefix=None, uncertainties=None)
¶
Create and log output videos.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outputs
|
ModelStepOutput
|
ModelStepOutput containing the ground truth and prediction arrays. |
required |
video_loggers
|
list[SupportsVideoLogging]
|
List of video loggers to send the rendered videos to. |
required |
channel_names
|
list[str] | None
|
Optional list of channel names corresponding to the output channels. |
None
|
climatology
|
ArrayTCHW | None
|
Optional climatology array for the output channels. |
None
|
forecast_dates
|
list[datetime]
|
List of forecast dates corresponding to the output timesteps. |
required |
history_dates
|
list[datetime]
|
List of history dates corresponding to the output timesteps. |
required |
compare_truth_climatology
|
bool
|
Whether to also log a ground-truth/climatology/
difference triplet, with a plain "on |
False
|
prefix
|
str | None
|
Optional prefix for the log path to namespace the logged videos. |
None
|
uncertainties
|
dict[int, ArrayTHW] | None
|
Optional dictionary mapping channel indices to uncertainty arrays for the output channels. |
None
|
register_animation_backends()
¶
Register the ImageIO FFMPEG animation backend.