Skip to content

Commit

Permalink
Merge pull request #137 from stoiver/is_None
Browse files Browse the repository at this point in the history
amax to convert between vertex and centroid data
  • Loading branch information
stoiver committed Sep 13, 2017
2 parents 67f8fd0 + e84ae0d commit 7a49bb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions anuga/operators/erosion_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ def update_quantities(self):

de = m*dt
height = self.stage_c[ind] - self.elev_c[ind]
self.elev_c[ind] = num.maximum(self.elev_v[ind] - de, self.base)
self.elev_c[ind] = num.amax(num.maximum(self.elev_v[ind] - de, self.base), axis=1)
self.stage_c[ind] = self.elev_c[ind] + height
else:
m = num.vstack((m,m,m)).T # Stack up m to apply to vertices
m = num.where(m>self.threshold, m, 0.0)

de = m*dt
self.elev_v[ind] = num.maximum(self.elev_v[ind] - de, self.base)
self.elev_v[ind] = num.amax(num.maximum(self.elev_v[ind] - de, self.base), axis=1)

self.max_change = num.max(de)

Expand Down
4 changes: 2 additions & 2 deletions anuga/utilities/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,10 @@ def Make_Geotif(swwFile=None,
lower_left = [swwX.min(), swwY.min()]
if(upper_right is None):
upper_right = [swwX.max(), swwY.max()]
nx = round((upper_right[0]-lower_left[0])*1.0/(1.0*CellSize)) + 1
nx = int(round((upper_right[0]-lower_left[0])*1.0/(1.0*CellSize)) + 1)
xres = (upper_right[0]-lower_left[0])*1.0/(1.0*(nx-1))
desiredX = scipy.linspace(lower_left[0], upper_right[0],nx )
ny = round((upper_right[1]-lower_left[1])*1.0/(1.0*CellSize)) + 1
ny = int(round((upper_right[1]-lower_left[1])*1.0/(1.0*CellSize)) + 1)
yres = (upper_right[1]-lower_left[1])*1.0/(1.0*(ny-1))
desiredY = scipy.linspace(lower_left[1], upper_right[1], ny)

Expand Down

0 comments on commit 7a49bb4

Please sign in to comment.