Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multiple topologies #497

Open
3 of 6 tasks
veenstrajelmer opened this issue Aug 3, 2023 · 0 comments
Open
3 of 6 tasks

support for multiple topologies #497

veenstrajelmer opened this issue Aug 3, 2023 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Aug 3, 2023

Todo:

Usecase is GTSM + rivers:
image

Additional 1D issue (network is 2D saved as 1D), but add_network_cellinfo was added:

file_nc = r'p:\1230882-emodnet_hrsm\GTSMv5.0\grid\gtsm_200s_5000m_eu5000m_ca5000m_v4_net.nc'
uds = xu.open_dataset(file_nc)
# uds_sel = uds.ugrid.to_nonperiodic(xmax=180) # TODO: raises "AttributeError: 'Ugrid1d' object has no attribute 'to_nonperiodic'"
uds_sel = uds.ugrid.sel(x=slice(-75, 2.5), y=slice(10, 60)) #TODO: does not subset

Plot gtsm partitioned mapoutput (requires xugrid 0.9.0):

import matplotlib.pyplot as plt
plt.close("all")
import dfm_tools as dfmt

file_nc = r'p:\1230882-emodnet_hrsm\GTSMv5.0\SO_NHrivGTSM\computations\BD014_fix_mapformat4\output\gtsm_model_0*_map.nc'
uds = dfmt.open_partitioned_dataset(file_nc, remove_edges=False, remove_ghost=False)

fig,ax = plt.subplots()
uds.grids[0].plot(ax=ax)
uds.grids[1].plot(ax=ax, edgecolor='crimson')

# re-adjust axis limits
x_min = min([x.bounds[0] for x in uds.grids])
y_min = min([x.bounds[1] for x in uds.grids])
x_max = max([x.bounds[2] for x in uds.grids])
y_max = max([x.bounds[3] for x in uds.grids])
ax.set_ylim(y_min, y_max)
ax.set_xlim(x_min, x_max)

# plot improvements
dfmt.plot_coastlines(zorder=2, min_area=50)
dfmt.plot_borders()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant