You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
hydrolib-core currently supports cross section location and definition files in the .ini format.
However, several model schematizations exist that still use the legacy "profloc/profdef" files.
It would be nice to able to easily switch to the new format.
Describe the solution you'd like
A python script that converts profloc + profdef files into crsloc/crsdef.ini files
Should be callable as a function and as a standalone script
Input arguments are:
either the profloc + profdef + (optionally!) profdefxyz files
or an .mdu file, from which the prof* files will be detected
the legacy formats do not need to become available as Pydantic model classes, a simple file reader inside this utility will suffice.
Error must be given if user input is wrong
Error must be given if some fields in user input are not (yet) supported in converter
Additional context
Format definition of legacy files: profloc.xyz
in fact a sample file (hydrolib.core.dflowfm.XYZModel)
the third (z) column should contain numbers, whose integer value corresponds with the PROFNR= profile definition numbers in a profdef.txt
profdef.txt
Comment lines start with *
Data lines contain a space-separated list of key=value terms
Valid keys:
PROFNR=<N>, profile id, with N positive integer. Referenced by z-column in profloc.xyz file
TYPE=<itype>, profile type, one of:
TYPE=1 : PIPE
TYPE=2 : RECTAN , HYDRAD = AREA / PERIMETER ALSO SPECIFY: HEIGHT=
Is your feature request related to a problem? Please describe.
hydrolib-core currently supports cross section location and definition files in the .ini format.
However, several model schematizations exist that still use the legacy "profloc/profdef" files.
It would be nice to able to easily switch to the new format.
Describe the solution you'd like
Additional context
Format definition of legacy files:
profloc.xyz
hydrolib.core.dflowfm.XYZModel
)PROFNR=
profile definition numbers in a profdef.txtprofdef.txt
*
PROFNR=<N>
, profile id, with N positive integer. Referenced by z-column in profloc.xyz fileTYPE=<itype>
, profile type, one of:TYPE=1
: PIPETYPE=2
: RECTAN , HYDRAD = AREA / PERIMETER ALSO SPECIFY: HEIGHT=TYPE=3
: RECTAN , HYDRAD = 1D ANALYTIC CONVEYANCE = WATERDEPTH ALSO SPECIFY: HEIGHT=TYPE=4
: V-SHAPE , HYDRAD = AREA / PERIMETER ALSO SPECIFY: HEIGHT=TYPE=5
: V-SHAPE , HYDRAD = 1D ANALYTIC CONVEYANCE ALSO SPECIFY: HEIGHT=TYPE=6
: TRAPEZOID, HYDRAD = AREA / PERIMETER ALSO SPECIFY: HEIGHT= BASE=TYPE=7
: TRAPEZOID, HYDRAD = 1D ANALYTIC CONVEYANCE ALSO SPECIFY: HEIGHT= BASE=TYPE=100
: YZPROF , HYDRAD = AREA / PERIMETERTYPE=101
: YZPROF , HYDRAD = 1D ANALYTIC CONVEYANCE METHODTYPE=200
: XYZPROF , HYDRAD = AREA / PERIMETERTYPE=201
: XYZPROF , HYDRAD = 1D ANALYTIC CONVEYANCE METHODWIDTH=<w>
with w a positive float equals the (top) widthHEIGHT=<h>
with h a positive float equals the heightZMIN=<z>
with z a float equals the absolute bed level of the cross sectionBASE=<wb>
with wb a positive float equals the base widthTALUD=<s>
with s a positive float equals the talud slope. Used when BASE is omitted for trapezoid type.FRCTP=<ifrctp>
with ifrctp the integer friction type on this cross section (See translation below)FRCCF=<cf>
with cf a positive float equals the friction coefficientTranslation friction types:
0:
Chezy
1:
Manning
2:
WallLawNikuradse
(a.k.a. White-Colebrook Delft3D-style)3:
WhiteColebrook
profdefxyz.pliz
hydrolib.core.dflowfm.PolyFile
)PROFNR=<N>
, should match with profdef.txt fileThe text was updated successfully, but these errors were encountered: