diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index 1367653..57c3116 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -9,13 +9,14 @@ Users can run a PyFlowline simulation in the following steps: * `gdal` * `netCDF4` * `shapely` - * `cython` (optional) + * `cython` (optional, for performance) * `cartopy` (optional, for visualization) * `matplotlib` (optional, for visualization) + * `utm` (optional, for visualization) 2. Clone the latest PyFlowline repository from https://github.com/changliao1025/pyflowline. Or Install the PyFlowline through Conda for a released version. 3. Download the additional large files (DEM and MPAS mesh) and move them under the `data/susquehanna/input` folder. -4. Change the `sFilename_mesh_netcdf` and `sFilename_basins` to the actual paths, +4. Change the `sFilename_mesh_netcdf`, `sFilename_basins`, and `sFilename_flowline_filter` to the actual paths, 5. Open the preferred Python IDE and run the `examples/susquehanna/run_simulation_mpas.py` Python script. Optionally, you can also run the `notebooks/pyflowline.ipynb` notebook. 6. You should produce a list of model outputs in the `data/susquehanna/output` folder. -If you encountered any issues, refer to the FAQ or submit a Github issue (https://github.com/changliao1025/pyflowline/issues). \ No newline at end of file +If you encounter any issues, refer to the FAQ or submit a GitHub issue (https://github.com/changliao1025/pyflowline/issues). \ No newline at end of file diff --git a/examples/susquehanna/pyflowline_susquehanna_basins.json b/examples/susquehanna/pyflowline_susquehanna_basins.json index 8d96b87..f1a2669 100644 --- a/examples/susquehanna/pyflowline_susquehanna_basins.json +++ b/examples/susquehanna/pyflowline_susquehanna_basins.json @@ -5,7 +5,7 @@ "dAccumulation_threshold": 100000, "dThreshold_small_river": 10000, "iFlag_dam": 0, - "iFlag_debug":1, + "iFlag_debug":0, "iFlag_disconnected": 0, "lBasinID": 1, "sFilename_dam": "/qfs/people/liao313/data/hexwatershed/susquehanna/auxiliary/ICoM_dams.csv", diff --git a/pyflowline/algorithms/auxiliary/find_index_in_list.py b/pyflowline/algorithms/auxiliary/find_index_in_list.py index 53d706c..93c00a2 100644 --- a/pyflowline/algorithms/auxiliary/find_index_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_index_in_list.py @@ -149,7 +149,7 @@ def check_if_duplicates(aList_in): return iFlag_unique -def add_unique_vertex(aVertex_in, pVertex_in): +def add_unique_vertex(aVertex_in, pVertex_in, dThreshold_in = 1.0E-6): """[add a vertex to a list if it is not already included] Args: @@ -162,7 +162,7 @@ def add_unique_vertex(aVertex_in, pVertex_in): iFlag_exist = 0 nVertex = len(aVertex_in) - iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in) + iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) if iFlag_exist == 1: pass diff --git a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py index f158df8..235f26f 100644 --- a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py @@ -1,6 +1,6 @@ import numpy as np -def find_vertex_in_list(aVertex_in, pVertex_in): +def find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in=1.0E-6): """[find the index of a vertex in a list] Args: @@ -18,7 +18,9 @@ def find_vertex_in_list(aVertex_in, pVertex_in): if nVertex > 0 : for i in np.arange( nVertex): pVertex = aVertex_in[i] - if pVertex == pVertex_in: + dDistance = pVertex.calculate_distance(pVertex_in) + #if pVertex == pVertex_in: + if dDistance < dThreshold_in: iFlag_exist = 1 lIndex = i break