Skip to content

Commit

Permalink
Fix pytroll#35 supporting scipy kdtree again
Browse files Browse the repository at this point in the history
A previous commit was looking for a 'data_pts' attribute in the kdtree
object, which is available in pykdtree, but not scipy.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Feb 25, 2016
1 parent fda439a commit acfb361
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyresample/kd_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,10 @@ def _query_resample_kdtree(resample_kdtree, source_geo_def, target_geo_def,
target_lons_valid, target_lats_valid)

# pykdtree requires query points have same data type as kdtree.
dt = resample_kdtree.data_pts.dtype
try:
dt = resample_kdtree.data_pts.dtype
except AttributeError:
dt = resample_kdtree.data.dtype
output_coords = np.asarray(output_coords, dtype=dt)

# Query kd-tree
Expand Down

0 comments on commit acfb361

Please sign in to comment.