Skip to content

Commit

Permalink
TWC bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sambowers committed Apr 10, 2018
1 parent 58177c0 commit b9c2b1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions biota/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ def calculateTWC(tile, patch_size = 'auto', output = False, show = False):

# Extract the data
WC = woody_cover[ymin:ymax, xmin:xmax]

# If at least 50 % of data is present...
if TWC.mask.sum() <= ((patch_size ** 2) * 0.5):
if WC.mask.sum() <= ((patch_size ** 2) * 0.5):

# Calculate proportion of woody cover in patch
TWC.data[n, m] = int(round((float(WC.sum()) / ((patch_size ** 2) - WC.mask.sum())) * 100))
Expand Down

0 comments on commit b9c2b1b

Please sign in to comment.