Skip to content

Commit

Permalink
update before rtree
Browse files Browse the repository at this point in the history
  • Loading branch information
changliao1025 committed Aug 29, 2023
1 parent 844bdba commit fad8474
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 26 deletions.
62 changes: 36 additions & 26 deletions pyflowline/classes/_visual_basin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def basin_plot(self,
aFilename_in,
iFont_size_in=iFont_size_in,
sFilename_output_in=sFilename_output_in,
#sTitle_in= 'Flow direction with observation',
sTitle_in= 'Flow direction with observation',
aFlag_thickness_in= [1, 0, 0],
aVariable_in= ['drainage_area', '', 'stream_segment'],
aLegend_in = aLegend_in,
aLegend_in = aLegend_in,
aFlag_color_in = [0, 0, 1],
aFlag_fill_in = [0, 0, 0])
else:
Expand Down Expand Up @@ -292,43 +292,53 @@ def _plot_polygon_variable(self,
sFilename = self.sFilename_variable_polygon

else:
if sVariable_in == 'elevation':
sVariable='elevation'
sTitle = 'Surface elevation'
sUnit = r'Unit: m'
if sVariable_in == 'area':
sVariable='area'
sTitle = 'Area'
sUnit = r'Units: $m^{2}$'
sColormap ='terrain'
dData_min = dData_min_in
dData_max = dData_max_in
sFilename = self.sFilename_variable_polygon
pass
else:
if sVariable_in == 'drainage_area':
sVariable='drainage_area'
sTitle = 'Drainage area'
sUnit = r'Units: $m^{2}$'
if sVariable_in == 'elevation':
sVariable='elevation'
sTitle = 'Surface elevation'
sUnit = r'Unit: m'
sColormap ='terrain'
dData_min = dData_min_in
dData_max = dData_max_in
sColormap ='Spectral_r'
sFilename = self.sFilename_variable_polygon

else:
if sVariable_in == 'travel_distance':
sVariable='travel_distance'
sTitle = 'Travel distance'
sUnit = r'Unit: m'
dData_min = 0.0
if sVariable_in == 'drainage_area':
sVariable='drainage_area'
sTitle = 'Drainage area'
sUnit = r'Units: $m^{2}$'
dData_min = dData_min_in
dData_max = dData_max_in
sColormap ='Spectral_r'
iFlag_subbasin = 1
sFilename = self.sFilename_variable_polygon

else:
sVariable='slope'
sTitle = 'Surface slope'
sUnit = r'Unit: percent'
sColormap='Spectral_r'
dData_min = dData_min_in
dData_max = dData_max_in
sFilename = self.sFilename_variable_polygon
pass
if sVariable_in == 'travel_distance':
sVariable='travel_distance'
sTitle = 'Travel distance'
sUnit = r'Unit: m'
dData_min = 0.0
dData_max = dData_max_in
sColormap ='Spectral_r'
iFlag_subbasin = 1
sFilename = self.sFilename_variable_polygon
else:
sVariable='slope'
sTitle = 'Surface slope'
sUnit = r'Unit: percent'
sColormap='Spectral_r'
dData_min = dData_min_in
dData_max = dData_max_in
sFilename = self.sFilename_variable_polygon
pass

if iFlag_title_in is not None:
if iFlag_title_in == 0:
Expand Down
11 changes: 11 additions & 0 deletions pyflowline/classes/pycase.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from pyflowline.mesh.square.create_square_mesh import create_square_mesh
from pyflowline.mesh.mpas.create_mpas_mesh import create_mpas_mesh
from pyflowline.mesh.dggrid.create_dggrid_mesh import create_dggrid_mesh
from pyflowline.mesh.dggrid.create_dggrid_mesh import dggrid_find_resolution_by_index
from pyflowline.mesh.tin.create_tin_mesh import create_tin_mesh
gdal.UseExceptions()
pDate = datetime.datetime.today()
Expand Down Expand Up @@ -271,6 +272,8 @@ def __init__(self, aConfig_in,
else:
print('Please specify resolution.')



if 'dThreshold_break_by_distance' in aConfig_in:
self.dThreshold_break_by_distance = float(aConfig_in['dThreshold_break_by_distance'])

Expand Down Expand Up @@ -383,6 +386,10 @@ def __init__(self, aConfig_in,
else:
print('Unsupported mesh type?')

if self.iMesh_type == 5:
#update resolution
self.dResolution_meter = dggrid_find_resolution_by_index(self.sDggrid_type, self.iResolution_index)

#the model can be run as part of hexwatershed or standalone
if self.iFlag_standalone == 1:
#in standalone case, will add case information and update output path
Expand Down Expand Up @@ -779,6 +786,7 @@ def mesh_generation(self, iFlag_antarctic_in=None):

if iFlag_mesh_boundary ==1:
#create a polygon based on


aDggrid = create_dggrid_mesh(iFlag_global,
iFlag_save_mesh,
Expand All @@ -788,6 +796,8 @@ def mesh_generation(self, iFlag_antarctic_in=None):
iFlag_antarctic_in=iFlag_antarctic_in,
sDggrid_type_in = self.sDggrid_type,
sFilename_boundary_in = self.sFilename_mesh_boundary)



pass
else:
Expand All @@ -798,6 +808,7 @@ def mesh_generation(self, iFlag_antarctic_in=None):
sWorkspace_output,
iResolution_index_in= self.iResolution_index,
sDggrid_type_in = self.sDggrid_type)

pass


Expand Down

0 comments on commit fad8474

Please sign in to comment.