Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
convert coordinates to floats
  • Loading branch information
koldunovn committed Jun 19, 2020
commit 10507e5eed2ad445943b86d678a6b10d702b083b
8 changes: 4 additions & 4 deletions src/py_eddy_tracker/dataset/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ def setup_coordinates(self):
x_name, y_name = self.coordinates
if self.is_centered:
logger.info("Grid center")
self.x_c = self.vars[x_name]
self.y_c = self.vars[y_name]
self.x_c = self.vars[x_name].astype('float64')
self.y_c = self.vars[y_name].astype('float64')

self.x_bounds = concatenate((self.x_c, (2 * self.x_c[-1] - self.x_c[-2],)))
self.y_bounds = concatenate((self.y_c, (2 * self.y_c[-1] - self.y_c[-2],)))
Expand All @@ -437,8 +437,8 @@ def setup_coordinates(self):
self.y_bounds[-1] -= d_y[-1] / 2

else:
self.x_bounds = self.vars[x_name]
self.y_bounds = self.vars[y_name]
self.x_bounds = self.vars[x_name].astype('float64')
self.y_bounds = self.vars[y_name].astype('float64')

if len(self.x_dim) == 1:
self.x_c = self.x_bounds.copy()
Expand Down