Skip to content

Commit

Permalink
small tweaks to remove old mpl functions that were apparently depreca…
Browse files Browse the repository at this point in the history
…ted with new mpl version
  • Loading branch information
kthyng committed Jul 15, 2019
1 parent f1cb356 commit 644d02e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tracpy/calcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import numpy as np
from matplotlib.mlab import find
# from matplotlib.mlab import find
import netCDF4 as netCDF
from scipy import ndimage
import time
Expand Down Expand Up @@ -266,7 +266,7 @@ def rel_dispersion(lonp, latp, r=[0, 1], squared=True, spherical=True):
spherical=spherical)
# add in which drifter we are at to shift to correct index and one
# since starts after comparison point
ind = idrifter + 1 + find((dist <= r[1]) * (dist >= r[0]))
ind = idrifter + 1 + np.where((dist <= r[1]) * (dist >= r[0]))[0]
for i in ind:
pairs.append([min(idrifter, i), max(idrifter, i)])

Expand Down
4 changes: 2 additions & 2 deletions tracpy/inout.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from . import op
import os
import tracpy
from matplotlib.mlab import find
# from matplotlib.mlab import find


def setupROMSfiles(loc, date, ff, tout, time_units, tstride=1):
Expand Down Expand Up @@ -72,7 +72,7 @@ def setupROMSfiles(loc, date, ff, tout, time_units, tstride=1):
dates = netCDF.num2date(nc.variables['ocean_time'][:], time_units,
calendar='proleptic_gregorian')
# time index with time value just below date (relative to file ifile)
istart = find(dates <= date)[-1]
istart = np.where(dates <= date)[0][-1]

# Select indices
if ff == 1:
Expand Down
5 changes: 3 additions & 2 deletions tracpy/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from scipy import ndimage
import time
import matplotlib.tri as mtri
from matplotlib.mlab import Path, find
# from matplotlib.mlab import Path, find
from matplotlib.path import Path


def interpolate2d(x, y, grid, itype, xin=None, yin=None, order=1,
Expand Down Expand Up @@ -462,7 +463,7 @@ def make_proj(setup='nwgom', usebasemap=True, **kwargs):

# Set up projection using inputs dictionary
if usebasemap:
from mpl_toolkits.basemap import Basemap
# from mpl_toolkits.basemap import Basemap
proj = Basemap(**inputs)
else:
from pyproj import Proj
Expand Down

0 comments on commit 644d02e

Please sign in to comment.