model_proxy_from_results#
- model_proxy_from_results(ds)#
Create a lightweight model proxy from a self-contained results Dataset.
The proxy satisfies the interface required by plotting functions (
plot_bmd(),plot_sfd(), etc.) so that results saved to NetCDF can be visualised without the originalOspGrillageobject.- Parameters:
ds (
xarray.Dataset) – Dataset loaded viaxarray.open_dataset(). Must contain anode_coordinatesvariable andmember_elements/model_typeattributes (added automatically byget_results()).- Returns:
A proxy object with
get_nodes(),get_element(), andcommon_grillage_element_z_groupmatching the OspGrillage interface.- Raises:
KeyError – If the Dataset is missing the required geometry data.
Example:
import xarray as xr import ospgrillage as og ds = xr.open_dataset("results.nc") proxy = og.model_proxy_from_results(ds) og.plot_bmd(proxy, ds, backend="plotly")