Command line - CNR-Engineering/PyTelTools GitHub Wiki

Available command line scripts are:

A help message is provided for each script with the argument -h (e.g. slf_base.py -h). Help messages are gathered below for each script (and this file was in fact automatically generated).

pyteltools_gui.py

usage: write_cli_usage.py [-c {classic,workflow}]

________________________________________________________________________________

Run PyTelTools GUI: classic or workflow interface
________________________________________________________________________________

~> Optional arguments:
  -c {classic,workflow}, --interface {classic,workflow}
                        select and open corresponding GUI (default: None)

slf_3d_to_2d.py

usage: write_cli_usage.py [--shift X Y]
                          (--layer 1 | --aggregation {max,min,mean})
                          [--vars {B,S,H} [{B,S,H} ...]] [-f] [-v]
                          in_slf out_slf

________________________________________________________________________________

Perform a vertical operation on a 3D results file to get 2D
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf                Serafin input filename
  out_slf               Serafin output filename

~> Optional arguments:
  --shift X Y           translation (x_distance, y_distance) (default: None)
  --layer 1             layer number (1=lower, nb_planes=upper) (default:
                        None)
  --aggregation {max,min,mean}
                        operation over the vertical (default: None)
  --vars {B,S,H} [{B,S,H} ...]
                        variable(s) deduced from Z (default: [])

~> General optional arguments:
  -f, --force           force output overwrite (default: False)
  -v, --verbose         increase output verbosity (default: False)

slf_base.py

usage: write_cli_usage.py [--shift X Y] [--set_mesh_origin X Y]
                          [--var2del VA [VB ...]] [--var2add VA [VB ...]]
                          [--friction_law {0,1,2,3}] [--ech ECH]
                          [--start START] [--end END] [-f] [-v]
                          in_slf out_slf

________________________________________________________________________________

Performs multiple operations on a Serafin file:
- compute and/or remove variables
- mesh transformations (coordinates)
- select frames
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf                Serafin input filename
  out_slf               Serafin output filename

~> Optional arguments:
  --shift X Y           translation (x_distance, y_distance) (default: None)
  --set_mesh_origin X Y
                        Mesh origin coordinates (x, y) (default: None)

~> Serafin variables (optional):
  See variables abbrevations on https://github.com/CNR-Engineering/PyTelTools/wiki/Notations-of-variables

  --var2del VA [VB ...]
                        variable(s) to delete (default: [])
  --var2add VA [VB ...]
                        variable(s) to add (default: [])
  --friction_law {0,1,2,3}
                        friction law identifier: 0=Chézy, 1=Strickler,
                        2=Manning, 3=Nikuradse (default: 1)

~> Temporal operations (optional):
  --ech ECH             frequency sampling of input (default: 1)
  --start START         minimum time (in seconds) (default: -inf)
  --end END             maximum time (in seconds) (default: inf)

~> General optional arguments:
  -f, --force           force output overwrite (default: False)
  -v, --verbose         increase output verbosity (default: False)

slf_bottom_friction.py

usage: write_cli_usage.py [--in_strickler_zones IN_STRICKLER_ZONES]
                          [--in_strickler_attr IN_STRICKLER_ATTR]
                          [--friction_law {0,1,2,3}] [-f] [-v]
                          in_slf out_slf out_csv in_polygons

________________________________________________________________________________

Compute bottom friction force on multiple zones

Outputs:
* write a SerafinOutput variables : 'W', 'US', 'TAU'
* write the values in stdout
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf                Serafin input filename
  out_slf               Serafin output filename
  out_csv               output csv file
  in_polygons           polygons file (*.shp)

~> Optional arguments:
  --in_strickler_zones IN_STRICKLER_ZONES
                        strickler zones file (*.shp) (default: None)
  --in_strickler_attr IN_STRICKLER_ATTR
                        attribute to read strickler values
                        `--in_stricker_zone` (default: None)
  --friction_law {0,1,2,3}
                        friction law identifier: 0=Chézy, 1=Strickler,
                        2=Manning, 3=Nikuradse (default: 1)

~> General optional arguments:
  -f, --force           force output overwrite (default: False)
  -v, --verbose         increase output verbosity (default: False)

slf_flux2d.py

usage: write_cli_usage.py [--ech ECH] [--scalars [VA [VB ...]]]
                          [--vectors VX VY] [-f] [-v]
                          in_slf in_sections out_csv

________________________________________________________________________________

Compute (liquid or solid) 2D fluxes over time across sections
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf                Serafin input filename
  in_sections           set of lines file (*.shp, *.i2s)
  out_csv               output csv file

~> Optional arguments:
  --ech ECH             frequency sampling of input (default: 1)
  --scalars [VA [VB ...]]
                        scalars to integrate (up to 2) (default: [])
  --vectors VX VY       couple of vectors to integrate (X and Y vectors)
                        (default: [])

~> General optional arguments:
  -f, --force           force output overwrite (default: False)
  -v, --verbose         increase output verbosity (default: False)

slf_int2d.py

usage: write_cli_usage.py [--long] [--vars VA [VB ...]] [-f] [-v]
                          in_slf in_points out_csv

________________________________________________________________________________

Interpolate on a set of points for every frame
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf              Serafin input filename
  in_points           set of points file (*.shp)
  out_csv             output csv file

~> Optional arguments:
  --long              write CSV with long format (variables are also in rows)
                      instead of wide format (default: False)
  --vars VA [VB ...]  variable(s) to extract (by default: every variables)
                      (default: None)

~> General optional arguments:
  -f, --force         force output overwrite (default: False)
  -v, --verbose       increase output verbosity (default: False)

slf_last.py

usage: write_cli_usage.py [--shift X Y] [--time TIME] [-f] [-v] in_slf out_slf

________________________________________________________________________________

Extract last temporal frame of a 2D/3D Serafin file
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf         Serafin input filename
  out_slf        Serafin output filename

~> Optional arguments:
  --shift X Y    translation (x_distance, y_distance) (default: None)
  --time TIME    time in seconds to write last frame (set to frame time by
                 default) (default: None)

~> General optional arguments:
  -f, --force    force output overwrite (default: False)
  -v, --verbose  increase output verbosity (default: False)

slf_volume.py

usage: write_cli_usage.py [--ech ECH] --upper_var VA [--lower_var VB]
                          [--detailed] [-f] [-v]
                          in_slf in_polygons out_csv

________________________________________________________________________________

Compute volumes within polygons
________________________________________________________________________________

~> Positional and compulsory arguments:
  in_slf          Serafin input filename
  in_polygons     set of polygons file (*.shp, *.i2s)
  out_csv         output csv file

~> Optional arguments:
  --ech ECH       frequency sampling of input (default: 1)
  --upper_var VA  upper variable (default: None)
  --lower_var VB  lower variable (default: None)
  --detailed      add positive and negative volumes (default: False)

~> General optional arguments:
  -f, --force     force output overwrite (default: False)
  -v, --verbose   increase output verbosity (default: False)