HDF Modules¶
Classes for reading and processing HEC-RAS HDF result files.
Core Classes¶
HdfBase¶
Base functionality for HDF file operations.
get_dataset_info(hdf_path, group_path=None)- Print HDF structureget_attrs(hdf_path, path)- Get attributes at pathget_projection(hdf_path)- Get coordinate systemparse_ras_datetime(datetime_str)- Parse HEC-RAS datetime stringparse_ras_datetime_ms(datetime_bytes)- Parse datetime with milliseconds
HdfPlan¶
Plan-level information from HDF files.
get_plan_info(hdf_path)- Get plan metadataget_simulation_times(hdf_path)- Get start/end timesget_plan_parameters(hdf_path)- Get computation parametersget_2d_flow_options(hdf_path)- Get 2D equation set, initial condition time, tolerances, and solver options from computed HDF output
Mesh Operations¶
HdfMesh¶
Mesh geometry data.
get_mesh_area_names(hdf_path)- List 2D flow areasget_mesh_cell_polygons(hdf_path)- Get cell polygons as GeoDataFrameget_mesh_cell_faces(hdf_path)- Get cell face linesget_mesh_cell_points(hdf_path)- Get cell center pointsget_mesh_perimeter(hdf_path)- Get mesh perimeter polygonget_mesh_cell_count(hdf_path)- Get number of cellsget_nearest_cell(hdf_path, point)- Find nearest cell to pointget_nearest_face(hdf_path, point)- Find nearest face to point
HdfResultsMesh¶
2D mesh results.
get_mesh_max_ws(hdf_path)- Maximum water surface elevationget_mesh_max_ws_time(hdf_path)- Time of maximum WSEget_mesh_max_depth(hdf_path)- Maximum depthget_mesh_max_face_v(hdf_path)- Maximum face velocityget_mesh_timeseries(hdf_path, mesh, var)- Time series for meshget_mesh_cells_timeseries(hdf_path, mesh, cell_ids, var)- Cell time seriesget_mesh_faces_timeseries(hdf_path, mesh, face_ids, var)- Face time seriesget_profile_line_flow_timeseries(hdf_path, line_name, mesh_name=None, profile_lines_path=None, direction="absolute")- Flow time series across a RAS Mapper profile/reference lineget_profile_line_peak_flow(hdf_path, line_name, mesh_name=None, profile_lines_path=None, direction="absolute")- Peak Q and peak time for a profile/reference line
Plan Results¶
HdfResultsPlan¶
Plan-level results.
get_runtime_data(hdf_path)- Runtime statisticsget_volume_accounting(hdf_path)- Volume accounting dataget_compute_messages(hdf_path)- Computation messagesget_compute_options(hdf_path)- Computation options usedis_steady_plan(hdf_path)- Check if steady stateget_steady_profile_names(hdf_path)- Get steady profile namesget_steady_wse(hdf_path)- Get steady water surface elevationsget_steady_info(hdf_path)- Get steady flow metadata
HdfResultsXsec¶
1D cross-section results.
get_xsec_timeseries(hdf_path)- All cross-section time seriesget_xsec_summary(hdf_path)- Cross-section summary data
1D Geometry¶
HdfXsec¶
Cross-section and river geometry extraction from HDF.
get_cross_sections(hdf_path)- Extract cross-section geometries as GeoDataFrameget_river_centerlines(hdf_path)- Extract river centerlinesget_river_stationing(hdf_path)- Calculate river stationing along centerlinesget_river_reaches(hdf_path)- Return model 1D river reach linesget_river_edge_lines(hdf_path)- Return river edge linesget_river_bank_lines(hdf_path)- Extract river bank lines
Structure Data¶
HdfStruc¶
Structure geometry and SA/2D connections.
get_connection_list(hdf_path)- List SA/2D connectionsget_connection_profile(hdf_path, name)- Get connection profileget_connection_gates(hdf_path, name)- Get gate data
HdfResultsBreach¶
Dam breach results.
get_breach_timeseries(hdf_path, structure)- Breach time seriesget_breach_summary(hdf_path, structure)- Breach summary statisticsget_breaching_variables(hdf_path, structure)- Breach geometry evolutionget_structure_variables(hdf_path, structure)- Structure flow variables
HdfStorageArea¶
Storage area volume-elevation curve extraction from HDF.
get_volume_elevation_curve(hdf_path, sa_name)- Get volume-elevation curve for a storage areaget_storage_area_names(hdf_path)- List storage areas in HDF
HdfChannelCapacity¶
1D channel capacity analysis (multi-AEP).
get_channel_capacity(hdf_path, river=None, reach=None)- Compute channel capacity from cross-section geometry and resultsget_multi_aep_capacity(hdf_paths, aep_labels)- Compare capacity across multiple AEP simulations
HdfStruc1D¶
1D inline structure data extraction from HDF.
get_inline_structure_data(hdf_path)- Extract inline structure geometry and resultsget_structure_flow_timeseries(hdf_path, structure_name)- Get flow time series through a structure
HdfHydraulicTables¶
Cross section property tables (HTAB).
get_xs_htab(hdf_path, river, reach, station)- Get HTAB data
Infrastructure¶
HdfPipe¶
Pipe network analysis.
get_pipe_conduits(hdf_path)- Get conduit geometryget_pipe_nodes(hdf_path)- Get node locationsget_pipe_network_timeseries(hdf_path, var)- Network time seriesget_pipe_network_summary(hdf_path)- Network summaryget_pipe_profile(hdf_path, conduit_id)- Get conduit profile
HdfPump¶
Pump station analysis.
get_pump_stations(hdf_path)- Get station locationsget_pump_groups(hdf_path)- Get pump groupsget_pump_station_timeseries(hdf_path, name)- Station time seriesget_pump_station_summary(hdf_path)- Station summaryget_pump_operation_timeseries(hdf_path, name)- Operation history
Analysis¶
HdfFluvialPluvial¶
Fluvial-pluvial boundary analysis.
calculate_fluvial_pluvial_boundary(hdf_path, delta_t)- Calculate boundary
HdfInfiltration¶
Infiltration parameter management from HDF geometry files.
Geometry File Operations:
get_infiltration_baseoverrides(hdf_path)- Retrieve infiltration parameters from geometry HDFset_infiltration_baseoverrides(hdf_path, data)- Set infiltration parameters
Raster and Layer Operations:
get_infiltration_layer_data(hdf_path)- Get infiltration layer data from HDFget_classification_polygons(hdf_path)- Read infiltration sidecar classification polygon overridesget_infiltration_map(hdf_path)- Read infiltration raster mapcalculate_soil_statistics(hdf_path)- Process zonal statistics for soil analysis
Soil Analysis:
get_significant_mukeys(hdf_path, threshold)- Identify mukeys above percentage thresholdcalculate_total_significant_percentage(hdf_path)- Compute total coverageget_infiltration_parameters(hdf_path, mukey)- Get parameters for specific mukeycalculate_weighted_parameters(hdf_path)- Compute weighted average parameters
Data Export:
save_statistics(data, path)- Export soil statistics to CSV
HdfLandCover¶
Land-cover sidecar and final Manning's n extraction.
get_landcover_raster_map(hdf_path)- Read land-cover class IDs, names, and Manning's n valuesget_classification_polygons(hdf_path)- Read land-cover sidecar classification polygon overridesget_preprocessed_mannings_n(hdf_path)- Read preprocessed cell-center Manning's n values from geometry HDF
HdfBndry¶
Boundary condition geometry.
get_bc_lines(hdf_path)- Get BC linesget_breaklines(hdf_path)- Get breaklines
Utilities¶
HdfUtils¶
Utility class for HDF file operations.
Data Conversion:
convert_ras_string(value)- Convert RAS HDF strings to Python objectsconvert_ras_hdf_value(value)- Convert general HDF values to Python objectsconvert_df_datetimes_to_str(df)- Convert DataFrame datetime columns to stringsconvert_hdf5_attrs_to_dict(attrs)- Convert HDF5 attributes to dictionaryconvert_timesteps_to_datetimes(timesteps)- Convert timesteps to datetime objects
Spatial Operations:
perform_kdtree_query(source, target)- KDTree search between datasetsfind_nearest_neighbors(data, k)- Find nearest neighbors within dataset
DateTime Parsing:
parse_ras_datetime(datetime_str)- Parse RAS datetime (ddMMMYYYY HH:MM:SS)parse_ras_window_datetime(datetime_str)- Parse simulation window datetimeparse_duration(duration_str)- Parse duration strings (HH:MM:SS)parse_ras_datetime_ms(datetime_bytes)- Parse datetime with millisecondsparse_run_time_window(window_str)- Parse time window strings
Visualization¶
HdfPlot & HdfResultsPlot¶
Basic plotting utilities.
plot_results_max_wsel(gdf)- Plot maximum WSE map
Usage Example¶
from ras_commander import HdfResultsMesh, HdfResultsPlan, init_ras_project
init_ras_project("/path/to/project", "6.5")
# Get HDF path
hdf_path = ras.plan_df.loc[ras.plan_df['plan_number'] == '01', 'hdf_path'].iloc[0]
# Extract max WSE
max_wse = HdfResultsMesh.get_mesh_max_ws(hdf_path)
# Get runtime stats
runtime = HdfResultsPlan.get_runtime_data(hdf_path)