- Timestamp:
- 06/07/17 10:50:54 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-larour-NatGeoScience2016/src/py3/interp/holefiller.py
r19895 r21759 1 import numpy as np y1 import numpy as np 2 2 from scipy.spatial import cKDTree 3 3 … … 30 30 filled=data 31 31 32 XYGood=np y.dstack([x[goodids],y[goodids]])[0]33 XYBad=np y.dstack([x[badids],y[badids]])[0]32 XYGood=np.dstack([x[goodids],y[goodids]])[0] 33 XYBad=np.dstack([x[badids],y[badids]])[0] 34 34 tree=cKDTree(XYGood) 35 35 nearest=tree.query(XYBad,k=knn)[1] … … 42 42 for j in range(knn): 43 43 neardat.append(filled[goodids][nearest[i][j]]) 44 filled[badids[i]]=np y.mean(neardat)44 filled[badids[i]]=np.mean(neardat) 45 45 46 46 return filled
Note:
See TracChangeset
for help on using the changeset viewer.