Skip to content

Commit

Permalink
Merge pull request #62 from noaa-ocs-modeling/feature/assignboundary
Browse files Browse the repository at this point in the history
Add manual boundary specification functionality
  • Loading branch information
SorooshMani-NOAA authored Mar 17, 2023
2 parents f5cfae2 + a16a1bb commit 16e4e00
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 161 deletions.
54 changes: 28 additions & 26 deletions ocsmesh/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ def main(self):
nprocs = -1 if nprocs is None else nprocs

if self._args.geom_cmd == "build":
arg_dict = dict(
dem_files=self._args.dem,
out_file=self._args.output,
out_format=self._args.output_format,
mesh_file=self._args.mesh,
ignore_mesh_final_boundary=self._args.ignore_mesh_boundary,
zmin=self._args.zmin,
zmax=self._args.zmax,
chunk_size=self._args.chunk_size,
overlap=self._args.overlap,
nprocs=nprocs,
out_crs=self._args.output_crs,
base_crs=self._args.mesh_crs)
arg_dict = {
"dem_files": self._args.dem,
"out_file": self._args.output,
"out_format": self._args.output_format,
"mesh_file": self._args.mesh,
"ignore_mesh_final_boundary": self._args.ignore_mesh_boundary,
"zmin": self._args.zmin,
"zmax": self._args.zmax,
"chunk_size": self._args.chunk_size,
"overlap": self._args.overlap,
"nprocs": nprocs,
"out_crs": self._args.output_crs,
"base_crs": self._args.mesh_crs
}
combine_geometry(**arg_dict)

elif self._args.command == 'hfun':
Expand All @@ -45,19 +46,20 @@ def main(self):
nprocs = -1 if nprocs is None else nprocs

if self._args.hfun_cmd == "build":
arg_dict = dict(
dem_files=self._args.dem,
out_file=self._args.output,
out_format=self._args.output_format,
mesh_file=self._args.mesh,
hmin=self._args.hmin,
hmax=self._args.hmax,
contours=self._args.contour,
constants=self._args.constants,
chunk_size=self._args.chunk_size,
overlap=self._args.overlap,
method=self._args.method,
nprocs=nprocs)
arg_dict = {
"dem_files": self._args.dem,
"out_file": self._args.output,
"out_format": self._args.output_format,
"mesh_file": self._args.mesh,
"hmin": self._args.hmin,
"hmax": self._args.hmax,
"contours": self._args.contour,
"constants": self._args.constants,
"chunk_size": self._args.chunk_size,
"overlap": self._args.overlap,
"method": self._args.method,
"nprocs": nprocs
}
combine_hfun(**arg_dict)

elif self._args.command == 'scripts':
Expand Down
2 changes: 1 addition & 1 deletion ocsmesh/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def run(self, sieve=None, quality_metric=1.05):
if output_mesh.tria3['index'].shape[0] == 0:
_err = 'ERROR: Jigsaw returned empty mesh.'
_logger.error(_err)
raise Exception(_err)
raise RuntimeError(_err)

if self._crs is not None:
utils.reproject(output_mesh, self._crs)
Expand Down
Loading

0 comments on commit 16e4e00

Please sign in to comment.