Add Custom Grids#

Step 1.1: Horizontal Grid#

from CrocoDash.grid import Gridx

grid = Grid.from_supergrid("<HGRID_TRIMMED>")

Step 1.2: Topography#

from CrocoDash.topo import Topo

bathymetry_path='<BATHY_FILE>'

topo = Topo.from_topo_file(
    grid = grid,
    topo_file_path=bathymetry_path,
    min_depth = 5,
)
topo.depth.plot()

Step 1.3: Vertical Grid#

from CrocoDash.vgrid import VGrid

vgrid_path='<YOUR_VGRID_PATH>'

vgrid  = VGrid.from_file(vgrid_path)
import matplotlib.pyplot as plt
# Create the plot
for depth in vgrid.z:
    plt.axhline(y=depth, linestyle='-')  # Horizontal lines

plt.ylim(max(vgrid.z) + 10, min(vgrid.z) - 10)  # Invert y-axis so deeper values go down
plt.ylabel("Depth")
plt.title("Vertical Grid")
plt.show()
../../_images/c67681181aa3196b1752d44d3a4ce77da96580ea82819a2d39e476d8d715db49.png