RasPlanHdf
- class rashdf.RasPlanHdf(name: str, **kwargs)
Bases:
RasGeomHdfHEC-RAS Plan HDF class.
- bc_line_timeseries_output(bc_line_name: str) Dataset
Return timeseries output data for a specific boundary condition line from a HEC-RAS HDF plan file.
- Parameters:
- bc_line_namestr
The name of the boundary condition line.
- Returns:
- xr.Dataset
An xarray Dataset with timeseries output data for the specified boundary condition line.
- bc_lines_timeseries_output() Dataset
Return timeseries output data for boundary conditions lines from a HEC-RAS HDF plan file.
- Returns:
- xr.Dataset
An xarray Dataset with timeseries output data for boundary conditions lines.
- cross_sections_additional_area_total() DataFrame
Return the 1D cross section area for each profile.
- Returns:
- DataFrame
A DataFrame containing the wet area inside the cross sections
- cross_sections_additional_enc_station_left() DataFrame
Return the left side encroachment information for a floodway plan hdf.
- Returns:
- DataFrame
A DataFrame containing the cross sections left side encroachment stations
- cross_sections_additional_enc_station_right() DataFrame
Return the right side encroachment information for a floodway plan hdf.
- Returns:
- DataFrame
A DataFrame containing the cross sections right side encroachment stations
- cross_sections_additional_velocity_total() DataFrame
Return the 1D cross section velocity for each profile.
- Returns:
- DataFrame
A DataFrame containing the velocity inside the cross sections
- cross_sections_energy_grade() DataFrame
Return the energy grade information for each 1D Cross Section.
- Returns:
- DataFrame
A Dataframe containing the water surface elevations for each cross section and event
- cross_sections_flow() DataFrame
Return the Flow information for each 1D Cross Section.
- Returns:
- DataFrame
A Dataframe containing the flow for each cross section and event
- cross_sections_wsel() DataFrame
Return the water surface elevation information for each 1D Cross Section.
- Returns:
- DataFrame
A Dataframe containing the water surface elevations for each cross section and event
- get_meteorology_precip_attrs() Dict
Return precipitation attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of precipitation attributes.
- get_plan_info_attrs() Dict
Return plan information attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of plan information attributes.
- get_plan_param_attrs() Dict
Return plan parameter attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of plan parameter attributes.
- get_results_unsteady_attrs() Dict
Return unsteady attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of unsteady attributes.
- get_results_unsteady_summary_attrs() Dict
Return results unsteady summary attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of results summary attributes.
- get_results_volume_accounting_attrs() Dict
Return volume accounting attributes from a HEC-RAS HDF plan file.
- Returns:
- dict
Dictionary of volume accounting attributes.
- gridded_precip(timestamps: Sequence[datetime] | Series | None = None, precip_attrs: Dict | None = None) DataArray
Return precipitation timeseries input data from a HEC-RAS HDF plan file.
Requires the ‘rioxarray’ package.
- Parameters:
- timestampsOptional[Union[Sequence[datetime], pd.Series]], optional
Optional sequence of timestamps to use for the time coordinate. If None, timestamps will be read from the HDF file.
- precip_attrsOptional[Dict], optional
Optional dictionary of precipitation attributes. If None, attributes will be read from the HDF file.
- Returns:
- xr.DataArray
An xarray DataArray with precipitation timeseries input data.
- mesh_cell_faces(include_output: bool | List[SummaryOutputVar] | List[str] = True, round_to: str = '0.1 s', datetime_to_str: bool = False) GeoDataFrame
Return the cell faces for each cell in the mesh, including output.
- Parameters:
- include_outputUnion[bool, List[SummaryOutputVar], List[str]], optional
If True, include all available summary output data in the GeoDataFrame. If a list of SummaryOutputVar values, include only the specified summary output data. If a list of strings, include only the specified summary output data by name. If False, do not include any summary output data. (default: True)
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds).
- datetime_to_strbool, optional
If True, convert datetime columns to strings. (default: False)
- Returns:
- GeoDataFrame
A GeoDataFrame with columns ‘mesh_name’, ‘cell_id’, ‘geometry’, and columns for each summary output variable.
- mesh_cell_points(include_output: bool | List[SummaryOutputVar] | List[str] = True, round_to: str = '0.1 s', datetime_to_str: bool = False) GeoDataFrame
Return the cell points for each cell in the mesh, including summary output.
- Parameters:
- include_outputUnion[bool, List[SummaryOutputVar], List[str]], optional
If True, include all available summary output data in the GeoDataFrame. If a list of SummaryOutputVar values, include only the specified summary output data. If a list of strings, include only the specified summary output data by name. If False, do not include any summary output data. (default: True)
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds).
- datetime_to_strbool, optional
If True, convert datetime columns to strings. (default: False)
- Returns:
- GeoDataFrame
A GeoDataFrame with columns ‘mesh_name’, ‘cell_id’, ‘geometry’, and columns for each summary output variable.
- mesh_cell_polygons(include_output: bool | List[SummaryOutputVar] | List[str] = True, round_to: str = '0.1 s', datetime_to_str: bool = False) GeoDataFrame
Return the cell polygons for each cell in the mesh, including output.
- Parameters:
- include_outputUnion[bool, List[SummaryOutputVar], List[str]], optional
If True, include all available summary output data in the GeoDataFrame. If a list of SummaryOutputVar values, include only the specified summary output data. If a list of strings, include only the specified summary output data by name. If False, do not include any summary output data. (default: True)
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds).
- datetime_to_strbool, optional
If True, convert datetime columns to strings. (default: False)
- Returns:
- GeoDataFrame
A GeoDataFrame with columns ‘mesh_name’, ‘cell_id’, ‘geometry’, and columns for each summary output variable.
- mesh_cells_summary_output(round_to: str = '0.1 s') DataFrame
Return a DataFrame with summary output data for each mesh cell in the model.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, and columns for each summary output variable.
- mesh_cells_timeseries_output(mesh_name: str) Dataset
Return the time series output data for cells in a 2D flow area mesh.
- Parameters:
- mesh_namestr
The name of the 2D flow area mesh.
- Returns:
- xr.Dataset
An xarray Dataset with DataArrays for each time series output variable.
- mesh_faces_summary_output(round_to: str = '0.1 s') DataFrame
Return a DataFrame with summary output data for each mesh face in the model.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘face_id’, and columns for each summary output variable.
- mesh_faces_timeseries_output(mesh_name: str) Dataset
Return the time series output data for faces in a 2D flow area mesh.
- Parameters:
- mesh_namestr
The name of the 2D flow area mesh.
- Returns:
- xr.Dataset
An xarray Dataset with DataArrays for each time series output variable.
- mesh_last_iter() DataFrame
Return the number of times each cell in the mesh was the last cell to converge.
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, and ‘last_iter’.
- mesh_max_face_v(round_to: str = '0.1 s') DataFrame
Return the max face velocity for each face in the mesh.
Includes the corresponding time of max face velocity.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘face_id’, ‘max_v’, and ‘max_v_time’.
- mesh_max_iter() DataFrame
Return the number of times each cell in the mesh reached the max number of iterations.
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, and ‘max_iterations’.
- mesh_max_ws(round_to: str = '0.1 s') DataFrame
Return the max water surface elevation for each cell in the mesh.
Includes the corresponding time of max water surface elevation.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, ‘max_ws’, and ‘max_ws_time’.
- mesh_max_ws_err(round_to: str = '0.1 s') DataFrame
Return the max water surface error for each cell in the mesh.
Includes the corresponding time of max water surface error.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, ‘max_ws_err’, and ‘max_ws_err_time’.
- mesh_min_face_v(round_to: str = '0.1 s') DataFrame
Return the min face velocity for each face in the mesh.
Includes the corresponding time of min face velocity.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘face_id’, ‘min_v’, and ‘min_v_time’.
- mesh_min_ws(round_to: str = '0.1 s') DataFrame
Return the min water surface elevation for each cell in the mesh.
Includes the corresponding time of min water surface elevation.
- Parameters:
- round_tostr, optional
The time unit to round the datetimes to. Default: “0.1 s” (seconds). See Pandas documentation for valid time units: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html
- Returns:
- DataFrame
A DataFrame with columns ‘mesh_name’, ‘cell_id’, ‘min_ws’, and ‘min_ws_time’.
- observed_timeseries_input(vartype: str = 'Flow') DataArray
Return observed timeseries input data for reference lines and points from a HEC-RAS HDF plan file.
- Parameters:
- vartypestr, optional
The type of observed data to retrieve. Must be either “Flow” or “Stage”. (default: “Flow”)
- Returns:
- xr.DataArray
An xarray DataArray with observed timeseries input data for reference lines or reference points.
- reference_lines(include_output: bool = True, datetime_to_str: bool = False) GeoDataFrame
Return the reference lines from a HEC-RAS HDF plan file.
Includes summary output data for each reference line: - Maximum flow & time (max_q, max_q_time) - Minimum flow & time (min_q, min_q_time) - Maximum water surface elevation & time (max_ws, max_ws_time) - Minimum water surface elevation & time (min_ws, min_ws_time)
- Parameters:
- include_outputbool, optional
If True, include summary output data in the GeoDataFrame. (default: True)
- datetime_to_strbool, optional
If True, convert datetime columns to strings. (default: False)
- Returns:
- GeoDataFrame
A GeoDataFrame with reference line geometry and summary output data.
- reference_lines_names(mesh_name: str | None = None) Dict[str, List[str]] | List[str]
Return reference line names.
If a mesh name is provided, return a list of the reference line names for that mesh area. If no mesh name is provided, return a dictionary of mesh names and their reference line names.
- Parameters:
- mesh_namestr, optional
The name of the mesh area for which to return reference line names.
- Returns:
- Union[Dict[str, List[str]], List[str]]
A dictionary of mesh names and their reference line names if mesh_name is None. A list of reference line names for the specified mesh area if mesh_name is not None.
- reference_lines_timeseries_output() Dataset
Return timeseries output data for reference lines from a HEC-RAS HDF plan file.
- Returns:
- xr.Dataset
An xarray Dataset with timeseries output data for reference lines.
- reference_points(include_output: bool = True, datetime_to_str: bool = False) GeoDataFrame
Return the reference points from a HEC-RAS HDF plan file.
- Parameters:
- include_outputbool, optional
If True, include summary output data in the GeoDataFrame. (default: True)
- datetime_to_strbool, optional
If True, convert datetime columns to strings. (default: False)
- Includes summary output data for each reference point:
- - Maximum flow & time (max_q, max_q_time)
- - Minimum flow & time (min_q, min_q_time)
- - Maximum water surface elevation & time (max_ws, max_ws_time)
- - Minimum water surface elevation & time (min_ws, min_ws_time)
- Returns:
- GeoDataFrame
A GeoDataFrame with reference point geometry and summary output data.
- reference_points_names(mesh_name: str | None = None) Dict[str, List[str]] | List[str]
Return reference point names.
If a mesh name is provided, return a list of the reference point names for that mesh area. If no mesh name is provided, return a dictionary of mesh names and their reference point names.
- Parameters:
- mesh_namestr, optional
The name of the mesh area for which to return reference point names.
- Returns:
- Union[Dict[str, List[str]], List[str]]
A dictionary of mesh names and their reference point names if mesh_name is None. A list of reference point names for the specified mesh area if mesh_name is not None.
- reference_points_timeseries_output() Dataset
Return timeseries output data for reference points from a HEC-RAS HDF plan file.
- Returns:
- xr.Dataset
An xarray Dataset with timeseries output data for reference points.
- reference_summary_output(reftype: str = 'lines') DataFrame
Return summary output data for reference lines or points from a HEC-RAS HDF plan file.
- Returns:
- DataFrame
A DataFrame with reference line summary output data.
- steady_flow_names() List[str]
Return the profile information for each steady flow event.
- Returns:
- DataFrame
A Dataframe containing the profile names for each event
- steady_profile_xs_output(var: XsSteadyOutputVar, round_to: int = 2) DataFrame
Create a Dataframe from steady cross section results based on path.
- Parameters:
- varXsSteadyOutputVar
The name of the table in the steady results that information is to be retireved from.
- round_toint, optional
Number of decimal places to round output data to.
- Returns:
- Dataframe with desired hdf data.
- zmeta_mesh_cells_timeseries_output(mesh_name: str) Dict
Return kerchunk-style zarr reference metadata.
Requires the ‘zarr’ and ‘kerchunk’ packages.
- Returns:
- dict
Dictionary of kerchunk-style zarr reference metadata.
- zmeta_mesh_faces_timeseries_output(mesh_name: str) Dict
Return kerchunk-style zarr reference metadata.
Requires the ‘zarr’ and ‘kerchunk’ packages.
- Returns:
- dict
Dictionary of kerchunk-style zarr reference metadata.
- zmeta_reference_lines_timeseries_output() Dict
Return kerchunk-style zarr reference metadata.
Requires the ‘zarr’ and ‘kerchunk’ packages.
- Returns:
- dict
Dictionary of kerchunk-style zarr reference metadata.
- zmeta_reference_points_timeseries_output() Dict
Return kerchunk-style zarr reference metadata.
Requires the ‘zarr’ and ‘kerchunk’ packages.
- Returns:
- dict
Dictionary of kerchunk-style zarr reference metadata.