riverarchitect.condition
Reading a condition: its input rasters and the return periods of its discharges.
A condition is one folder under 01_Conditions/ holding the terrain, sediment and
hydraulic rasters for a single planning situation. input_definitions.inp names which
raster is which and gives the flood return period of each modelled discharge - it is the
metadata every analysis module needs before it can start.
The file format is the original one, so existing conditions are read unchanged:
Return periods = 1.0, 1.08, 1.13 #[Comma separated LIST] defines lifespans
Flow depth (h) = h007250.tif, h007750.tif #[Comma separated LIST]
Grain sizes (D mean) = dmean #[STRING]
Everything after # is a comment, the key is matched case-insensitively on a substring,
and the .tif extension is optional.
- class riverarchitect.condition.Condition(name, directory=None)[source]
Bases:
objectOne condition folder: where its rasters are and what discharges they represent.
- Parameters:
- Variables:
- all_depth_rasters()[source]
Every
h<discharge>.tifpresent on disk, not just those in the.inp.input_definitions.inplists the discharges that carry a flood return period, which is what lifespan mapping needs. A recession analysis needs the low flows too, and in a real condition those are on disk but absent from the.inp- the sample condition has 60 depth rasters and names 17.
- all_velocity_rasters()[source]
Every
u<discharge>.tifpresent on disk. Seeall_depth_rasters().
- static discharge_of(raster_name)[source]
Discharge encoded in a hydraulic raster name.
h001000.tif->1000.0.
- hydraulic_pairs()[source]
Yield
(return_period, depth_path, velocity_path)for each modelled discharge.Pairs whose depth or velocity raster is missing from disk are skipped, and a condition with no return periods falls back to the discharge itself, so that a partially prepared condition still produces something rather than raising.
- property max_lifespan
Longest return period in the condition; the cap on any lifespan it can support.