stephankramer / uptide

python package for tidal calculations
GNU Lesser General Public License v3.0
44 stars 8 forks source link

NetCDFInterpolator: fix coordinate delta computation #3

Closed tkarna closed 7 years ago

tkarna commented 7 years ago

Previous method delta = val[-1]-origin[-1])/(N-1) may fail if the coordinate array is masked (as in the case of fes2012) because val[-1] is not a value.

Instead, use numpy.diff to compute the differences. It handles masked arrays correctly.

tkarna commented 7 years ago

Also added another python3 fix that I bumped into.

stephankramer commented 7 years ago

Nice, thanks!