7
7
from pyflowline .classes .pycase import flowlinecase
8
8
from pyflowline .classes .basin import pybasin
9
9
10
- sPath = str (Path (__file__ ).parent .resolve ())
11
- sPath_data = realpath (sPath + '/../data/susquehanna/' )
12
10
13
- def pyflowline_generate_basin_template_configuration_json_file (sFilename_basins_json , nBasin , sWorkspace_output ):
11
+
12
+ def pyflowline_generate_basin_template_configuration_json_file (sFilename_basins_json , nBasin , sWorkspace_output , sPath_data ):
14
13
aBasin_out = list ()
15
14
for i in range (nBasin ):
16
15
sBasin = "{:03d}" .format (i + 1 )
@@ -24,13 +23,13 @@ def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_
24
23
aConfig_basin ['dThreshold_small_river' ] = 90
25
24
26
25
aConfig_basin ['sFilename_dam' ] = str (Path (sPath_data ) / 'ICoM_dams.csv' )
27
- #"/qfs/people/liao313/data/hexwatershed/susquehanna/auxiliary/ICoM_dams.csv"
26
+
28
27
aConfig_basin ['sFilename_flowline_filter' ] = str (Path (sPath_data ) / 'streamord7above.shp' )
29
- #"/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/streamord7above.shp"
28
+
30
29
aConfig_basin ['sFilename_flowline_raw' ] = str (Path (sPath_data ) / 'allflowline.shp' )
31
- #"/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/allflowline.shp"
30
+
32
31
aConfig_basin ['sFilename_flowline_topo' ] = str (Path (sPath_data ) / 'flowline.csv' )
33
- #"/qfs/people/liao313/data/hexwatershed/susquehanna/auxiliary/flowline.csv"
32
+
34
33
aConfig_basin ['sWorkspace_output_basin' ] = str (Path (sWorkspace_output ) / sBasin )
35
34
pBasin = pybasin (aConfig_basin )
36
35
aBasin_out .append (pBasin )
@@ -47,7 +46,7 @@ def pyflowline_generate_basin_template_configuration_json_file(sFilename_basins_
47
46
48
47
49
48
return aBasin_out
50
- def pyflowline_generate_template_configuration_json_file (sFilename_json ):
49
+ def pyflowline_generate_template_configuration_json_file (sFilename_json , sPath_data ):
51
50
52
51
if os .path .exists (sFilename_json ):
53
52
os .remove (sFilename_json )
@@ -74,11 +73,11 @@ def pyflowline_generate_template_configuration_json_file(sFilename_json):
74
73
aConfig ['dLatitude_top' ] = 90
75
74
aConfig ['sFilename_model_configuration' ] = sFilename_json
76
75
aConfig ['sWorkspace_data' ] = sPath_data
77
- #'/people/liao313/data'
76
+
78
77
aConfig ['sWorkspace_project' ] = 'pyflowline'
79
- #aConfig['sWorkspace_bin'] = '/people/liao313/bin'
78
+
80
79
aConfig ['sWorkspace_output' ] = str (Path (sPath_data ) / 'output' )
81
- #"/compyfs/liao313/04model/pyflowline/susquehanna"
80
+
82
81
aConfig ['sRegion' ] = 'susquehanna'
83
82
aConfig ['sModel' ] = 'pyflowline'
84
83
aConfig ['iCase_index' ] = 1
@@ -87,13 +86,13 @@ def pyflowline_generate_template_configuration_json_file(sFilename_json):
87
86
aConfig ['sJob' ] = 'pyflowline'
88
87
aConfig ['sDate' ]= '20220110'
89
88
aConfig ['sFilename_mesh' ] = str (Path (sPath_data ) / 'lnd_cull_mesh.nc' )
90
- #"/qfs/people/liao313/data/icom/mesh/delaware_lnd_60_30_5_2_v2/lnd_cull_mesh.nc"
89
+
91
90
aConfig ['flowline_info' ] = 'flowline_info.json'
92
91
aConfig ['sFilename_mesh_info' ] = 'mesh_info.json'
93
92
aConfig ['sFilename_elevation' ] = 'elevation.json'
94
- #aConfig['sFilename_dem'] = '/qfs/people/liao313/data/hexwatershed/susquehanna/raster/dem/dem_ext.tif'
93
+
95
94
aConfig ['sFilename_spatial_reference' ] = str (Path (sPath_data ) / 'boundary_proj.shp' )
96
- #'/qfs/people/liao313/data/hexwatershed/susquehanna/vector/hydrology/boundary_proj.shp'
95
+
97
96
98
97
99
98
oModel = flowlinecase (aConfig )
0 commit comments