Skip to content

Commit

Permalink
Merge pull request #140 from AndrewWilliams3142/extrapolate
Browse files Browse the repository at this point in the history
Changing fill_value from None to 'extrapolate' for ozone data
  • Loading branch information
brian-rose committed Jan 15, 2021
2 parents dfe4c52 + c6765a7 commit 2cabb49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions climlab/radiation/radiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def default_absorbers(Tatm,
except:
warnings.warn('Some grid points are beyond the bounds of the ozone file. Ozone values will be extrapolated.')
try:
# passing fill_value=None to the underlying scipy interpolator
# passing fill_value='extrapolate' to the underlying scipy interpolator
# will result in extrapolation instead of NaNs
O3 = O3source.interp_like(xTatm, kwargs={'fill_value':None})
O3 = O3source.interp_like(xTatm, kwargs={'fill_value':'extrapolate'})
assert not np.any(np.isnan(O3))
except:
warnings.warn('Interpolation of ozone data failed. Setting O3 to zero instead.')
Expand Down

0 comments on commit 2cabb49

Please sign in to comment.