Skip to content

Commit

Permalink
nansencenter/django-geo-spaas#128 - limit to 4 decimals in get_border…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
mortenwh committed Aug 14, 2020
1 parent 692507e commit dd08d6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nansat/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ def get_border(self, n_points=10, fix_lon=True, **kwargs):
y_rc_vec = Domain._get_row_col_vector(y_size, n_points)
col_vec, row_vec = Domain._compound_row_col_vectors(x_size, y_size, x_rc_vec, y_rc_vec)
lon, lat = self.transform_points(col_vec, row_vec)
lon = lon.round(decimals=4)
lat = lat.round(decimals=4)

crosses_dateline = np.diff(lon).max() > 100 # arbitrary number, larger than a maximum step
if crosses_dateline and fix_lon:
Expand Down

0 comments on commit dd08d6a

Please sign in to comment.