Nicolet National Forest Unit (Northern part)¶
This page shows another example of using Linesink-maker to construct a GFLOW model, for the northern part of the Nicolet National Forest Unit in Northern Wisconsin. The files for this example can be found in the examples/nicolet subfolder of the Linesink-maker repository. To run the example, simply run the included make_linesinks.py
script at the command line with Nicolet_lines.xml
configuration file as an argument:
python make_linesinks.py Nicolet_lines.xml
See the Medford example for a more detailed description of the input options, and an example of the more human-readable YAML configuration file format.
Configuration file in XML format (Nicolet_lines.xml
)¶
1<linesinkInput>
2<!--
3Notes on linesinkMaker input:
4 All shps should be in (same) model coordinate units (e.g. ft.)
5 If model domain contains a major divide, need to merge relevant NHD datasets
6 (e.g. 04 and 07) prior to running this script
7 Put in paths to input/output files as-is (i.e. no double \)
8-->
9<GlobalSettings>
10 <!-- working_dir:
11 full path to working folder where intermediate and output will be generated. -->
12 <working_dir></working_dir>
13 <!-- zmult:
14 elevation units multiplier (from NHDPlus cm to model units) -->
15 <zmult>0.03280839895013123</zmult>
16 <!-- resistance:
17 global resistance value to apply to all resistance LinesinkData (c in GFLOW documentation) -->
18 <resistance>0.3</resistance>
19 <!-- H:
20 aquifer thickness in model units -->
21 <H>100</H>
22 <!-- k:
23 Hydraulic conductivity in model units -->
24 <k>10</k>
25 <!-- ScenResistance:
26 name for global resistance parameter to assign to LinesinkData-->
27 <ScenResistance>Rlinesink</ScenResistance>
28 <!-- ComputationalUnits: ('Feet' or 'Meters')
29 model units-->
30 <ComputationalUnits>Feet</ComputationalUnits>
31 <!-- BasemapUnits: ('Feet' or 'Meters')
32 Units of the model basemaps-->
33 <BasemapUnits>Meters</BasemapUnits>
34</GlobalSettings>
35
36<modelDomain>
37 <!-- farfield:
38 polygon shapefile (a ring, with nearfield making up the side) of the desired model farfield area
39 LinesinkData within this area will be zero resistance (specified head) -->
40 <farfield>shps/Nicolet_north_FF.shp</farfield>
41 <!-- nearfield:
42 polygon of the model nearfield area, where LinesinkData will be given resistance and routed -->
43 <nearfield>shps/Nicolet_north_NF.shp</nearfield>
44 <!-- split_by_HUC:
45 option to split out LinesinkData by HUC, writing one lss file per HUC -->
46 <split_by_HUC>False</split_by_HUC>
47 <HUC_shp>None</HUC_shp>
48 <HUC_name_field>None</HUC_name_field>
49</modelDomain>
50<!-- NHDfiles:
51input .shp and .dbf files from NHDPlus. To include multiple files
52(e.g. multiple flowlines files spanning multiple drainage areas)
53simply add additional entries with same XML keyword.
54LinesinkMakr will open all of the files and combine them.-->
55<NHDfiles>
56 <flowlines>shps/Nicolet_flowlines.shp</flowlines>
57 <elevslope>shps/NHDPlus04/NHDPlusAttributes/elevslope.dbf</elevslope>
58 <elevslope>shps/NHDPlus07/NHDPlusAttributes/elevslope.dbf</elevslope>
59 <PlusFlowVAA>shps/NHDPlus04/NHDPlusAttributes/PlusFlowlineVAA.dbf</PlusFlowVAA>
60 <PlusFlowVAA>shps/NHDPlus07/NHDPlusAttributes/PlusFlowlineVAA.dbf</PlusFlowVAA>
61 <waterbodies>shps/NHDwaterbodies.shp</waterbodies>
62</NHDfiles>
63
64<Simplification>
65 <!-- nearfield_tolerance:
66 maximum distance a simplified line can deviate from the original linework -->
67 <nearfield_tolerance>200</nearfield_tolerance>
68 <!-- farfield_tolerance:
69 maximum distance a simplified line can deviate from the original linework -->
70 <farfield_tolerance>500</farfield_tolerance>
71 <!-- min_farfield_order:
72 minimum stream order to retain in farfield -->
73 <min_farfield_order>2</min_farfield_order>
74 <!-- min_waterbody_size:
75 minimum sized waterbodies to retain (km2) -->
76 <min_waterbody_size>1.0</min_waterbody_size>
77 <!-- drop_crossing:
78 Line simplification can lead to some lines crossing.
79 In instances of crossing, remove the line representing this smaller of the two streams
80 (as indicated by a lower arbolate sum value)-->
81 <drop_crossing>True</drop_crossing>
82</Simplification>
83
84<outputs>
85 <outfile_basename>Nicolet</outfile_basename>
86 <error_reporting>linesinkMaker_errors.txt</error_reporting>
87</outputs>
88</linesinkInput>
make_linesinks.py
¶
1import sys
2import lsmaker
3
4try:
5 input_file = sys.argv[1]
6except IndexError:
7 print("\nusage is: python make_linesinks.py <configuration file>\n")
8 quit()
9
10ls = lsmaker.LinesinkData(input_file)
11
12ls.preprocess(save=True)
13
14ls.make_linesinks(shp='preprocessed/lines.shp')