Skip to content

Commit 293a8ba

Browse files
authored
Merge pull request #1653 from knutfrode/dev
[run-ex] reader.plot now converts single-element-arrays from xy2lonla…
2 parents c16984d + b501933 commit 293a8ba

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

opendrift/readers/basereader/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ def plot(self, variable=None, vmin=None, vmax=None, time=None,
261261
x0 = (self.xmin + self.xmax) / 2
262262
y0 = (self.ymin + self.ymax) / 2
263263
lon0, lat0 = self.xy2lonlat(x0, y0)
264+
lon0 = np.squeeze(lon0).item()
265+
lat0 = np.squeeze(lat0).item()
264266
sp = ccrs.Stereographic(central_longitude=lon0, central_latitude=lat0)
265267
latmax = np.maximum(latmax, lat0)
266268
latmin = np.minimum(latmin, lat0)

0 commit comments

Comments
 (0)