Skip to content

Commit

Permalink
update qs
Browse files Browse the repository at this point in the history
  • Loading branch information
changliao1025 committed Jan 24, 2023
1 parent 7d15b15 commit 30c5085
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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).
If you encounter any issues, refer to the FAQ or submit a GitHub issue (https://github.com/changliao1025/pyflowline/issues).
2 changes: 1 addition & 1 deletion examples/susquehanna/pyflowline_susquehanna_basins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions pyflowline/algorithms/auxiliary/find_index_in_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pyflowline/algorithms/auxiliary/find_vertex_in_list.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 30c5085

Please sign in to comment.