utils module#

class utils.DictTable(list, keys=['Norm RMSD', 'Norm Correlation', 'Norm Quadratic Error (%)', 'Norm Explained Variance (%)', 'Number of Points'])#

Bases: object

Overridden dict class which takes a list of dictionaries and renders an HTML Table in IPython Notebook.

Parameters:

list (list) – A list of dictionaries, where each dictionary contains ‘path’, ‘type_stat’, and ‘name’ keys.

html_table#

HTML representation of the table.

Type:

str

_repr_html_():

Returns the HTML representation of the table.

Example

# Usage Example: table = DictTable(list_of_dicts) table_html = table._repr_html_()

utils.movie_intercomp(ds_maps_list, methods=['DUACS'], name_var='uv', dir_output='../results/', region='Agulhas', framerate=24, colsize=14)#

Create and save an intercomparison movie from a list of xarray datasets.

Parameters:
  • ds_maps_list (list) – A list of xarray datasets, each containing map data.

  • methods (list, optional) – List of method names. Default is [‘DUACS’].

  • name_var (str, optional) – Name of the variable to plot. Default is ‘uv’.

  • dir_output (str, optional) – Output directory to save frames and movie. Default is ‘../results/’.

  • region (str, optional) – Region name for the movie title. Default is ‘Agulhas’.

  • framerate (int, optional) – Frame rate of the movie. Default is 24.

  • colsize (int, optional) – Width of the plot in inches. Default is 14.

Returns:

IPython displayable video object.

Return type:

Video

utils.print_json(path_json)#