### Install rashdf with pip Source: https://rashdf.readthedocs.io/en/latest/index.html Install the rashdf library using pip. ```bash pip install rashdf ``` -------------------------------- ### RasHdf.__init__ Source: https://rashdf.readthedocs.io/en/latest/_sources/RasHdf.rst.txt Constructor for the RasHdf class. Initializes a new instance of the RasHdf object. ```APIDOC ## RasHdf.__init__ ### Description Constructor for the RasHdf class. Initializes a new instance of the RasHdf object. ### Method Constructor ### Signature __init__(self, ...) ### Parameters No parameters are explicitly documented in the source. ### Returns A new RasHdf instance. ``` -------------------------------- ### RasHdf.__init__() Source: https://rashdf.readthedocs.io/en/latest/RasHdf.html Constructor for the RasHdf class. Opens a HEC-RAS HDF file from a local path. Accepts additional keyword arguments to pass to h5py.File. ```APIDOC ## RasHdf.__init__() ### Description Open a HEC-RAS HDF file. ### Method Constructor ### Endpoint RasHdf.__init__(name: str, **kwargs) ### Parameters #### Parameters - **name** (str) - Required - The path to the RAS HDF file. - **kwargs** (dict) - Optional - Additional keyword arguments to pass to h5py.File. ### Request Example ```python hdf = RasHdf("path/to/file.hdf") ``` ### Response #### Success Response No return value. Initializes the RasHdf instance. #### Response Example No response body. ``` -------------------------------- ### Generate and combine Zarr metadata for multiple simulations Source: https://rashdf.readthedocs.io/en/latest/Advanced.html Requires optional libraries kerchunk, zarr, fsspec, and s3fs. Generates Zarr metadata for each simulation in a range, saves each to a JSON file, then combines them into a single Kerchunk metadata file with a new 'sim' dimension using MultiZarrToZarr. Note: the code uses 'mss.translate()' which is likely a typo for 'mzz.translate()'. ```python from rashdf import RasPlanHdf from kerchunk.combine import MultiZarrToZarr import json # Example S3 URL pattern for HEC-RAS plan HDF5 files s3_url_pattern = "s3://bucket/simulations/{sim}/BigRiver.p01.hdf" zmeta_files = [] sims = list(range(1, 11)) # Generate Zarr metadata for each simulation for sim in sims: s3_url = s3_url_pattern.format(sim=sim) plan_hdf = RasPlanHdf.open_uri(s3_url) zmeta = plan_hdf.zmeta_mesh_cells_timeseries_output("BigRiverMesh1") json_file = f"BigRiver.{sim}.p01.hdf.json" with open(json_file, "w") as f: json.dump(zmeta, f) zmeta_files.append(json_file) # Combine Zarr metadata files into a single Kerchunk metadata file # with a new "sim" dimension mzz = MultiZarrToZarr(zmeta_files, concat_dims=["sim"], coo_map={"sim": sims}) mzz_dict = mss.translate() with open("BigRiver.combined.p01.json", "w") as f: json.dump(mzz_dict, f) ``` -------------------------------- ### RasPlanHdf.get_plan_param_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves plan parameter attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_plan_param_attrs() ### Description Retrieves plan parameter attributes from the plan HDF5 file. ### Method get_plan_param_attrs() ### Parameters None ### Returns - Dictionary of plan parameter attributes. ``` -------------------------------- ### RasPlanHdf.get_plan_info_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves plan information attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_plan_info_attrs() ### Description Retrieves plan information attributes from the plan HDF5 file. ### Method get_plan_info_attrs() ### Parameters None ### Returns - Dictionary of plan information attributes. ``` -------------------------------- ### Open a HEC-RAS HDF file from a URI Source: https://rashdf.readthedocs.io/en/latest/RasHdf.html Demonstrates how to open a HEC-RAS HDF file located at a URI, such as an S3 bucket, using the open_uri class method. ```python >>> results_hdf = RasHdf.open_uri("s3://my-bucket/results.hdf") ``` -------------------------------- ### RasHdf.open_uri() Source: https://rashdf.readthedocs.io/en/latest/RasHdf.html Class method to open a HEC-RAS HDF file from a URI. Uses fsspec to handle URIs like S3 or Google Cloud Storage paths. Returns a RasHdf instance. ```APIDOC ## RasHdf.open_uri() ### Description Open a HEC-RAS HDF file from a URI. ### Method Classmethod ### Endpoint RasHdf.open_uri(uri: str, fsspec_kwargs: dict = {}, h5py_kwargs: dict = {}) -> RasHdf ### Parameters #### Parameters - **uri** (str) - Required - The URI of the RAS HDF file. Should be a path recognized by fsspec, such as an S3 path or a Google Cloud Storage path. - **fsspec_kwargs** (dict) - Optional - Additional keyword arguments to pass to fsspec.open. - **h5py_kwargs** (dict) - Optional - Additional keyword arguments to pass to h5py.File. ### Request Example ```python results_hdf = RasHdf.open_uri("s3://my-bucket/results.hdf") ``` ### Response #### Success Response Returns a RasHdf object representing the opened file. #### Response Example ```python RasHdf instance ``` ``` -------------------------------- ### Open combined dataset with xarray Source: https://rashdf.readthedocs.io/en/latest/Advanced.html Opens the combined Kerchunk metadata file as a Zarr dataset using xarray's reference file system. The dataset includes a new 'sim' dimension. ```python import xarray as xr ds = xr.open_dataset( "reference://", engine="zarr", backend_kwargs={ "consolidated": False, "storage_options": {"fo": "BigRiver.combined.p01.json"}, }, chunks="auto", ) ``` -------------------------------- ### RasPlanHdf.reference_summary_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves reference summary output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_summary_output() ### Description Retrieves reference summary output data from the plan HDF5 file. ### Method reference_summary_output() ### Parameters None ### Returns - Reference summary output data. ``` -------------------------------- ### get_plan_param_attrs() -> Dict Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns plan parameter attributes from a HEC-RAS HDF plan file. ```APIDOC ## get_plan_param_attrs() -> Dict ### Description Returns plan parameter attributes from a HEC-RAS HDF plan file. ### Method get_plan_param_attrs ### Returns - **dict** - Dictionary of plan parameter attributes. ``` -------------------------------- ### Read plan data from HEC-RAS plan HDF file on AWS S3 with RasPlanHdf.open_uri Source: https://rashdf.readthedocs.io/en/latest/index.html Opens a HEC-RAS plan HDF file from an S3 URI and retrieves plan information attributes. Requires optional fsspec and s3fs libraries and S3 credentials. ```python >>> from rashdf import RasPlanHdf >>> with RasPlanHdf.open_uri('s3://bucket/ElkMiddle.p01.hdf') as plan_hdf: ... plan_info = plan_hdf.get_plan_info_attrs() >>> plan_info {'Base Output Interval': '1HOUR', 'Computation Time Step Base': '1MIN', 'Flow Filename': 'ElkMiddle.u01', 'Flow Title': 'Jan_1996', 'Geometry Filename': 'ElkMiddle.g01', 'Geometry Title': 'ElkMiddle', 'Plan Filename': 'ElkMiddle.p01', 'Plan Name': 'Jan_1996', 'Plan ShortID': 'Jan_1996', 'Plan Title': 'Jan_1996', 'Project Filename': 'g:\Jan1996_Kanawha_CloudPrep\Elk Middle\ElkMiddle.prj', 'Project Title': 'ElkMiddle', 'Simulation End Time': datetime.datetime(1996, 2, 7, 12, 0), 'Simulation Start Time': datetime.datetime(1996, 1, 14, 12, 0), 'Time Window': [datetime.datetime(1996, 1, 14, 12, 0), datetime.datetime(1996, 2, 7, 12, 0)]} ``` -------------------------------- ### get_plan_info_attrs() -> Dict Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns plan information attributes from a HEC-RAS HDF plan file. ```APIDOC ## get_plan_info_attrs() -> Dict ### Description Returns plan information attributes from a HEC-RAS HDF plan file. ### Method get_plan_info_attrs ### Returns - **dict** - Dictionary of plan information attributes. ``` -------------------------------- ### RasPlanHdf.mesh_min_ws() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the minimum water surface elevation from the mesh data in the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_min_ws() ### Description Retrieves the minimum water surface elevation from the mesh data in the plan HDF5 file. ### Method mesh_min_ws() ### Parameters None ### Returns - Minimum water surface elevation value. ``` -------------------------------- ### RasPlanHdf.steady_profile_xs_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves steady profile cross-section output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.steady_profile_xs_output() ### Description Retrieves steady profile cross-section output data from the plan HDF5 file. ### Method steady_profile_xs_output() ### Parameters None ### Returns - Steady profile cross-section output data. ``` -------------------------------- ### RasHdf.open_uri Source: https://rashdf.readthedocs.io/en/latest/_sources/RasHdf.rst.txt Opens a URI for the RasHdf object. This method is part of the public API of the RasHdf class. ```APIDOC ## RasHdf.open_uri ### Description Opens a URI for the RasHdf object. This method is part of the public API of the RasHdf class. ### Method open_uri ### Signature open_uri(self, ...) ### Parameters No parameters are explicitly documented in the source. ### Returns No return value is explicitly documented in the source. ``` -------------------------------- ### RasPlanHdf.reference_lines() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves reference lines data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_lines() ### Description Retrieves reference lines data from the plan HDF5 file. ### Method reference_lines() ### Parameters None ### Returns - Reference lines data. ``` -------------------------------- ### RasPlanHdf.zmeta_reference_points_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves zmeta reference points timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.zmeta_reference_points_timeseries_output() ### Description Retrieves zmeta reference points timeseries output data from the plan HDF5 file. ### Method zmeta_reference_points_timeseries_output() ### Parameters None ### Returns - Zmeta reference points timeseries output data. ``` -------------------------------- ### RasPlanHdf.reference_points() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves reference points data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_points() ### Description Retrieves reference points data from the plan HDF5 file. ### Method reference_points() ### Parameters None ### Returns - Reference points data. ``` -------------------------------- ### zmeta_reference_points_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns kerchunk-style zarr reference metadata for reference points timeseries output. ```APIDOC ## zmeta_reference_points_timeseries_output() -> Dict ### Description Return kerchunk-style zarr reference metadata. Requires the 'zarr' and 'kerchunk' packages. ### Returns - **dict** - Dictionary of kerchunk-style zarr reference metadata. ``` -------------------------------- ### Open a single HEC-RAS plan HDF5 file and view mesh cells timeseries output Source: https://rashdf.readthedocs.io/en/latest/Advanced.html Shows how to open a single HEC-RAS plan HDF5 file from an S3 bucket and view the mesh cells timeseries output as an xarray Dataset. The output includes time and cell_id coordinates and dask-backed data variables. ```python >>> from rashdf import RasPlanHdf >>> plan_hdf = RasPlanHdf.open_uri("s3://bucket/simulations/1/BigRiver.p01.hdf") >>> plan_hdf.mesh_cells_timeseries_output("BigRiverMesh1") Size: 66MB Dimensions: (time: 577, cell_id: 14188) Coordinates: * time (time) datetime64[ns] 5kB 1996-01-14... * cell_id (cell_id) int64 114kB 0 1 ... 14187 Data variables: Water Surface (time, cell_id) float32 33MB dask.array Cell Cumulative Precipitation Depth (time, cell_id) float32 33MB dask.array Attributes: mesh_name: BigRiverMesh1 ``` -------------------------------- ### RasPlanHdf.mesh_faces_summary_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves mesh faces summary output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_faces_summary_output() ### Description Retrieves mesh faces summary output data from the plan HDF5 file. ### Method mesh_faces_summary_output() ### Parameters None ### Returns - Mesh faces summary output data. ``` -------------------------------- ### steady_profile_xs_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Creates a DataFrame from steady cross section results based on path. ```APIDOC ## steady_profile_xs_output(var: XsSteadyOutputVar, round_to: int = 2) -> DataFrame ### Description Create a Dataframe from steady cross section results based on path. ### Parameters - **var** (XsSteadyOutputVar) - The name of the table in the steady results that information is to be retrieved from. - **round_to** (int, optional) - Number of decimal places to round output data to. ### Returns - **DataFrame** - Dataframe with desired hdf data. ``` -------------------------------- ### zmeta_mesh_faces_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns kerchunk-style zarr reference metadata for mesh faces timeseries output. ```APIDOC ## zmeta_mesh_faces_timeseries_output(mesh_name: str) -> Dict ### Description Return kerchunk-style zarr reference metadata. Requires the 'zarr' and 'kerchunk' packages. ### Parameters - **mesh_name** (str) - The name of the mesh area. ### Returns - **dict** - Dictionary of kerchunk-style zarr reference metadata. ``` -------------------------------- ### reference_summary_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns summary output data for reference lines or points from a HEC-RAS HDF plan file. ```APIDOC ## reference_summary_output(reftype: str = 'lines') -> DataFrame ### Description Return summary output data for reference lines or points from a HEC-RAS HDF plan file. ### Parameters - **reftype** (str, optional) - The type of reference feature. Default is 'lines'. ### Returns - **DataFrame** - A DataFrame with reference line summary output data. ``` -------------------------------- ### Combined dataset output with sim dimension Source: https://rashdf.readthedocs.io/en/latest/Advanced.html Shows the structure of the combined xarray Dataset after opening, including the new 'sim' dimension and dask-backed data variables. ```python Size: 674MB Dimensions: (sim: 10, time: 577, cell_id: 14606) Coordinates: * cell_id (cell_id) int64 117kB 0 1 ... 14605 * sim (sim) int64 80B 1 2 3 4 5 6 7 8 9 10 * time (time) datetime64[ns] 5kB 1996-01-14... Data variables: Cell Cumulative Precipitation Depth (sim, time, cell_id) float32 337MB dask.array Water Surface (sim, time, cell_id) float32 337MB dask.array Attributes: mesh_name: BigRiverMesh1 ``` -------------------------------- ### RasPlanHdf.zmeta_mesh_faces_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves zmeta mesh faces timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.zmeta_mesh_faces_timeseries_output() ### Description Retrieves zmeta mesh faces timeseries output data from the plan HDF5 file. ### Method zmeta_mesh_faces_timeseries_output() ### Parameters None ### Returns - Zmeta mesh faces timeseries output data. ``` -------------------------------- ### RasPlanHdf.bc_line_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves boundary condition line timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.bc_line_timeseries_output() ### Description Retrieves boundary condition line timeseries output data from the plan HDF5 file. ### Method bc_line_timeseries_output() ### Parameters None ### Returns - Timeseries output data for boundary condition lines. ``` -------------------------------- ### RasPlanHdf.zmeta_reference_lines_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves zmeta reference lines timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.zmeta_reference_lines_timeseries_output() ### Description Retrieves zmeta reference lines timeseries output data from the plan HDF5 file. ### Method zmeta_reference_lines_timeseries_output() ### Parameters None ### Returns - Zmeta reference lines timeseries output data. ``` -------------------------------- ### zmeta_reference_lines_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns kerchunk-style zarr reference metadata for reference lines timeseries output. ```APIDOC ## zmeta_reference_lines_timeseries_output() -> Dict ### Description Return kerchunk-style zarr reference metadata. Requires the 'zarr' and 'kerchunk' packages. ### Returns - **dict** - Dictionary of kerchunk-style zarr reference metadata. ``` -------------------------------- ### zmeta_mesh_cells_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns kerchunk-style zarr reference metadata for mesh cells timeseries output. ```APIDOC ## zmeta_mesh_cells_timeseries_output(mesh_name: str) -> Dict ### Description Return kerchunk-style zarr reference metadata. Requires the 'zarr' and 'kerchunk' packages. ### Parameters - **mesh_name** (str) - The name of the mesh area. ### Returns - **dict** - Dictionary of kerchunk-style zarr reference metadata. ``` -------------------------------- ### RasGeomHdf.bc_lines() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves boundary condition lines from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.bc_lines() ### Description Returns the boundary condition lines defined in the geometry HDF5 file. ### Method bc_lines() ### Parameters None ### Returns A list of boundary condition line objects. ``` -------------------------------- ### reference_points_names(mesh_name=None) Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns reference point names. If a mesh name is provided, returns a list of reference point names for that mesh area; otherwise, returns a dictionary of mesh names and their reference point names. ```APIDOC ## reference_points_names(mesh_name=None) ### Description 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_name** (str, 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. ``` -------------------------------- ### RasPlanHdf.reference_lines_names() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the names of reference lines from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_lines_names() ### Description Retrieves the names of reference lines from the plan HDF5 file. ### Method reference_lines_names() ### Parameters None ### Returns - List of reference line names. ``` -------------------------------- ### mesh_faces_summary_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns a DataFrame with summary output data for each mesh face in the model. ```APIDOC ## mesh_faces_summary_output ### Description Return a DataFrame with summary output data for each mesh face in the model. ### Method mesh_faces_summary_output ### Parameters - **round_to** (str, 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. ``` -------------------------------- ### RasPlanHdf.reference_points_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves reference points timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_points_timeseries_output() ### Description Retrieves reference points timeseries output data from the plan HDF5 file. ### Method reference_points_timeseries_output() ### Parameters None ### Returns - Reference points timeseries output data. ``` -------------------------------- ### RasPlanHdf.observed_timeseries_input() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves observed timeseries input data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.observed_timeseries_input() ### Description Retrieves observed timeseries input data from the plan HDF5 file. ### Method observed_timeseries_input() ### Parameters None ### Returns - Observed timeseries input data. ``` -------------------------------- ### reference_lines_names(mesh_name=None) Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns reference line names. If a mesh name is provided, returns a list of reference line names for that mesh area; otherwise, returns a dictionary of mesh names and their reference line names. ```APIDOC ## reference_lines_names(mesh_name=None) ### Description 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_name** (str, 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. ``` -------------------------------- ### RasPlanHdf.bc_lines_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves boundary condition lines timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.bc_lines_timeseries_output() ### Description Retrieves boundary condition lines timeseries output data from the plan HDF5 file. ### Method bc_lines_timeseries_output() ### Parameters None ### Returns - Timeseries output data for boundary condition lines. ``` -------------------------------- ### reference_lines Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns the reference lines from a HEC-RAS HDF plan file, including summary output data. ```APIDOC ## reference_lines ### Description 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). ### Method Function call ### Parameters - **include_output** (bool, optional) - If True, include summary output data in the GeoDataFrame. (default: True) - **datetime_to_str** (bool, optional) - If True, convert datetime columns to strings. (default: False) ### Returns GeoDataFrame - A GeoDataFrame with reference line geometry and summary output data. ``` -------------------------------- ### RasPlanHdf.zmeta_mesh_cells_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves zmeta mesh cells timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.zmeta_mesh_cells_timeseries_output() ### Description Retrieves zmeta mesh cells timeseries output data from the plan HDF5 file. ### Method zmeta_mesh_cells_timeseries_output() ### Parameters None ### Returns - Zmeta mesh cells timeseries output data. ``` -------------------------------- ### reference_points Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns the reference points from a HEC-RAS HDF plan file, including summary output data. ```APIDOC ## reference_points ### Description Return the reference points from a HEC-RAS HDF plan file. 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). ### Method Function call ### Parameters - **include_output** (bool, optional) - If True, include summary output data in the GeoDataFrame. (default: True) - **datetime_to_str** (bool, optional) - If True, convert datetime columns to strings. (default: False) ### Returns GeoDataFrame - A GeoDataFrame with reference point geometry and summary output data. ``` -------------------------------- ### mesh_min_ws Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns the minimum water surface elevation for each cell in the mesh, including the time of occurrence. ```APIDOC ## mesh_min_ws ### Description Return the min water surface elevation for each cell in the mesh. Includes the corresponding time of min water surface elevation. ### Method Function call ### Parameters - **round_to** (str, 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 with columns 'mesh_name', 'cell_id', 'min_ws', and 'min_ws_time'. ``` -------------------------------- ### steady_flow_names Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns the profile information for each steady flow event. ```APIDOC ## steady_flow_names() -> List[str] ### Description Return the profile information for each steady flow event. ### Returns - **DataFrame** - A Dataframe containing the profile names for each event. ``` -------------------------------- ### RasPlanHdf.reference_points_names() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the names of reference points from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_points_names() ### Description Retrieves the names of reference points from the plan HDF5 file. ### Method reference_points_names() ### Parameters None ### Returns - List of reference point names. ``` -------------------------------- ### structures(datetime_to_str=False) Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns a GeoDataFrame containing the model structures if they exist. ```APIDOC ## structures(datetime_to_str=False) ### Description Return the model structures. ### Parameters - **datetime_to_str** (bool, optional) - If True, convert datetime values to string format (default: False). ### Returns - **GeoDataFrame** - A GeoDataFrame containing the model structures if they exist. ``` -------------------------------- ### RasPlanHdf.mesh_cells_summary_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves mesh cells summary output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_cells_summary_output() ### Description Retrieves mesh cells summary output data from the plan HDF5 file. ### Method mesh_cells_summary_output() ### Parameters None ### Returns - Mesh cells summary output data. ``` -------------------------------- ### RasPlanHdf.steady_flow_names() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the names of steady flow profiles from the plan HDF5 file. ```APIDOC ## RasPlanHdf.steady_flow_names() ### Description Retrieves the names of steady flow profiles from the plan HDF5 file. ### Method steady_flow_names() ### Parameters None ### Returns - List of steady flow profile names. ``` -------------------------------- ### RasPlanHdf.mesh_max_ws() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the maximum water surface elevation from the mesh data in the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_max_ws() ### Description Retrieves the maximum water surface elevation from the mesh data in the plan HDF5 file. ### Method mesh_max_ws() ### Parameters None ### Returns - Maximum water surface elevation value. ``` -------------------------------- ### RasPlanHdf.get_results_volume_accounting_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves volume accounting attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_results_volume_accounting_attrs() ### Description Retrieves volume accounting attributes from the plan HDF5 file. ### Method get_results_volume_accounting_attrs() ### Parameters None ### Returns - Dictionary of volume accounting attributes. ``` -------------------------------- ### RasPlanHdf.mesh_faces_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves mesh faces timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_faces_timeseries_output() ### Description Retrieves mesh faces timeseries output data from the plan HDF5 file. ### Method mesh_faces_timeseries_output() ### Parameters None ### Returns - Mesh faces timeseries output data. ``` -------------------------------- ### RasPlanHdf.reference_lines_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves reference lines timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.reference_lines_timeseries_output() ### Description Retrieves reference lines timeseries output data from the plan HDF5 file. ### Method reference_lines_timeseries_output() ### Parameters None ### Returns - Reference lines timeseries output data. ``` -------------------------------- ### bc_lines() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns a GeoDataFrame containing the 2D mesh area boundary condition lines if they exist. ```APIDOC ## bc_lines() ### Description Return 2D mesh area boundary condition lines. ### Method bc_lines() ### Returns - **GeoDataFrame** - A GeoDataFrame containing the 2D mesh area boundary condition lines if they exist. ``` -------------------------------- ### projection() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns the projection of the RAS geometry as a pyproj.CRS object or None. ```APIDOC ## projection() ### Description Return the projection of the RAS geometry as a pyproj.CRS object. ### Returns - **pyproj.CRS or None** - The projection of the RAS geometry. ``` -------------------------------- ### RasGeomHdf.structures() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves structure data from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.structures() ### Description Returns the structures defined in the geometry HDF5 file. ### Method structures() ### Parameters None ### Returns A list of structure objects. ``` -------------------------------- ### reference_points() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns a GeoDataFrame containing the reference points if they exist. ```APIDOC ## reference_points() ### Description Return the reference points geometry and attributes. ### Returns - **GeoDataFrame** - A GeoDataFrame containing the reference points if they exist. ``` -------------------------------- ### RasPlanHdf.gridded_precip() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves gridded precipitation data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.gridded_precip() ### Description Retrieves gridded precipitation data from the plan HDF5 file. ### Method gridded_precip() ### Parameters None ### Returns - Gridded precipitation data. ``` -------------------------------- ### reference_points_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns timeseries output data for reference points from a HEC-RAS HDF plan file. ```APIDOC ## reference_points_timeseries_output() -> Dataset ### Description 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_lines() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Returns a GeoDataFrame containing the reference lines if they exist. ```APIDOC ## reference_lines() ### Description Return the reference lines geometry and attributes. ### Returns - **GeoDataFrame** - A GeoDataFrame containing the reference lines if they exist. ``` -------------------------------- ### bc_lines_timeseries_output() -> Dataset Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns timeseries output data for boundary conditions lines from a HEC-RAS HDF plan file. ```APIDOC ## bc_lines_timeseries_output() -> Dataset ### Description Returns timeseries output data for boundary conditions lines from a HEC-RAS HDF plan file. ### Method bc_lines_timeseries_output ### Returns - **xr.Dataset** - An xarray Dataset with timeseries output data for boundary conditions lines. ``` -------------------------------- ### get_meteorology_precip_attrs() -> Dict Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns precipitation attributes from a HEC-RAS HDF plan file. ```APIDOC ## get_meteorology_precip_attrs() -> Dict ### Description Returns precipitation attributes from a HEC-RAS HDF plan file. ### Method get_meteorology_precip_attrs ### Returns - **dict** - Dictionary of precipitation attributes. ``` -------------------------------- ### mesh_cells_summary_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns a DataFrame with summary output data for each mesh cell in the model. ```APIDOC ## mesh_cells_summary_output ### Description Return a DataFrame with summary output data for each mesh cell in the model. ### Method mesh_cells_summary_output ### Parameters - **round_to** (str, 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. ``` -------------------------------- ### RasPlanHdf.cross_sections_wsel() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves water surface elevation values for cross sections from the plan HDF5 file. ```APIDOC ## RasPlanHdf.cross_sections_wsel() ### Description Retrieves water surface elevation values for cross sections from the plan HDF5 file. ### Method cross_sections_wsel() ### Parameters None ### Returns - Water surface elevation values for cross sections. ``` -------------------------------- ### RasPlanHdf.mesh_max_ws_err() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the maximum water surface elevation error from the mesh data in the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_max_ws_err() ### Description Retrieves the maximum water surface elevation error from the mesh data in the plan HDF5 file. ### Method mesh_max_ws_err() ### Parameters None ### Returns - Maximum water surface elevation error value. ``` -------------------------------- ### RasPlanHdf.mesh_min_face_v() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves the minimum face velocity from the mesh data in the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_min_face_v() ### Description Retrieves the minimum face velocity from the mesh data in the plan HDF5 file. ### Method mesh_min_face_v() ### Parameters None ### Returns - Minimum face velocity value. ``` -------------------------------- ### RasPlanHdf.get_meteorology_precip_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves meteorology precipitation attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_meteorology_precip_attrs() ### Description Retrieves meteorology precipitation attributes from the plan HDF5 file. ### Method get_meteorology_precip_attrs() ### Parameters None ### Returns - Dictionary of meteorology precipitation attributes. ``` -------------------------------- ### RasGeomHdf.projection() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves the projection information from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.projection() ### Description Returns the projection (coordinate reference system) of the geometry HDF5 file. ### Method projection() ### Parameters None ### Returns The projection string or object. ``` -------------------------------- ### RasGeomHdf.reference_points() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves reference point data from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.reference_points() ### Description Returns the reference points defined in the geometry HDF5 file. ### Method reference_points() ### Parameters None ### Returns A list of reference point objects. ``` -------------------------------- ### mesh_max_ws Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns the max water surface elevation for each cell in the mesh. Includes the corresponding time of max water surface elevation. ```APIDOC ## mesh_max_ws ### Description Return the max water surface elevation for each cell in the mesh. Includes the corresponding time of max water surface elevation. ### Method mesh_max_ws ### Parameters - **round_to** (str, 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', and 'max_ws_time'. ``` -------------------------------- ### RasPlanHdf.get_results_unsteady_summary_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves unsteady results summary attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_results_unsteady_summary_attrs() ### Description Retrieves unsteady results summary attributes from the plan HDF5 file. ### Method get_results_unsteady_summary_attrs() ### Parameters None ### Returns - Dictionary of unsteady results summary attributes. ``` -------------------------------- ### get_results_volume_accounting_attrs() -> Dict Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns volume accounting attributes from a HEC-RAS HDF plan file. ```APIDOC ## get_results_volume_accounting_attrs() -> Dict ### Description Returns volume accounting attributes from a HEC-RAS HDF plan file. ### Method get_results_volume_accounting_attrs ### Returns - **dict** - Dictionary of volume accounting attributes. ``` -------------------------------- ### reference_lines_timeseries_output Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns timeseries output data for reference lines from a HEC-RAS HDF plan file. ```APIDOC ## reference_lines_timeseries_output ### Description Return timeseries output data for reference lines from a HEC-RAS HDF plan file. ### Method Function call ### Returns xr.Dataset - An xarray Dataset with timeseries output data for reference lines. ``` -------------------------------- ### RasGeomHdf.reference_lines() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves reference line data from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.reference_lines() ### Description Returns the reference lines defined in the geometry HDF5 file. ### Method reference_lines() ### Parameters None ### Returns A list of reference line objects. ``` -------------------------------- ### RasPlanHdf.cross_sections_additional_enc_station_right() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves right additional encroachment station for cross sections from the plan HDF5 file. ```APIDOC ## RasPlanHdf.cross_sections_additional_enc_station_right() ### Description Retrieves right additional encroachment station for cross sections from the plan HDF5 file. ### Method cross_sections_additional_enc_station_right() ### Parameters None ### Returns - Right additional encroachment station values for cross sections. ``` -------------------------------- ### Read geometry from HEC-RAS HDF file with RasGeomHdf Source: https://rashdf.readthedocs.io/en/latest/index.html Opens a HEC-RAS geometry HDF file and retrieves projection, mesh area names, mesh areas, and mesh cell points. The output shows the projection CRS and sample data frames. ```python >>> from rashdf import RasGeomHdf >>> with RasGeomHdf('Muncie.g05.hdf') as geom_hdf: ... projection = geom_hdf.projection() ... mesh_area_names = geom_hdf.mesh_area_names() ... mesh_areas = geom_hdf.mesh_areas() ... mesh_cell_points = geom_hdf.mesh_cell_points() >>> projection Name: NAD83 / Indiana East (ftUS) Axis Info [cartesian]: - E[east]: Easting (US survey foot) - N[north]: Northing (US survey foot) Area of Use: - undefined Coordinate Operation: - name: unnamed - method: Transverse Mercator Datum: North American Datum 1983 - Ellipsoid: GRS 1980 - Prime Meridian: Greenwich >>> mesh_area_names ['2D Interior Area', 'Perimeter_NW'] >>> mesh_areas mesh_name geometry 0 2D Interior Area POLYGON ((409537.180 1802597.310, 409426.140 1... 1 Perimeter_NW POLYGON ((403914.470 1804971.220, 403008.310 1... >>> mesh_cell_points mesh_name cell_id geometry 0 2D Interior Area 0 POINT (406000.000 1805000.000) 1 2D Interior Area 1 POINT (406050.000 1805000.000) 2 2D Interior Area 2 POINT (406100.000 1805000.000) 3 2D Interior Area 3 POINT (406150.000 1805000.000) 4 2D Interior Area 4 POINT (406200.000 1805000.000) ... ... ... ... 5785 Perimeter_NW 514 POINT (403731.575 1804124.860) 5786 Perimeter_NW 515 POINT (403650.619 1804121.731) 5787 Perimeter_NW 516 POINT (403585.667 1804141.139) 5788 Perimeter_NW 517 POINT (403534.818 1804186.902) 5789 Perimeter_NW 518 POINT (403632.837 1804235.708) ``` -------------------------------- ### gridded_precip(timestamps: Sequence[datetime] | Series | None = None, precip_attrs: Dict | None = None) -> DataArray Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns precipitation timeseries input data from a HEC-RAS HDF plan file. Requires the 'rioxarray' package. ```APIDOC ## gridded_precip(timestamps: Sequence[datetime] | Series | None = None, precip_attrs: Dict | None = None) -> DataArray ### Description Returns precipitation timeseries input data from a HEC-RAS HDF plan file. Requires the 'rioxarray' package. ### Method gridded_precip ### Parameters - **timestamps** (Optional[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_attrs** (Optional[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. ``` -------------------------------- ### RasPlanHdf.get_results_unsteady_attrs() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves unsteady results attributes from the plan HDF5 file. ```APIDOC ## RasPlanHdf.get_results_unsteady_attrs() ### Description Retrieves unsteady results attributes from the plan HDF5 file. ### Method get_results_unsteady_attrs() ### Parameters None ### Returns - Dictionary of unsteady results attributes. ``` -------------------------------- ### bc_line_timeseries_output(bc_line_name: str) -> Dataset Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns timeseries output data for a specific boundary condition line from a HEC-RAS HDF plan file. ```APIDOC ## bc_line_timeseries_output(bc_line_name: str) -> Dataset ### Description Returns timeseries output data for a specific boundary condition line from a HEC-RAS HDF plan file. ### Method bc_line_timeseries_output ### Parameters - **bc_line_name** (str) - Required - The name of the boundary condition line. ### Returns - **xr.Dataset** - An xarray Dataset with timeseries output data for the specified boundary condition line. ``` -------------------------------- ### RasPlanHdf.mesh_cells_timeseries_output() Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Retrieves mesh cells timeseries output data from the plan HDF5 file. ```APIDOC ## RasPlanHdf.mesh_cells_timeseries_output() ### Description Retrieves mesh cells timeseries output data from the plan HDF5 file. ### Method mesh_cells_timeseries_output() ### Parameters None ### Returns - Mesh cells timeseries output data. ``` -------------------------------- ### RasGeomHdf.refinement_regions() Source: https://rashdf.readthedocs.io/en/latest/RasGeomHdf.html Retrieves refinement region data from the geometry HDF5 file. ```APIDOC ## RasGeomHdf.refinement_regions() ### Description Returns the refinement regions defined in the geometry HDF5 file. ### Method refinement_regions() ### Parameters None ### Returns A list of refinement region objects. ``` -------------------------------- ### observed_timeseries_input Source: https://rashdf.readthedocs.io/en/latest/RasPlanHdf.html Returns observed timeseries input data for reference lines and points from a HEC-RAS HDF plan file. ```APIDOC ## observed_timeseries_input ### Description Return observed timeseries input data for reference lines and points from a HEC-RAS HDF plan file. ### Method Function call ### Parameters - **vartype** (str, 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. ```