Skip to content

Commit

Permalink
Wrapped interpolation function in try-except to provide better error …
Browse files Browse the repository at this point in the history
…message than that mentioned in issue #19
  • Loading branch information
uniomni committed Aug 14, 2011
1 parent dd6601b commit f467032
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion impact/engine/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def raster_spline(longitudes, latitudes, values):
A = numpy.flipud(values)

# Call underlying spline
F = RectBivariateSpline(latitudes, longitudes, A)
try:
F = RectBivariateSpline(latitudes, longitudes, A)
except:
msg = 'Interpolation failed. Please zoom out a bit and try again'
raise Exception(msg)

# Return interpolator
return Interpolator(F, longitudes, latitudes)
Expand Down

0 comments on commit f467032

Please sign in to comment.