steady_plan¶
SteadyPlan - read HEC-RAS steady-flow plan HDF5 files (.p*.hdf).
Steady plan HDF files embed the same Geometry/ group as geometry HDF files
plus Results/Steady/... profile-based output.
SteadyPlan inherits Geometry so all geometry accessors are
available. CrossSectionResults, StorageAreaResults, and
LateralResults carry geometry attributes and steady-profile result
arrays. All result arrays have shape (n_profiles,) (or (n_profiles,
n_segments) for segment-level lateral data) where the first axis corresponds
to a named steady-flow profile (e.g. "Big", "Bigger", "Biggest").
Bridge, culvert, and inline structure nodes in HEC-RAS 1D steady flow do not
produce separate result datasets in the HDF file; their results are embedded in
the adjacent upstream/downstream cross-section output. SteadyPlan
therefore returns plain geometry objects (no result access) for those types.
Only LateralResults carries dedicated result data.
Derived from examination of HEC-RAS 6.6 steady-flow plan HDF output at
Results/Steady/Output/Output Blocks/Base Output/Steady Profiles/.
- class rivia.hdf.steady_plan.ComputeSummary(run)[source]¶
Bases:
objectSteady simulation summary for a plan HDF file.
Wraps the attributes stored under
Results/Steady/Summary. Steady-flow runs do not produce volume-accounting output; only run metadata is available.- Variables:
run – Solution status and wall-clock run window.
- Parameters:
run (RunStatus)
- class rivia.hdf.steady_plan.CrossSectionResults(geom, hdf, index, root)[source]¶
Bases:
CrossSectionGeometry and steady-profile results for one 1-D cross section.
Inherits all geometry attributes from
CrossSection.All result properties return a
numpyarray of shape(n_profiles,)where each index corresponds to a named steady-flow profile. UseSteadyPlan.profile_namesto map indices to profile names.- Parameters:
geom (
CrossSection) – Geometry object fromCrossSectionCollection.hdf (
File) – Openh5py.File— kept alive by the parentSteadyPlancontext.index (
int) – Column index of this XS in the(n_profiles, n_xs)result datasets.root (
str) – HDF path prefix —_STEADY_XS.
- property ineffective_area_channel: ndarray¶
Channel area including ineffective zones. Shape
(n_profiles,).
- property ineffective_area_left_ob: ndarray¶
Left overbank area including ineffective zones. Shape
(n_profiles,).
- property ineffective_area_right_ob: ndarray¶
Right overbank area including ineffective zones. Shape
(n_profiles,).
- property ineffective_area_total: ndarray¶
Total area including ineffective zones. Shape
(n_profiles,).
- property top_width_channel_with_ineffective: ndarray¶
Channel top width including ineffective areas. Shape
(n_profiles,).
- property top_width_left_ob_with_ineffective: ndarray¶
Left overbank top width including ineffective areas. Shape
(n_profiles,).
- property top_width_right_ob_with_ineffective: ndarray¶
Right overbank top width including ineffective areas. Shape
(n_profiles,).
- class rivia.hdf.steady_plan.CrossSectionResultsCollection(hdf)[source]¶
Bases:
CrossSectionCollectionSteady-plan cross section collection with profile results.
Combines geometry from
Geometry/Cross Sectionswith steady-flow result data fromResults/Steady/Output/.... Each item is aCrossSectionResultsinstance.- Parameters:
hdf (
File) – Openh5py.Filehandle.
- class rivia.hdf.steady_plan.LateralResults(geom, group)[source]¶
Bases:
LateralStructureGeometry and steady-profile results for one lateral structure.
Inherits all geometry attributes from
LateralStructure.All result properties return
numpyarrays. Scalar results (one value per profile) have shape(n_profiles,). Segment-level results have shape(n_profiles, n_segments)or(n_segments,)for static arrays.Note
Bridge, culvert, and inline structure nodes do not have separate result datasets in HEC-RAS 1D steady-flow HDF files.
StructureCollectionreturns plain geometry objects for those types.- Parameters:
geom (
LateralStructure) – Geometry object fromStructureCollection.group (
Group) –h5py.GroupatResults/Steady/.../Steady Profiles/Lateral Structures/<name>.
- property segment_flow: ndarray¶
Flow through each HW-TW segment per profile.
Shape
(n_profiles, n_segments).
- property segment_headwater_rs: ndarray¶
Headwater reach station (RS) for each HW-TW segment.
Shape
(n_segments,), dtype byte-string — decode withseg.astype(str)if needed.
- property segment_stations: ndarray¶
Lateral structure chainage station for each HW-TW segment.
Shape
(n_segments,).
- property segment_wse_hw: ndarray¶
Headwater water-surface elevation at each segment per profile.
Shape
(n_profiles, n_segments).
- property segment_wse_tw: ndarray¶
Tailwater water-surface elevation at each segment per profile.
Shape
(n_profiles, n_segments).
- property stage_hw: ndarray¶
Headwater stage (weighted average along structure). Shape
(n_profiles,).
- property structure_variables: ndarray¶
All structure variables. Shape
(n_profiles, n_vars).Column names are in
variable_names.
- class rivia.hdf.steady_plan.RunStatus(solution, run_window)[source]¶
Bases:
objectRun metadata from
Results/Steady/Summary.- Variables:
solution – HEC-RAS solution status string, e.g.
"Steady Finished Successfully".run_window – Wall-clock window during which the simulation ran, e.g.
"11APR2026 11:53:38 to 11APR2026 11:53:39".
- Parameters:
- parse_run_window()[source]¶
Parse
run_windowinto(start, end)datetimes.Splits the raw string on
" to "and parses each half with the HEC-RAS timestamp format"%d%b%Y %H:%M:%S".- Returns:
(start, end)as timezone-naivedatetime.datetimeobjects, orNonewhen the string is missing, malformed, or cannot be parsed.- Return type:
tuple[datetime, datetime] or None
Examples
s = hdf.compute_summary() window = s.run.parse_run_window() if window: start, end = window print(end - start) # wall-clock duration
- class rivia.hdf.steady_plan.SteadyPlan(filename)[source]¶
Bases:
_PlanHdf,GeometryRead HEC-RAS steady-flow plan HDF5 output files (
*.p*.hdf).A steady plan HDF file contains the same
Geometry/data as a geometry HDF file, plusResults/Steady/...profile-based output.Results are indexed by steady-flow profile name (e.g.
"Big","Bigger","Biggest"). Each result array has shape(n_profiles,)where each index corresponds to a profile.- Parameters:
filename (
str|Path) – Path to the plan HDF file. The.hdfsuffix is appended automatically if absent.
Examples
with SteadyPlan("Baxter.p01") as hdf: profiles = hdf.profile_names # ["Big", "Bigger", "Biggest"] xs = hdf.cross_sections["Baxter River Lower Reach 27470."] wse = xs.wse # shape (3,) vel = xs.velocity_channel # shape (3,) sa = hdf.storage_areas["Northside"] sa_wse = sa.wse # shape (3,)
- compute_summary()[source]¶
Return the steady simulation summary.
Reads the
Results/Steady/Summarygroup and returns aComputeSummarydataclass with run metadata.Steady-flow runs do not produce volume accounting; call
ComputeSummary.ok()to check whether the solution finished successfully.- Return type:
- Raises:
KeyError – If
Results/Steady/Summaryis absent from the HDF file.
Examples
with SteadyPlan("Baxter.p01") as hdf: s = hdf.compute_summary() print(s.run.solution) if s.ok(): print("Run completed successfully")
- property cross_sections: CrossSectionResultsCollection¶
1-D cross sections with geometry and steady-profile results.
- property ras_version: str¶
HEC-RAS version string from the plan HDF root attribute.
Returns the
File Versionroot attribute, e.g.'HEC-RAS 6.6 September 2024'.
- runtime_log()[source]¶
Read the runtime compute log from
Results/Summary/.- Returns:
Log container with the full text/RTF compute messages and the compute-process table. Steady-specific parsing methods will be added to
SteadyRuntimeLogas the library evolves.- Return type:
SteadyRuntimeLog
- Raises:
KeyError – If
Results/Summaryis absent from the HDF file.
- property storage_areas: StorageAreaResultsCollection¶
Storage areas with geometry and steady-profile results.
- property structures: StructureResultsCollection¶
All structures with geometry and, where available, steady-profile results.
LateralStructureitems are upgraded toLateralResultswhen result data is present.Bridge, culvert, and inline structure items are returned as plain geometry objects — HEC-RAS 1D steady-flow HDF files do not store separate result datasets for those node types.
- class rivia.hdf.steady_plan.StorageAreaResults(sa, sa_index, sa_group)[source]¶
Bases:
StorageAreaGeometry and steady-profile results for one storage area.
Inherits all geometry properties from
StorageArea.All result properties return a
numpyarray of shape(n_profiles,)where each index corresponds to a named steady-flow profile. UseSteadyPlan.profile_namesto map indices to profile names.- Parameters:
sa (
StorageArea) – Parent geometry object whose fields are copied into this instance.sa_index (
int) – 0-based column index of this SA in the(n_profiles, n_sa)datasetsWater SurfaceandFlowstored underResults/Steady/.../Storage Areas.sa_group (
Group|None) –h5py.GroupatResults/Steady/.../Steady Profiles/Storage Areas, orNonewhen the plan has no storage-area results.
- property connection_names: list[str]¶
Names of the inflow connection sources.
Falls back to index-based names if the attribute is absent.
- property connections: ndarray | None¶
Flow from each named connection.
Shape
(n_profiles, n_conns), orNonewhen absent. Column names are inconnection_names.
- class rivia.hdf.steady_plan.StorageAreaResultsCollection(hdf)[source]¶
Bases:
StorageAreaCollectionCollection of
StorageAreaResultsbacked by a steady plan HDF.Overrides
StorageAreaCollectionto returnStorageAreaResultswith both geometry and steady results.- Parameters:
hdf (h5py.File)
- class rivia.hdf.steady_plan.StructureResultsCollection(hdf)[source]¶
Bases:
StructureCollectionSteady-plan structure collection.
Upgrades
LateralStructuregeometry objects toLateralResultswhen a matching result group exists underResults/Steady/.../Steady Profiles/Lateral Structures.All other structure types (Bridge, Culvert, Inline) are returned as plain geometry objects — HEC-RAS 1D steady-flow HDF files do not store separate result datasets for those node types.
- Parameters:
hdf (h5py.File)