easy_vic_build.tools.plot_func.plot_evaluation

Plot utilities for VIC evaluation and multi-model comparison.

Functions

plot_VIC_performance(cali_result, verify_result)

Plot calibration and verification performance of VIC streamflow.

plot_multimodel_comparison_distributed_OUTPUT(...)

Plot event hydrograph and distributed runoff/baseflow comparison.

plot_multimodel_comparison_scatter(...[, ...])

Plot multi-model scatter comparison for total/low/high flow.

plot_params(params_dataset)

Plot key VIC parameters in a 2x2 panel.

taylor_diagram(obs, models, model_names, ...)

Create a Taylor diagram for model-to-observation comparison.

easy_vic_build.tools.plot_func.plot_evaluation.plot_VIC_performance(cali_result, verify_result)[source]

Plot calibration and verification performance of VIC streamflow.

Parameters:
  • cali_result (pandas.DataFrame) – Calibration dataframe containing observed and simulated discharge.

  • verify_result (pandas.DataFrame) – Verification dataframe containing observed and simulated discharge.

Returns:

(fig, axes) where axes contains four subplot axes.

Return type:

tuple

easy_vic_build.tools.plot_func.plot_evaluation.taylor_diagram(obs, models, model_names, names_ha, names_va, model_colors=None, model_markers=None, title='Standard Taylor Diagram', fig=None, ax=None, add_text=True)[source]

Create a Taylor diagram for model-to-observation comparison.

Parameters:
  • obs (ndarray) – Observed data array.

  • models (list of ndarray) – Simulated model arrays.

  • model_names (list of str) – Display names for each model.

  • names_ha (list of str) – Horizontal text alignment for model labels.

  • names_va (list of str) – Vertical text alignment for model labels.

  • model_colors (list, optional) – Colors for model points.

  • model_markers (list, optional) – Marker styles for model points.

  • title (str, optional) – Plot title.

  • fig (matplotlib.figure.Figure, optional) – Existing figure.

  • ax (matplotlib.axes.Axes, optional) – Existing polar axes.

  • add_text (bool, optional) – Whether to annotate model names near points.

Returns:

(fig, ax) of the Taylor diagram.

Return type:

tuple

Examples

simulated_datasets = [simulated_dataset_12km, simulated_dataset_8km, simulated_dataset_6km]
params_dataset_level0_sets = [params_dataset_level0_12km, params_dataset_level0_8km, params_dataset_level0_6km]
params_dataset_level1_sets = [params_dataset_level1_12km, params_dataset_level1_8km, params_dataset_level1_6km]
model_names = ["12km ", "8km ", "6km "]
model_colors = ["red", "blue", "green"]
cali_names_ha = ["left", "right", "left"]  # {"center", "right", "left"}
cali_names_va = ["bottom", "top", "bottom"]  # {"center", "top", "bottom", "baseline", "center_baseline"}
verify_names_ha = ["left", "right", "left"]
verify_names_va = ["bottom", "top", "bottom"]

obs_cali = cali_result_12km["obs_cali discharge(m3/s)"].values
obs_verify = verify_result_12km["obs_verify discharge(m3/s)"].values
obs_total = np.concatenate([obs_cali, obs_verify])
models_cali = [cali_result["sim_cali discharge(m3/s)"].values for cali_result in cali_results]
models_verify = [verify_result["sim_verify discharge(m3/s)"].values for verify_result in verify_results]
models_total = [np.concatenate([models_cali[i], models_verify[i]]) for i in range(len(models_cali))]

fig_taylor = plt.figure(figsize=(12, 6))
fig_taylor.subplots_adjust(left=0.08, right=0.92, bottom=0.01, top=0.9, wspace=0.3)
ax1 = fig_taylor.add_subplot(121, projection="polar")
ax2 = fig_taylor.add_subplot(122, projection="polar")

fig_taylor, ax1 = taylor_diagram(
    obs_cali,
    models_cali,
    model_names,
    cali_names_ha,
    cali_names_va,
    model_colors=model_colors,
    title="(a) Calibration",
    fig=fig_taylor,
    ax=ax1,
)
fig_taylor, ax2 = taylor_diagram(
    obs_verify,
    models_verify,
    model_names,
    verify_names_ha,
    verify_names_va,
    model_colors=model_colors,
    title="(b) Verification",
    fig=fig_taylor,
    ax=ax2,
)
easy_vic_build.tools.plot_func.plot_evaluation.plot_multimodel_comparison_scatter(obs_total, models_total, model_names, model_colors=None)[source]

Plot multi-model scatter comparison for total/low/high flow.

Parameters:
  • obs_total (numpy.ndarray) – Observed streamflow series.

  • models_total (list of numpy.ndarray) – Simulated streamflow series for multiple models.

  • model_names (list of str) – Names corresponding to models_total.

  • model_colors (list, optional) – Plot colors for each model.

Returns:

(fig, axes) with three scatter subplots.

Return type:

tuple

easy_vic_build.tools.plot_func.plot_evaluation.plot_multimodel_comparison_distributed_OUTPUT(cali_results, verify_results, simulated_datasets, MeteForcing_df, model_names, model_colors, event_period, rising_period, recession_period)[source]

Plot event hydrograph and distributed runoff/baseflow comparison.

Parameters:
  • cali_results (list of pandas.DataFrame) – Calibration result tables.

  • verify_results (list of pandas.DataFrame) – Verification result tables.

  • simulated_datasets (list of netCDF4.Dataset) – VIC simulation datasets used for distributed outputs.

  • MeteForcing_df (pandas.DataFrame) – Meteorological forcing dataframe containing precipitation.

  • model_names (list of str) – Model names.

  • model_colors (list of str) – Colors for each model.

  • event_period (tuple of str) – Event start/end date.

  • rising_period (tuple of str) – Rising-limb start/end date.

  • recession_period (tuple of str) – Recession-limb start/end date.

Returns:

Figure containing hydrograph and distributed maps.

Return type:

matplotlib.figure.Figure

easy_vic_build.tools.plot_func.plot_evaluation.plot_params(params_dataset)[source]

Plot key VIC parameters in a 2x2 panel.

Parameters:

params_dataset (Dataset) – NetCDF-like dataset containing infilt, Ws, Ds, and Dsmax plus lat/lon coordinates.

Returns:

(fig, axes) for the parameter maps.

Return type:

tuple