Generate a 3Di simulation grid from a model schematisation.
Project description
threedigrid-builder
Generate a 3Di simulation grid from a model schematisation.
Usage
This library converts a model schematisation to a 3Di simulation grid. This can be done using a single function that reads data from an SQLite and TIFF and then outputs the generated grid into a Geopackage or HDF5 file:
>>> from threedigrid_builder import make_grid
>>> sqlite_path = "/path/to/model.sqlite"
>>> dem_path = "/path/to/dem.tiff"
>>> out_path = "grid.gpkg" # or "something.h5" for HDF5 output
>>> make_grid(sqlite_path, dem_path, out_path)
Installation
This package is distributed as binary only, because its (Fortran) source code is proprietary. The only currently supported platform is Linux.
First install sqlite and spatialite libraries, e.g. on Ubuntu:
$ sudo apt-get install sqlite3 libsqlite3-mod-spatialite
Then install the threedigrid-builder:
$ pip install threedigrid-builder
For output into a file for the 3Di calculationcore, enable gridadmin output:
$ pip install threedigrid-builder[gridadmin]
For output into Geopackage for display in e.g. QGis, enable gpkg output:
$ pip install threedigrid-builder[gpkg]
Changelog of threedigrid-builder
0.2.0 (2021-07-15)
Added threedigrid_builder.grid.geo_utils with segmentize and line_substring functions. These are used to compute the Lines.line_geometries for channel lines.
Fixed a bug in the refinement areas code (Fortran) on Ubuntu 20.04.
Added the Pipes model that is able to compute Nodes & Lines from Pipes. Pipes are also included in the calculation_type and bottom_level computations.
Added 1D-2D lines for connection nodes, manholes, and channels.
Added culverts, orifices, and weirs.
Added pumps (pumpstations).
Settings and metadata are read from the SQLite. Some metadata (like model_slug) can also be provided via the main (make_grid) function. The metadata is written to the root ‘attrs’ of the output gridadmin.h5. The settings are written into datasets inside newly addres groups “grid_settings” and “tables_settings”.
Fixes for models with no channels.
Add an optional progress callback.
0.1.2 (2021-04-28)
Added public API with 1 function: threedigrid_builder.make_grid.
0.1.1 (2021-04-20)
Fixed automatic PyPI upload.
0.1.0 (2021-04-20)
Partially ported functionality from inpy (generate 3di files, makegrid): 1D channel grid (including calculation_type and bottom_level), and 2D open water grid.
Added gridadmin and geopackage output.
Breaking change: the interpolation between cross section locations (channels) now also extrapolates for lines and nodes that are not in between two connection nodes. This happens only if the channel has at least 2 cross section locations. When extrapolatic, the line.cross_weight is less than 0 or greater than 1.
Breaking change: missing or empty values in float datasets in the output gridadmin are now denoted by NaN (not-a-number) instead of -9999.0.
Breaking change: integers in the output gridadmin are now always 32-bit (instead of sometimes 32-bit and sometimes 64-bit).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for threedigrid_builder-0.2.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2223340cb62c5886a80381d358480e6df409110266307f020aa43340679616f |
|
MD5 | 3adde970ce46f8e7ef4be44bac667b2a |
|
BLAKE2b-256 | f85c545cad7f8fbe88fec7b350274e85fda3a9c30a12dbe6e5179c0c6334ab8f |
Hashes for threedigrid_builder-0.2.0-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 989b62c8f6527108d254a00ae8da70a353c5f7b1599d19d5d63021481b0be1fd |
|
MD5 | df496f29b6e69d5302e68b84133103f3 |
|
BLAKE2b-256 | ff8bf0554bcd9a81fb7807f33c6828f3995b52fcfa2fd8d67d6c1ff7af8c1dc6 |
Hashes for threedigrid_builder-0.2.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0347981a4e9407a4d370e43d006218462c42e6b8223e744480cd156c50838b1 |
|
MD5 | 13c9bf526fbb36f0dc4f3b113dbaae4c |
|
BLAKE2b-256 | 4b9eab8b05a37cc1b1fb65572a73bafaa09515955199fdc20aa9fe0e80df92b5 |
Hashes for threedigrid_builder-0.2.0-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0d878e9b26ef79ea6b0e95f03e23c6b14fcc181e04c45dbefc3bac9b8ef8ff |
|
MD5 | 3c16b5d0c691893c9a6e049172b65870 |
|
BLAKE2b-256 | 93d29672a554cc461ee24c931c6f3b25904700bf8e918d9ad7a836065dcfacf9 |
Hashes for threedigrid_builder-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1668544de39315cb8aa66b5891f18a7636649d36fc34ba4be7f95fcb4aadb2c5 |
|
MD5 | fadfdc03e85f82a357d880ce7799578a |
|
BLAKE2b-256 | a2794625522e5127eb99775de8722e7d5695867b6e1e8dd5d6494955c16681c4 |
Hashes for threedigrid_builder-0.2.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 896098784caa3cf64a5da70c2deac1bb98ebacc5e1edfde3d0799e0f47a8b1fd |
|
MD5 | 584d50eadd706fe02435e09d315993c2 |
|
BLAKE2b-256 | 03fbe6830719a6a88d242bd7df7436851b259f0ab02d5096d4c7e94dcfe7671b |
Hashes for threedigrid_builder-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab9b432d04c81344185dbbdfebfbfe36317b6df8fc18be771972dc4a337dfff4 |
|
MD5 | 42f822d68a6e21e2c819c46473ba8366 |
|
BLAKE2b-256 | 03cb0b33e11f0fadf896bf5257347244def485b3175716e47e0556db4ebace6a |
Hashes for threedigrid_builder-0.2.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c4019eea374b0e9d46b3869ad48ee605701a19eba9cc1dd533b285d560838e |
|
MD5 | c6f0d863be3f4dec5bf796d6aa580728 |
|
BLAKE2b-256 | 020b2f3460e7ff07baf3f84d4b3620d86290304cce4d717aa40017526dea5de1 |