Command Line Tools

sch

schimpy CLI tools for pre- and post- processing for SCHISM and data processing.

Usage

sch [OPTIONS] COMMAND [ARGS]...

Options

-h, --help

Show this message and exit.

batch-metrics-cli

Command line interface for generating metrics plots.

MAIN_INPUTFILE: Path to the main input YAML file.

Usage

sch batch-metrics-cli [OPTIONS] MAIN_INPUTFILE

Options

-h, --help

Show this message and exit.

Arguments

MAIN_INPUTFILE

Required argument

bctide-cli

Create SCHISM bctides.in files from MAIN_YAML.

MAIN_YAML names the mesh and lists one entry per bctides file to write:

mesh:
mesh_inputfile: ./hgrid.gr3
open_boundaries: !include open_boundary.yaml # optional
bctides:
include:
- bctides.in.2d.yaml
- bctides.in.3d.yaml

Each bctides entry is written to the file given by its name. The boundary assignment chosen for every open boundary is logged.

Example:
bctide main_bctides.yaml

Usage

sch bctide-cli [OPTIONS] MAIN_YAML

Options

--logdir <logdir>

Directory for a log file.

--debug

Enable debug logging.

--quiet

Suppress console logging.

-h, --help

Show this message and exit.

Arguments

MAIN_YAML

Required argument

clip-dems-cli

Trim each DEM on a prioritized list. The coordinates used for clipping is supplied either directly as an upper left and lower right coordinate or indirectly using the bounding coordinates of a sample image. In practice this script is usually used with images saved from SMS.

Arguments:

DEMLIST file containing prioritized (high to low) list of dems.

Usage

sch clip-dems-cli [OPTIONS] DEMLIST

Options

--coords <coords>

Bounding coordinates to which DEMs will be clipped (upper left x, y, lower right x, y).

--image <infile>

Image or DEM used to infer bounding coordinates for clipping. Use jpeg for the image. This argument is mutually exclusive with –coords. If a sample is provided its upper left and lower right corner will be used.

--prefix <prefix>

Prefix used for output file names.

--outformat <outformat>

Output format, default is AAIGrid (ArcInfo ASCII).

--verbose

Enable verbose output.

--hshift

(Deprecated) Shift DEM by half cell for applications that incorrectly interpret the location of the origin and data centering of a DEM. This is a bug fix for SMS < 11.1

--merge

Merge all clipped DEMs into a single output file, respecting priority order (higher priority DEMs overwrite lower priority where they overlap).

-h, --help

Show this message and exit.

Arguments

DEMLIST

Required argument

combine-consume-cli

Usage

sch combine-consume-cli [OPTIONS]

Options

--start <start>

Required start date of simulation in format like yyyy-mm-dd

--dir <dir>

directory in which output will be processed

--fbase <fbase>

File base name. This will either be ‘schout.nc’ or a list of files like ‘elev.61,hvel.64,salt.63’.

--hotstart

Combine hotstart in addition to fbase

--hotstart_only

Only combine hotstart – avoids file search errors when nothing left to combine

--consume

Delete combined files or unrequested files

--assume_done

Assume that the simulation is finished, so incomplete blocks can be deleted

--combiner <combiner>

Executable for combine_output.

--hot_combiner <hot_combiner>

Executable for combine_output.

--sndx <sndx>

First index to consider for processing.

--endx <endx>

Last index to consider for processing.

--sndx_hot <sndx_hot>

First index to consider for processing.

--endx_hot <endx_hot>

Last index to consider for processing.

--datefile <datefile>

File containing list of dates. Each line can have a single date or comma-separated pair indicating block start and end. Blank lines are ignored and # is comment character that can comment the entire line or be placed at the side of a line after the date(s).

--blocks_per_day <blocks_per_day>

Blocks used to store 1 day worth of output.

contour-smooth-cli

Uses the min-max curvature flow algorithm of Malladi and Sethian to simplify DEM topography.

The script requires a subcommand like: $ contour_smooth.py smooth The most basic subcommand is smooth. Given limited efficiency at the moment, the script is generally run on a small area and dumps intermediate points in the processing as numpy arrays so you can view the differences using the contour_smooth.py view subcommand.

You can get subject-specific help on a subcommand by typing: $ contour_smooth.py subcommand –help

Usage

sch contour-smooth-cli [OPTIONS] COMMAND [ARGS]...

Options

-h, --help

Show this message and exit.

save

Save dumped DEM based on .npy dump and the original DEM it came from.

Usage

sch contour-smooth-cli save [OPTIONS]

Options

-h, --help

Show this message and exit.

--dumpfile <dumpfile>

Required Dump file from smoothing (npy format).

--original <original>

Required Original DEM (GeoTiff).

--outfile <outfile>

Required Output file that will be saved (GeoTiff format).

smooth

Smooth the input DEM.

Usage

sch contour-smooth-cli smooth [OPTIONS]

Options

-h, --help

Show this message and exit.

--input <input>

Required Input file name, file in tiff format.

--scales <scales>

Scales (in multiples of DEM side length) over which to smooth. The sequence [1,2,3,4] is an example, where the smoothing is gradually introduced at 10m, 20m, 30m and 40m for a 10m DEM.

--nstep <nstep>

Number of pseudo time steps to resolve integration. Default is 40.

--max_time <max_time>

Pseudo time representing final time step. Default is 4.0.

--report_interval <report_interval>

Intermediate interval at which integration will be segmented and smoothed DEMs will be dumped. For example, if –max_time is 2.0 and –report_interval is 0.1, you will get 20 intermediate reports.

view

View two versions of the smoothed DEM based on their .npy dump.

Usage

sch contour-smooth-cli view [OPTIONS] FILE0 FILE1

Options

-h, --help

Show this message and exit.

--levels <levels>

Contour levels.

--vmin <vmin>

Minimum elevation in color bar.

--vmax <vmax>

Maximum elevation in color bar.

Arguments

FILE0

Required argument

FILE1

Required argument

convert-2dm-cli

Convert a *.2dm SMS mesh to a *.gr3 SCHISM mesh.

Usage

sch convert-2dm-cli [OPTIONS] INFILE

Options

--outfile <outfile>

name of output file

--elev2depth

SMS geometry is in terms of elevation and should be flipped in sign.

Arguments

INFILE

Required argument

convert-linestrings-cli

Convert SCHISM line strings between YAML and Shapefile formats.

Usage

sch convert-linestrings-cli [OPTIONS]

Options

-h, --help

Show this message and exit.

--input <input>

Required Input file (YAML or Shapefile).

--output <output>

Required Output file (YAML or Shapefile).

-s, --structures

Flag to indicate conversion of structures YAML.

convert-mesh-cli

Convert a mesh from one format to another. The format is decided by the extensions automatically.

Usage

sch convert-mesh-cli [OPTIONS]

Options

--input <input>

Required Input mesh file.

--output <output>

Required Output mesh file.

--crs <crs>

CRS string for the projection.

-h, --help

Show this message and exit.

convert-points-cli

Convert SCHISM points (source and sink) between YAML and Shapefile formats.

Usage

sch convert-points-cli [OPTIONS]

Options

--input <input>

Required Input file (.yml, .yaml, .in, or .shp).

--output <output>

Required Output file (.yml, .yaml, .in, .bp, or .shp).

-h, --help

Show this message and exit.

convert-polygons-cli

Convert SCHISM polygons between YAML and Shapefile formats.

Usage

sch convert-polygons-cli [OPTIONS]

Options

--input <input>

Required Input file (YAML or Shapefile).

--output <output>

Required Output file (YAML or Shapefile).

--yaml-root <yaml_root>

Dot-separated path to the parent of the polygons key in a nested YAML file, e.g. –yaml-root=mesh.depth_enforcement. Only used with YAML input.

-h, --help

Show this message and exit.

convert-station-cli

Create station.in file from station database (stations_utm.csv) and station subloc listing station_subloc.csv

Usage

sch convert-station-cli [OPTIONS]

Options

--station_db <station_db>

station database, otherwise station_dbase as configured in dms_datastore dstore_config file

--subloc_db <subloc_db>

subloc listings for stations (otherwise default subloc from dms_datastore dstore_config file)

--request <request>

requested variables or ‘all’ for all of them. Possibilities are: elev,air pressure,wind_x,wind_y,temp,salt,u,v,w,ssc

--default_zcor <default_zcor>

z coordinate used when there is no listing for station id (z coordinate, not subloc from surface)

--out <out>

station.in formatted file

--mask-col <mask_col>

Integer column in station dbase used to select stations (1=include)

create-hotstart-cli

Create hotstart initial condition for a SCHISM run

Usage

sch create-hotstart-cli [OPTIONS] [INPUT_FILE]

Options

--input <input_opt>

input yaml file for hotstart

--logdir <logdir>

directory for log file

--debug

enable debug logging

--quiet

suppress console logging

-h, --help

Show this message and exit.

Arguments

INPUT_FILE

Optional argument

create-nudge-cli

Create nudging for a schism run

Usage

sch create-nudge-cli [OPTIONS] [INPUT_FILE]

Options

--input <input_opt>

input yaml file for nudging

--logdir <logdir>
--debug
--quiet
-h, --help

Show this message and exit.

Arguments

INPUT_FILE

Optional argument

create-station-output-cli

Prepares station-related SCHISM inputs.

target: SCHISM input associated with input_type. For example, use following input_type and target pair:

station : staout* fluxflag : flux.out fluxline : flux.out

Usage Examples:

1. Create staout_* files from scratch (i.e., hotstart) create_station_output –hotstart –run_start 2021-01-01 –hot_date 2021-02-01 –input_type station –new_input station_new.in –out_dir . –overwrite_existing TRUE

2. Create staout_* files based on a previous run create_station_output –input_type station –old_input station_old.in –new_input station_new.in –out_dir . –overwrite_existing TRUE staout*

3. Create flux.out from scratch (i.e., hotstart) using fluxflag.prop create_station_output –hotstart –run_start 2021-01-01 –hot_date 2021-02-01 –input_type fluxflag –new_input fluxflag_new.prop –out_dir . –overwrite_existing TRUE

4. Create flux.out based on a previous run using fluxflag.prop create_station_output –input_type fluxflag –old_input fluxflag_old.prop –new_input fluxflag_new.prop flux.out

5. Create flux.out from scratch (i.e., hotstart) using flow_station_xsects.yaml create_station_output –hotstart –run_start 2021-01-01 –hot_date 2021-02-01 –input_type fluxline –new_input flow_station_xsects_new.yaml –out_dir . –overwrite_existing TRUE

Usage

sch create-station-output-cli [OPTIONS] target

Options

--hotstart

Flag for creating desired SCHISM input files from scratch.

--run_start <run_start>

Run start date in the format YYYY-MM-DD. Required only when –hotstart flag is present.

--hot_date <hot_date>

Hotstart date in the format YYYY-MM-DD. Required only when –hotstart flag is present.

--input_type <input_type>

Required Type of input. Must be one of: station, fluxflag, fluxlines

--old_input <old_input>

Previous run’s input file associated with input_type. Not required when –hotstart flag is present.

--new_input <new_input>

Required Current run’s input file associated with input_type.

--out_dir <out_dir>

Output location. Default is current directory.

--overwrite_existing <overwrite_existing>

If true, existing output files will be overwritten. If false, warning given without generating file.

-h, --help

Show this message and exit.

Arguments

target

Optional argument

create-vgrid-lsc2-cli

Create LSC2 vertical grid

Usage

sch create-vgrid-lsc2-cli [OPTIONS]

Options

--hgrid <hgrid>

hgrid file name

--vgrid <vgrid>

vgrid output file name

--minmaxregion <minmaxregion>

Required Polygon file that contains min and max layer information

--ngen <ngen>

Number of iterations for layer simplification

--eta <eta>

Reference surface elevation

--plot_transects <plot_transects>

Filename or glob prefix of transects to plot (e.g. mallard for files mallard_1.csv, mallard_2.csv, etc

--archive_nlayer <archive_nlayer>

Filename or glob prefix of transects to plot (e.g. mallard for files mallard_1.csv, mallard_2.csv, etc

--nlayer_gr3 <nlayer_gr3>

Filename or glob prefix of transects to plot (e.g. mallard for files mallard_1.csv, mallard_2.csv, etc

--vgrid_version <vgrid_version>

Required SCHISM version number as string (e.g. ‘5.8’ and below for old style vgrid, ‘5.10’ is the current new style vgrid

create-vgrid-lsc2-v2-cli

Create SCHISM vgrid using LSC2 v2 pipeline (BETA).

For the stable legacy generator, use create_vgrid_lsc2.

Usage

sch create-vgrid-lsc2-v2-cli [OPTIONS]

Options

--hgrid <hgrid>

Required Path to hgrid.gr3

--eta <eta>

Reference free-surface elevation

--vgrid_version <vgrid_version>

SCHISM version for vgrid output (‘5.8’ or ‘5.10’)

--out_vgrid <out_vgrid>

Output vgrid filename

--config <config>

YAML config with depth_function, algorithm, region_constraints sections

--debug_prefix <debug_prefix>

Prefix for debug GR3 snapshots

--pileup-log <pileup_log>

CSV log of fixed pileup nodes

--diagnostics, --no-diagnostics

Write standard diagnostic GR3 files and pileup CSV

--diagnostics-dir <diagnostics_dir>

Directory for standard diagnostics

--logdir <logdir>

Directory for log files

--debug

Enable debug-level logging

--quiet

Suppress console logging

-h, --help

Show this message and exit.

hotstart-fix-cli

Copy a hotstart and repair impossible wet/dry flags.

Usage

sch hotstart-fix-cli [OPTIONS] INPUT_HOTSTART OUTPUT_HOTSTART

Options

--hgrid <hgrid>

Required Exact hgrid.gr3 used by the run that wrote the hotstart.

--h0 <h0>
Default:

0.01

-h, --help

Show this message and exit.

Arguments

INPUT_HOTSTART

Required argument

OUTPUT_HOTSTART

Required argument

hotstart-inventory-cli

Lookup station metadata by partial string match on id or name

Usage

sch hotstart-inventory-cli [OPTIONS]

Options

--dt <dt>

Time step in seconds of model

--run_start <run_start>

Start time in iso-like format, e.g. 2013-12-03

--nday <nday>

Number of days in simulation (rnday) or maximum to catalog

--workdir <workdir>

Working directory, which is the outputs dir

--paramfile <paramfile>

Name of param.nml file if file is used to infer runtime. If neither params nor paramfile provided, ./param.nmo or ../param.nml will be tried.

--hot_freq <hot_freq>

Hotstart frequency in pandas freq terms (e.g. ‘5D’)

--expected

Flag to generate expected hotstarts instead of inventory of existing files

interpolate-structure-cli

Interpolate a dated th template for a structure

Usage

sch interpolate-structure-cli [OPTIONS]

Options

--template_th <template_th>

th file path containing skeleton of operations.

--output_th <output_th>

Output file path

--dt <dt>

Time step of output. Input template timestamps must be neat with respect to this

--int_cols <int_cols>

List of column names to treat as integers. Default is install, ndup, ndup_culvert, ndup_pipe, ndup_weir.

inundate-island-cli

Generate preprocessor inputs for gradually inundating restored islands.

Reads a breach configuration and writes four yaml files: hydraulic structures, depth enforcement for the dredged openings, an elev.ic polygon set, and regions for hotstart patch_init. Each breach is a pathway along the levee, ordered looking into the island, and optionally a shorter gate_span the structure itself occupies.

Usage

sch inundate-island-cli [OPTIONS]

Options

--config <config_file>

Required Breach configuration yaml.

--hgrid <hgrid_file>

Required Mesh the breaches sit on.

--out-dir <out_dir>

Directory for the generated yaml (default: current directory).

--prefix <prefix>

Prefix for output filenames.

--edge-length-factor <edge_length_factor>

Dredge penetration each way from the levee, in local edge lengths.

Default:

3.0

--freeboard <freeboard>

Depth the initial surface sits below the bed on dry ground.

Default:

0.01

--ambient <ambient>

Water level away from the islands.

Default:

0.96

--validate, --no-validate

Build the structures and confirm they resolve inside their polygons.

Default:

True

--breach-date <breach_date>

Last-resort breach moment, e.g. 2022-04-15. Prefer setting breach_date on each breach, since sites in one run can come online years apart.

--run-start <run_start>

Model time origin for the elapsed .th, e.g. 2020-09-30.

--th-dir <th_dir>

Subdirectory holding dated/ and elapsed/.

Default:

'th_files'

--epoch-start <epoch_start>

First schedule row, standing in for the infinite past.

Default:

'2005-01-01'

--ramp-hours <ramp_hours>

Length of the opening ramp before the breach.

Default:

24.0

--ramp-steps <ramp_steps>

Number of increments in the opening ramp.

Default:

12

--ramp-target <ramp_target>

Value the ramped column reaches at the end of the ramp.

Default:

0.6

--logdir <logdir>

Log directory.

--debug

Verbose logging.

-h, --help

Show this message and exit.

merge-th-cli

Merge multicolumn th files to form union of columns and (for tracers) variables.

Usage

sch merge-th-cli [OPTIONS]

Options

--input <input>

Required Config file

model-time-cli

Convert elapsed model seconds to or from dates

Usage

sch model-time-cli [OPTIONS] COMMAND [ARGS]...

Options

-h, --help

Show this message and exit.

clip

Clip (subset) an input file in elapsed time to a new, later, start date

Usage

sch model-time-cli clip [OPTIONS] ELAPSED_INPUT...

Options

--start <start>

Required Start time in ISO-like format 2009-03-12T00:00:00. Time part is optional.

--clip_start <clip_start>

Required Starting date for output.

--out <out>

Name of output file. If input is a *.th file the file will be converted and output to this file, otherwise printed to screen

-h, --help

Show this message and exit.

Arguments

ELAPSED_INPUT

Required argument(s)

to_date

Convert input elapsed seconds or *.th file with elapsed seconds as the time column to equivalent output with a datetime or annotated with datetimes.

Usage

sch model-time-cli to_date [OPTIONS] ELAPSED_INPUT...

Options

--start <start>

Required Start time in ISO-like format 2009-03-12T00:00:00. Time part is optional.

--step <step>

Model time step in seconds. If given, answer will be the integer time step.

--elapsed_unit <elapsed_unit>

Time unit of input file. Must be either ‘s’ for seconds or ‘d’ for days. Only used for files

--time_format <time_format>

Time format for output, e.g. the default is %%Y-%%m-%%dT%%H:%%M:%%S for 2009-03-14T22:40:00. Only used when converting fields.

--annotate

Annotate output.

--out <out>

Name of output file. If input is a *.th file the file will be converted and output to this file, otherwise printed to screen

-h, --help

Show this message and exit.

Arguments

ELAPSED_INPUT

Required argument(s)

to_elapsed

Interpret model times in elapsed seconds and translate between calendar time and elapsed. The script requires a subcommand like: $ model_time.py to_elapsed. You can also get subject-specific help on a subcommand by typing $ model_time.py subcommand –help

Usage

sch model-time-cli to_elapsed [OPTIONS] DATED_INPUT...

Options

--start <start>

Starting date and time basis for output if the input is a file.

--annotate

Annotate output.

--step <step>

Model time step. If given, answer will be the integer time step.

--out <out>

Name of output file. If input is a *.th file the file will be converted and output to this file, otherwise printed to screen

--skip_nan

Skip a record with nan if True

-h, --help

Show this message and exit.

Arguments

DATED_INPUT

Required argument(s)

nc-bc-compatible-cli

Check whether a NetCDF boundary forcing file is reusable on a candidate SCHISM mesh.

Usage

sch nc-bc-compatible-cli [OPTIONS]

Options

--file <forcing_file>

Required

Options:

elev2D.th.nc | uv3D.th.nc

--base-dir <reference_dir>
--compare-dir <candidate_dir>
--base-hgrid <reference_hgrid>
--compare-hgrid <candidate_hgrid>
--base-vgrid <reference_vgrid>
--compare-vgrid <candidate_vgrid>
--base-bctides <reference_bctides>
--compare-bctides <candidate_bctides>
--tol <tolerance>
Default:

0.1

--vgrid-version <vgrid_version>
Default:

'5.10'

Options:

5.8 | 5.10

--verbose

Show compatible-boundary summary.

--raise

Raise an error instead of returning a nonzero exit status.

-h, --help

Show this message and exit.

prepare-schism-cli

Prepare SCHISM input files.

Usage

sch prepare-schism-cli [OPTIONS] MAIN_INPUTFILE

Options

--set <KEY=VALUE>

Set a substitution variable, e.g. –set mesh_year=2018. May be repeated.

Arguments

MAIN_INPUTFILE

Required argument

relocate-source-sink-cli

Relocate co-located SCHISM source/sink point pairs. Pairs are matched by integer suffix within a single prefix (‘delta’ or ‘suisun’); pairs already separated beyond the tolerance pass through unchanged. Failure cases are recorded in a min-depth polygon YAML for manual splicing into the project polygon file.

Usage

sch relocate-source-sink-cli [OPTIONS]

Options

--hgrid <hgrid>

Required Path to hgrid.gr3 (positive-down depth convention).

--source <source_yaml>

Required Input source YAML (e.g. source_suisun.yaml).

--sink <sink_yaml>

Required Input sink YAML (e.g. sink_suisun.yaml).

--prefix <prefix>

Required Name prefix for the family of pairs to process.

Options:

delta | suisun

--out-dir <out_dir>

Directory for output YAML files.

Default:

'.'

--rings-initial <rings_initial>

Initial BFS ring radius for the local search.

Default:

6

--rings-fallback <rings_fallback>

Expanded ring radius if the initial search fails.

Default:

12

--min-node-depth <min_node_depth>

Minimum depth (m) required at every node of the chosen element (positive-down).

Default:

0.0

--mean-depth <mean_depth>

Minimum mean nodal depth (m) required at the chosen element.

Default:

0.5

--random-threshold <random_threshold>

If both candidates have mean depth >= this value, the deeper-to-sink rule is replaced by random assignment.

Default:

2.0

--separation-tol <separation_tol>

Pairs with planar distance above this threshold (m) are considered already separated.

Default:

0.01

--max-distance <max_distance>

Maximum physical distance (m) a relocated point may move from the original co-location. Candidate elements whose centroid exceeds this radius are rejected. Set to 0 or a negative value to disable.

Default:

500.0

--seed <seed>

RNG seed for repeatable random rejection sampling.

Default:

42

--always-move-both, --minimal-move

When relocating, move both points to distinct elements (default), or keep one at the seed if it qualifies.

Default:

True

--out-suffix <out_suffix>

Suffix appended to the prefix in output filenames, e.g. delta_source_adj.yaml. Use _relocated for the old naming.

Default:

'_adj'

--shp, --no-shp

Also export relocated points and polygons as shapefiles.

Default:

False

-h, --help

Show this message and exit.

set_param

Command line tool to set SCHISM model parameters in PARAM_FILE.

Usage

sch set_param [OPTIONS] PARAM_FILE [PAIRS]...

Options

-o, --output <output>

Write to this file instead of editing PARAM_FILE in place. If omitted, PARAM_FILE is overwritten.

--dry-run

Parse and report changes but do not write anything.

Arguments

PARAM_FILE

Required argument

PAIRS

Optional argument(s)

Alias names you can use for NAME:

hotstart_freq

maps to : hotstart_freq (Params property) value : ‘5d’, ‘12h’, or ‘none’ meaning : Wall-clock interval between writing hotstart.nc files. Implemented via nhot and nhot_write; nhot_write must be a multiple of the nc_out_file_span or, more directly in schism-speak, nhot must be a multiple of ihfskip

hotstart_mode

maps to : ihot (raw SCHISM name) value : 0, 1, or 2 meaning : Hotstart option: 0 = cold start; 1 = restart from hotstart.nc but reset model time to 0; 2 = restart and continue from the time stored in hotstart.nc.

nc_out_file_span

maps to : nc_stack (Params property) value : ‘1d’, ‘10d’, etc. meaning : Wall-clock time covered by each history file. Must be a multiple of nc_out_freq. Used to derive ihfskip, the number of (dt) time steps in the file, which is the parameter actually used by SCHISM. nc_out_steps_per_file is an alias that more directly expresses the ihfskip parameter.

nc_out_steps_per_file

maps to : ihfskip (raw SCHISM name) value : integer time steps, e.g. 960 meaning : Number of model time steps per history file stack (ihfskip). Derived so that ihfskip is a multiple of nspool.

run_nday

maps to : run_nday (Params property) value : integer days, e.g. 252 meaning : Total simulation length in days (maps to CORE::rnday).

station_freq

maps to : station_freq (Params property) value : ‘15min’, ‘1h’, etc. or ‘none’ meaning : Wall-clock interval between samples written to station output files (staout_*). Use ‘none’ to disable station output.

station_freq_in_model_steps

maps to : nspool_sta (raw SCHISM name) value : integer time steps meaning : Number of model time steps between station outputs (nspool_sta). Only used when station output is enabled (iout_sta != 0).

small-areas-cli

Identify small areas

Usage

sch small-areas-cli [OPTIONS]

Options

--input_mesh <input_mesh>

Input mesh

--warn <warn>

Threshold for warning (areas smaller)

--fail <fail>

Threshold for failure (areas smaller)

split-quads-cli

Split quadrilateral elements that have higher skewness value than the given skewness into triangular elements.

Usage

sch split-quads-cli [OPTIONS] MESHINPUT MESHOUTPUT

Options

--outdir <outdir>

Output directory for the mesh file and prop file.

--skewness <skewness>

Maximum skewness (not normalized.) to split. If the skewness of an element is bigger than this, the element will be split.

--minangle <minangle>

Minimum angle (degrees) to keep in quads. If any of internal angles of a quad is smaller than mingangle, the quad will be split.

--maxangle <maxangle>

Minimum angle (degrees) to keep in quads. If any of internal angles of a quad is larger than maxgangle, the quad will be split.

--propfile <propfile>

Write a prop file that shows elements that are split

Arguments

MESHINPUT

Required argument

MESHOUTPUT

Required argument

stacked-dem-cli

Tools for prioritized stacked DEM filling and source-region polygons.

Usage

sch stacked-dem-cli [OPTIONS] COMMAND [ARGS]...

fill

Fill node elevations/depths in a SCHISM mesh file from a prioritized DEM stack.

FILENAME is the mesh-like file to modify in place. Supported formats are:

  • .gr3

  • .2dm

A backup is written as FILENAME.bak before modification.

DEMFILE may be:

  • a plain text file with one DEM path per line,

  • a simple YAML list,

  • a YAML mapping containing a DEM list at –yaml-root,

  • a prepare_schism-style YAML file with includes/substitution.

DEMs are tried in order. For each mesh node, the first DEM with valid bilinear support supplies the value. Bilinear support means the four surrounding raster values are in bounds and not NoData/NaN.

Examples:

stacked_dem fill hgrid.gr3 dem_list.yaml –elev2depth

stacked_dem fill hgrid.gr3 main_bay_delta.yaml

–yaml-root mesh/dem_list –elev2depth

stacked_dem fill mesh.2dm main_bay_delta_echo.yaml

–yaml-root mesh/dem_list –fill 2.0

Usage

sch stacked-dem-cli fill [OPTIONS] FILENAME DEMFILE

Options

--yaml-root <yaml_root>

Slash-separated YAML path to the DEM list. Use ‘dem_list’ for a simple DEM-list YAML, or ‘mesh/dem_list’ for prepare_schism-style configuration files.

Default:

'dem_list'

--elev2depth

Convert DEM elevations to SCHISM depth by multiplying sampled values by -1. This is typical for gr3 depth files and unusual for 2dm files.

--fill <na_fill>

Fallback value used for points not covered by any DEM with valid bilinear support. Only used when missing points are allowed.

Default:

2.0

Arguments

FILENAME

Required argument

DEMFILE

Required argument

poly

Build polygon layers describing a prioritized stacked DEM.

DEMFILE may be:
  • a plain text file with one DEM path per line,

  • a simple YAML list,

  • a YAML mapping containing a DEM list at –yaml-root,

  • a prepare_schism-style YAML file with includes/substitution.

The source-region output answers:

If stacked_dem_fill sampled this location, which DEM would provide the value?

A DEM qualifies only where bilinear interpolation has valid support, meaning the four surrounding raster values are in bounds and not NoData/NaN. Earlier DEMs in the list take priority over later DEMs.

Examples:

stacked_dem poly dem_list.yaml logs/dem_regions

stacked_dem poly main_bay_delta.yaml logs/dem_regions

–yaml-root mesh/dem_list

stacked_dem poly main_bay_delta_echo.yaml logs/dem_regions

–yaml-root mesh/dem_list –no-overlap

Usage

sch stacked-dem-cli poly [OPTIONS] DEMFILE OUT_DIR

Options

--yaml-root <yaml_root>

Slash-separated YAML path to the DEM list. Use ‘dem_list’ for a simple DEM-list YAML, or ‘mesh/dem_list’ for prepare_schism-style configuration files.

Default:

'dem_list'

--output <source_output>

Output polygon file for priority-resolved DEM source regions. Each polygon identifies the first DEM in the stack that has valid bilinear support there.

Default:

'dem_source_regions.gpkg'

--overlap-output <overlap_output>

Optional diagnostic polygon file showing where two or more DEMs have valid bilinear support. Priority still determines which DEM wins in the source regions.

Default:

'dem_overlap_regions.gpkg'

--gap-output <gap_output>

Optional diagnostic polygon file showing areas inside the combined DEM extent where no DEM has valid bilinear support.

Default:

'dem_gaps.gpkg'

--no-overlap

Do not write the overlap diagnostic layer.

--no-gaps

Do not write the gap diagnostic layer.

Arguments

DEMFILE

Required argument

OUT_DIR

Required argument

vgrid-nlayer-to-gr3-cli

CLI utility to write nlevel/nlayer GR3 files from a SCHISM vgrid.

Usage

sch vgrid-nlayer-to-gr3-cli [OPTIONS]

Options

--hgrid <hgrid>

Horizontal grid file name.

--vgrid <vgrid>

Vertical grid file name.

--vgrid_version <vgrid_version>

SCHISM vgrid format version (‘5.8’ or ‘5.10’).

--nlevel <nlevel>

Output GR3 file for per-node vertical level counts.

--nlayer <nlayer>

Output GR3 file for per-node per-node layer counts.