Command Line Tools

sch

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

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.

sch batch-metrics-cli [OPTIONS] MAIN_INPUTFILE

Options

-h, --help

Show this message and exit.

Arguments

MAIN_INPUTFILE

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.

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

-h, --help

Show this message and exit.

Arguments

DEMLIST

Required argument

combine-consume-cli

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

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.

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.

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.

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-linestrings-cli

Convert SCHISM line strings between YAML and Shapefile formats.

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).

convert-mesh-cli

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

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.

sch convert-points-cli [OPTIONS]

Options

-h, --help

Show this message and exit.

--input <input>

Required Input file (YAML).

--output <output>

Required Output file (Shapefile).

-h, --help

Show this message and exit.

convert-polygons-cli

Convert SCHISM polygons between YAML and Shapefile formats.

sch convert-polygons-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).

-h, --help

Show this message and exit.

model-time-cli

Convert elapsed model seconds to or from dates

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

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.

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

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)