RAPID to GSSHA

It is possible to use RAPID streamflow as an overland flow boundary condition to the Gridded Surface Subsurface Hydrologic Analysis (GSSHA) model.

What is GSSHA?

GSSHA is a physically-based, distributed hydrologic model. GSSHA is developed and maintained by Coastal and Hydraulics Laboratory (CHL) which is a member of the Engineer Research & Development Center of the United States Army Corps of Engineers (USACE).

Note

For more information about GSSHA please visit the the gsshawiki .

Tutorial

There are two ways to input RAPID as a boundary condition for GSSHA. One is to connect the GSSHA stream network link and node to the RAPID river ID and generate the IHG file. The other is to generate an XYS timeseries file and add it to the netork using WMS.

Method 1: Generate IHG File

Method 2: Generate XYS File

Step 2.1: Generate XYS File

RAPIDDataset.write_flows_to_gssha_time_series_xys(path_to_output_file, series_name, series_id, river_index=None, river_id=None, date_search_start=None, date_search_end=None, daily=False, mode='mean')[source]

Write out RAPID output to GSSHA WMS time series xys file.

Parameters:
  • path_to_output_file (str) – Path to the output xys file.
  • series_name (str) – The name for the series.
  • series_id (int) – The ID to give the series.
  • river_index (Optional[datetime]) – This is the index of the river in the file you want the streamflow for.
  • river_id (Optional[datetime]) – This is the river ID that you want the streamflow for.
  • date_search_start (Optional[datetime]) – This is a datetime object with the date of the minimum date for starting.
  • date_search_end (Optional[datetime]) – This is a datetime object with the date of the maximum date for ending.
  • daily (Optional[boolean]) – If True and the file is CF-Compliant, write out daily flows.
  • mode (Optional[str]) – You can get the daily average “mean” or the maximum “max”. Defauls is “mean”.

Example writing entire time series to file:

from RAPIDpy import RAPIDDataset

river_id = 3624735
path_to_rapid_qout = '/path/to/Qout.nc'

with RAPIDDataset(path_to_rapid_qout) as qout_nc:
    qout_nc.write_flows_to_gssha_time_series_xys('/timeseries/Qout_3624735.xys',
                                                 series_name="RAPID_TO_GSSHA_{0}".format(river_id),
                                                 series_id=34,
                                                 river_id=river_id,
                                                 )

Example writing entire time series as daily average to file:

from RAPIDpy import RAPIDDataset

river_id = 3624735
path_to_rapid_qout = '/path/to/Qout.nc'

with RAPIDDataset(path_to_rapid_qout) as qout_nc:
    # NOTE: Getting the river index is not necessary
    # this is just an example of how to use this
    river_index = qout_nc.get_river_index(river_id)

    # if file is CF compliant, you can write out daily average
    qout_nc.write_flows_to_gssha_time_series_xys('/timeseries/Qout_daily.xys',
                                                 series_name="RAPID_TO_GSSHA_{0}".format(river_id),
                                                 series_id=34,
                                                 river_index=river_index,
                                                 daily=True,
                                                 )

Example writing subset of time series as daily maximum to file:

from datetime import datetime
from RAPIDpy import RAPIDDataset

river_id = 3624735
path_to_rapid_qout = '/path/to/Qout.nc'

with RAPIDDataset(path_to_rapid_qout) as qout_nc:
    # NOTE: Getting the river index is not necessary
    # this is just an example of how to use this
    river_index = qout_nc.get_river_index(river_id)

    # if file is CF compliant, you can filter by date and
    # get daily values
    qout_nc.write_flows_to_gssha_time_series_xys('/timeseries/Qout_daily_date_filter.xys',
                                                 series_name="RAPID_TO_GSSHA_{0}".format(river_id),
                                                 series_id=34,
                                                 river_index=river_index,
                                                 date_search_start=datetime(2002, 8, 31),
                                                 date_search_end=datetime(2002, 9, 15),
                                                 daily=True,
                                                 mode="max"
                                                 )

Step 2.2: Add XYS File in WMS

In the Distributed Hydrology section, go to Overland Flow Boundary Conditions in GSSHA (Tutorial 55) at http://www.aquaveo.com/software/wms-learning-tutorials

Here is a direct link to the document: http://wmstutorials-10.1.aquaveo.com/55%20Gssha-Applications-OverlandBoundaryConditions.pdf