Skip to content

Commit

Permalink
Merge pull request #255 from antarctica/blocked_corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulvetanna authored Mar 1, 2024
2 parents ef7adad + 384a5dd commit 5eed8f5
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 489 deletions.
10 changes: 6 additions & 4 deletions polar_route/crossing_smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,8 @@ def blocked(self,new_cell,cell_a,cell_b):
Args:
new_cell (dict) - New cell to add environmental parameters as dict
cell_a (dict) - Start cell to add environmental parameters as dict
cell_b (dict) - End cell to add environmental parameters as dict
cell_a (dict) - Start cell to add environmental parameters as dict
cell_b (dict) - End cell to add environmental parameters as dict
Return:
True if the cell cannot be entered, False if the cell can
Expand All @@ -1047,8 +1047,10 @@ def blocked(self,new_cell,cell_a,cell_b):
end = cell_b['SIC']
max_new = new_cell['SIC']

percentage_diff = (max_new-start)
if percentage_diff < self.blocked_sic:
percentage_diff1 = (max_new-start)
percentage_diff2 = (max_new-end)

if (percentage_diff1 <= self.blocked_sic*start) or (percentage_diff2 <= self.blocked_sic*end) or (max_new<=self.blocked_sic):
return False
else:
return True
Expand Down
Loading

0 comments on commit 5eed8f5

Please sign in to comment.