Lake river routing products and it's post processing tools

The lake river routing product is a product that not only provided a routing structure which correctly represent lakes, but also it is a product can be easily modified to based on various user's purpose.

Assuming we are interested in building a hydrologcial model in two Canadian Shield above the Water Survey of Canada gauge 02LE024 and 02LC066. We won't directly use the downloaded lake river routing product because the area of subbasins in the routing product is too small and the number of lakes represented in the routing product is too many. Thus, we will need to remove some lakes from the lake river routing product, and the increase the area of the catchment in the lake river routing product.

In this walkthrough, we will use north america lake river routing product as input and then customize it based on our demand. Then the customized lake-river routing structure will be used to generate model setup files for the Raven hydrologic modeling framework.

To construct the customized lake river routing structure, the QGIS-based BasinMaker library will be used to post-processing the lake river routing product. Following functions of the QGIS-based BasinMaker library will be used and introduced in this exercise:

   - Selecting a region of interest based on subbasin ID. 
   - Simplifying the lake river routing product by removing lakes. 
   - Simplifying the lake river routing product by increasing minimum drainage area of each subabsin 
   - Generating HRUs by overlaying subbasin polygon, lake polygon, landuse polygon, etc. 
   - Generating Raven hydrologic model input files.  

In following sections, we will first provide an overview of the Lake river routing prodcuts in section 1; and then a quick introduction and installation procedure for the QGIS-based BasinMaker library will be provided in section 2; and the workthrough to construction a customized lake-river routing structure for 02LE024 and 02LC066 will be introduced in section 3.

Section 1 - The version 2 lake river routing products

1.1 Overview

An example of routing structure without considering lakes and an example of routing structure of this routing product which represent lakes are showed in Figure A and Figure B respectively.

In a routing structure without considering lakes, catchments are only defined by river reaches. When we build semi-hydrology models with this routing structure both the inflow and the outflow of each lake showed in Figure A cannot be simulated and thus the impact of lake on the routing process modeling such as flow attenuation can not be correctly modeled.

In the routing structure defined by this product showed in Figure B. Each lake’s inlets and outlet are treated as a catchment outlet. A lake catchment will fully cover the lake polygon and its outlet is the same as the outlet of the lake. At the same time, each inlet of the CL will also be identified as a catchment outlet . In this way, both inflow and outflow of each lake can be explicitly simulated by the semi-distributed hydrology models.

Lakes in this routing product are divided into two categories in the routing product: (1) connected lakes (CL), which indicates lakes directly connected with the river network; and (2) non-connected lakes (NCL), which denotes lakes not connected with the river network . Both CL and NCL defined here are within the drainage area of the watershed and water released from both CL and NCL will move to the outlet of the watershed. Thus, the definition of NCL here is not the same as the definition of none contributing area, in which runoff generated will not move to the watershed outlet.

1.2 Methods

The routing product is developed by using the BasinMaker, which is a GIS toolbox to delineate watershed with lakes. A constant flow accumulation threshold (500) was used to delineate the river network of the product. All lakes in the HydroLAKEs database are included in the routing product. Following data are used as inputs to generate the routing product.

1.3 Contents

The lake-river routing product is developed for the domain of North Americas. For user's convinience, the same routing product was not only released as a product that covering the North America, it also released as several products covering each drainage regions within the North America, respectively. The map of the location and extent of each drainage regions can be found in here. The definition of drainage region is that it is a drainage area and runoff within this drainage area will move to the sea via a unique outlet. As you may notice that the extent of the drainage region could be very large, the same routing product was also released as a product covering each sub-regions within each drainage area The extent and the location of each sub-regions within each drainage region can be found in here. When you download the routing product from here, the name of the downloaded zip files following certain name conversions, for example :

Within each downloaded routing prodcut folder/zip file, following GIS files are contained.

  1. finalcat_info.* It is the GIS layer containing catchments polygon which respect the lake inflow and outflow routing structures. Catchment polyons as showed in Figure B. It can be directly used to generate HRUs or generate model inputs (more details about the attribute table in this GIS layer can be found in here)

  2. finalcat_info_riv.* It is the GIS layer containing river network polylines. The River polyline as showed in Figure B. The rive the columns in it's attribute table is the same as finalcat_info.*.

  3. sl_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are connected by the finalcat_info_riv.*. The connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  4. sl_non_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are not connected by the finalcat_info_riv.*. The non-connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  5. obs_gauges.* It is the GIS layer containing stream observation gauges included in the routing product. The stream flow observation gauges for watersheds in Canada are obtained from HYDAT database; While the streamflow observation gauges for watershed in U.S is obtained from USGS (more details about the attribute table in this GIS layer can be found in here)

  6. catchment_without_merging_lakes.* It is the GIS layer containing catchments polygon of an incomplete routing product. the catchments covered by connected lakes are not merged in this GIS layer. It is used as inputs to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

  7. river_without_merging_lakes.* It is the GIS layer containing river polylines of an incomplete routing product. the river polylines covered by connected lakes are not merged in this GIS layer. It is used as input to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

  8. drainage_region_outline_XXXX_YYYYY.* containing drainage region outline of sub-region YYYYY within region XXXX (more details here)

Section 2 - QGIS-based BasinMaker library within anaconda

2.1 Overview

The QGIS-based BasinMaker library is a set of usefull tools provided to user to customize the provided lake-river routing structure to meet user's various modeling demand. For example, user can simplify the provided lake-river routing structure by removing lakes with its lake area smaller than user defined lake area threshold. In total, five post processing tools are provided in the QGIS-based BasinMaker library. Their function are listed in here and the application proedure of these functions will be introduced in section 3.

Just a note that the BasinMaker library introduced in here can only be used to work with North America lake river routing product. Anyone who interest in using BasinMaker to generate a lake-river routing structure from Digital Elevation Model, some useful information are provided in here

2.2 Installation of GIS-based BasinMaker library within anaconda

Section 3 - Customize lake river routing prodcut using the BasinMaker library

3.1 Import packages and define a plot function

The plot function is will be only used to plot the routing prodcut, it is not needed for us to customize lake river routing prodcut using the BasinMaker library to BasinMaker.

3.2 Locate the desired routing prodcut

As we discussed in section 1.3, three level of the routing product is provided, including: the routing prodcut over the whole North America, the routing product for each drainage regions and the routing product for each sub-drainage-region within each drainage region. Since we only interested in two gauges wihin the great lake basins, we do not needs to use the routing product that cover the whole north america as inputs. In this section, we will locate the desired routing prodcut for WSC gague 02LE024 and 02LC066, respectively.

First, a list of all streamflow observation gauges included in the routing prodcuts can be found in this table. The explaination of the column names of the table can be found at here. We will read the table and look up for our two WSC gauges.

We could see that both '02LC066' and '02LE024' belongs to subregion 00006, which is belongs to the drainage region 0003. And 'Use_region' is 0 for both gauges, which means that the drainage area of both streamflow gauges can be fully covered by subregion 00006, and thus we do not need to use the prodcut over the entirely drainage region 0003 either.

The folder that contains the routing prodcut for subregion 00006 of the drainage region 0003 is 'drainage_region_0003_00006'. At the same time we notice that the subbasin ID in the routing prodcut for gauge '02LC066' and '02LE024' are 3075942 and 3073896, respectively. The subbasin ID define a unique catchment polygon in the routing product, the subbasin ID for each gauge means that the outlet of that catchment polygon is defined to best correspond to the streamflow gauge location. The subbasin ID will be used later as inputs to obtain the drainage area of these two gauges from routing product'drainage_region_0003_00006'.

3.3 Using subbasin Ids to extract the region of interest from routing product

Now, we know we will use routing product from 'drainage_region_0003_00006' and the subbasin ID assoicated to our interested gauges are 3075942 and 3073896, respectively.

In this section, we will use BasinMaker to extract the drainage areas controlled by these two gauges.

First, we need to downlowd the routing product of 'drainage_region_0003_00006' from the here and then unzip it to a folder, this folder will be refered as "unzip_folder_drainage_region_0003_00006" in following example.

Then we will use function select_part_of_routing_product provided by BasinMaker to obtain the drainage area controlled by 02LE024 and 02LC066. The output of the select_part_of_routing_product are GIS files from 3 to 7 in the list showed in section 1.3. The spatial extent of GIS files generated by select_part_of_routing_product will only cover the drainage area belongs to 02LE024 and 02LC066.

As you may notice, the output of select_part_of_routing_product only contains catchment polyons without merging lakes (item 6 and 7 in the list showed in section 1.3). To obtain the final routing product, we need use another tool provided by BasinMaker to process the output of select_part_of_routing_product, in this process we will merge catchment polygons covered by the same lake using function combine_catchments_covered_by_the_same_lake provided by BasinMaker. The exaplation of parameters and outputs of select_part_of_routing_product and combine_catchments_covered_by_the_same_lake is showed here. The application and it's output of using these two function to obtain routing prodcut for our interested gauges are 3075942 and 3073896 in showed in next block.

extract part of the existing routing structure

Parameters
Outputs

Following GIS files will be generated in the OutputFolder, aside the spatial extent, eveyting will be the same as inputs.

  1. sl_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are connected by the finalcat_info_riv.*. The connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  2. sl_non_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are not connected by the finalcat_info_riv.*. The non-connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  3. obs_gauges.* It is the GIS layer containing stream observation gauges included in the routing product. The stream flow observation gauges for watersheds in Canada are obtained from HYDAT database; While the streamflow observation gauges for watershed in U.S is obtained from USGS (more details about the attribute table in this GIS layer can be found in here)

  4. catchment_without_merging_lakes.* It is the GIS layer containing catchments polygon of an incomplete routing product. the catchments covered by connected lakes are not merged in this GIS layer. It is used as inputs to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

  5. river_without_merging_lakes.* It is the GIS layer containing river polylines of an incomplete routing product. the river polylines covered by connected lakes are not merged in this GIS layer. It is used as input to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

combine_catchments_covered_by_the_same_lake

Parameters
Outputs

Following GIS files will be generated in the \<Routing_Product_Folder>.

  1. finalcat_info.* It is the GIS layer containing catchments polygon which respect the lake inflow and outflow routing structures. Catchment polyons as showed in Figure B. It can be directly used to generate HRUs or generate model inputs (more details about the attribute table in this GIS layer can be found in here)

  2. finalcat_info_riv.* It is the GIS layer containing river network polylines. The River polyline as showed in Figure B. The rive the columns in it's attribute table is the same as finalcat_info.*.

User are encouraged to use the layer button on the upper right of the figure to:

3.4 Simplify the routing product by removing lakes

As we can see from the output map of section 3.3, a lot of small lakes are included in the routing product, and for our modeling purpose, we do not need to considering those small lakes. So we weould like to remove these small lakes from the output of section 3.3.

Assuming that we decide to remove lake with lake area smaller than 5 km2. At the same time, we have one lake level measurement of a small lakes in both watersheds, the LakeIDs for two lakes with lake level observation in the HydroLAKE database is 105927 and 107234, respectively. We will needs to keep these two lake in the updated routing products.

The function function simplify_routing_structure_by_filter_lakes provided by the BasinMaker will be used for this purpose. The output file name of the simplify_routing_structure_by_filter_lakes is the same as the output of extract part of the existing routing structure, except the routing structure are changed due to removing of lakes. Again, similar to section 3.3, function combine_catchments_covered_by_the_same_lake is needed to process the output of simplify_routing_structure_by_filter_lakes to generate final routing structures.

The Parameters and outputs of function simplify_routing_structure_by_filter_lakes is showed here, the application and it's output to our problem is showed in next cell.

simplify_routing_structure_by_filter_lakes

Parameters
Outputs

Following GIS files will be generated in the OutputFolder, aside the spatial extent, eveyting will be the same as inputs.

  1. sl_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are connected by the finalcat_info_riv.*. The connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  2. sl_non_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are not connected by the finalcat_info_riv.*. The non-connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  3. obs_gauges.* It is the GIS layer containing stream observation gauges included in the routing product. The stream flow observation gauges for watersheds in Canada are obtained from HYDAT database; While the streamflow observation gauges for watershed in U.S is obtained from USGS (more details about the attribute table in this GIS layer can be found in here)

  4. catchment_without_merging_lakes.* It is the GIS layer containing catchments polygon of an incomplete routing product. the catchments covered by connected lakes are not merged in this GIS layer. It is used as inputs to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

  5. river_without_merging_lakes.* It is the GIS layer containing river polylines of an incomplete routing product. the river polylines covered by connected lakes are not merged in this GIS layer. It is used as input to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

The Parameters and outputs of function combine_catchments_covered_by_the_same_lake can be found in section 3.3

3.5 Simplify the routing product by increasing catchment minimum drainage area

Although the routing structure from section 3.4 already removed a lot of small lakes, but the area of the catchment in the routing product is still too small for our modeling purpose. So we would like to increase the catchment size of the routing product.

Assuming that we decide that the minimum drainage area of each catchment is 50 km2, all catchment with their drainage area smaller than 50 km2 should be removed.

The function function simplify_routing_structure_by_drainage_area provided by the BasinMaker will be used for this purpose. The output file name of the simplify_routing_structure_by_drainage_area is the same as the output of extract part of the existing routing structure, except the routing structure are changed due to removing of lakes. Again, similar to section 3.3 and section 3.4, function combine_catchments_covered_by_the_same_lake is needed to process the output of simplify_routing_structure_by_filter_lakes to generate final routing structures.

The Parameters and outputs of function simplify_routing_structure_by_drainage_area is showed here, the application and it's output to our problem is showed in next cell.

simplify_routing_structure_by_drainage_area

Parameters
Outputs

Following GIS files will be generated in the OutputFolder, aside the spatial extent, eveyting will be the same as inputs.

  1. sl_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are connected by the finalcat_info_riv.*. The connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  2. sl_non_connected_lake.* It is the GIS layer containing the lake polygon of lakes that are not connected by the finalcat_info_riv.*. The non-connected lake polygong in Figure B. It can be directly used to generate HRUS. The lake polygon is obtained from HydroLAKES database (Messager et al., 2016).

  3. obs_gauges.* It is the GIS layer containing stream observation gauges included in the routing product. The stream flow observation gauges for watersheds in Canada are obtained from HYDAT database; While the streamflow observation gauges for watershed in U.S is obtained from USGS (more details about the attribute table in this GIS layer can be found in here)

  4. catchment_without_merging_lakes.* It is the GIS layer containing catchments polygon of an incomplete routing product. the catchments covered by connected lakes are not merged in this GIS layer. It is used as inputs to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

  5. river_without_merging_lakes.* It is the GIS layer containing river polylines of an incomplete routing product. the river polylines covered by connected lakes are not merged in this GIS layer. It is used as input to custmoize/generate the new routing product based on user defined lake area thresholds and catchment minimmum drainage area threshold. The columns in it's attribute table is the same as finalcat_info.*.

The Parameters and outputs of function combine_catchments_covered_by_the_same_lake can be found in section 3.3

3.6 Generate Hydrologic Response Units (HRUs)

Let's say we are happly with the routing product from section 3.5, and we will use this routing product to build our semi-distribute hydrological models. Most of the semi-distributed hydrologcial models is build on the concept of hydrolgocial response unit (HRU). We need to define HRUs using the output from section 3.5 before we can generate any model input files.

Assuming that there is unique soil type and land use type in both watershed, and the only thing that needs to be considered in defining the HRUs is the lakes.

The function function generate_hrus provided by the BasinMaker will be used for this purpose.

The parameters and outputs of function generate_hrus is showed here, the application and it's output to our problem is showed in next cell.

generate_hrus

Parameters
Outputs

Following GIS files will be generated in the OutputFolder, aside the spatial extent, eveyting will be the same as inputs.

  1. finalcat_hru_info.shp It is the generated hru polygon with attributes

3.7 Generate Raven inputs

After generate HRUs from section 3.6, we are ready to generate Raven model inputs using generate_raven_model_inputs provided by BasinMaker

The parameters and outputs of function generate_raven_model_inputs is showed here, the application and it's output to our problem is showed in next cell.

generate_raven_model_inputs

Parameters
Outputs