changliao1025 / hexwatershed

The C++ backend of the HexWatershed a mesh independent flow direction model for hydrologic models
Other
3 stars 0 forks source link

Preserve the stream info from pyflowline #9

Open changliao1025 opened 2 years ago

changliao1025 commented 2 years ago

The json file from PyFlowline contains a flag on whether a cell is a stream grid or not. However, the flow accumulation is also used to define the stream grid. To preserve the original information, it is better to keep the flag even though its accumulation may be smaller than the threshold.

changliao1025 commented 2 years ago

This is the place that may need improvement. https://github.com/changliao1025/hexwatershed/blob/a12c85d4c4a95f101ba0717996498de94fde6841/src/compset/compset_run.cpp#L169

changliao1025 commented 2 years ago

However, it is also possible to adjust the threshold during the simulation. Such this parameter should consider the minimal flow accumulation in those burnt in cells.

changliao1025 commented 2 years ago

We decide to use a new added option (iFlag_stream_grid_option) to control this feature to allow flexibility.

  1. iFlag_stream_grid_option is 1: only burnt in stream cells are defined as stream cells.
  2. iFlag_stream_grid_option is 2: only cells which have higher accumulation than threshold are defined as stream cells.
  3. iFlag_stream_grid_option is 3: both cells which have higher accumulation than threshold and burnt in cells are defined as stream cells.
  4. iFlag_stream_grid_option is 4: similar to 3, but the the threshold is dynamically changed based on the actual flow accumulation of burnt in cells.

Because HexWatershed can turn off stream burning, not all options are available in different configurations.