I added a new Python script, oceanmesh/subset_mesh.py. It contains 11 functions, but for doing the subset of a mesh (fort.14) you only need to call subsetMesh. This last function calls the rest. I didn't provide a conda yml file, but the versions of the main packages are:
Pandas version: 1.4.3
Numpy version: 1.24.3
Rtree version: 1.0.1
Matplotlib version: 3.7.1
Geopandas version: 0.13.0
Shapely version: 2.0.1
The workflow follows the next steps:
Reads the original fort.14 nodes as a dataframe with readNodes
Reads the mask shapefile as a geopandas GeoDataFrame with readSubDomain (polygon covering the area we want to remove)
Removes the elements with centroid inside the mask and renumber the nodes with subsetMeshGdf
Reads the boundary conditions of the original fort.14 file with readOrgBC
Renumber the ocean boundary nodes with renumOceanBC
Renumber the closed land boundary (islands) nodes with renumClosedBCs
Renumber the mainland boundary nodes with renumMainlandBC
I added a new Python script,
oceanmesh/subset_mesh.py
. It contains 11 functions, but for doing the subset of a mesh (fort.14) you only need to callsubsetMesh
. This last function calls the rest. I didn't provide a conda yml file, but the versions of the main packages are:The workflow follows the next steps:
readNodes
readSubDomain
(polygon covering the area we want to remove)subsetMeshGdf
readOrgBC
renumOceanBC
renumClosedBCs
renumMainlandBC
writeFort14
Thanks, Tomas