python2 compatibility (or rather scipy of python2) and avoid NaNs

This commit is contained in:
Axel Kohlmeyer
2023-03-03 20:50:56 -05:00
parent e4b1a33ced
commit c3c6c5f154

View File

@ -69,11 +69,11 @@ class BI(PairTabulate):
# savgol_filter is an example of smoothing.
# Other filters/functions can be used.
g = savgol_filter(g, 10, 5)
g = savgol_filter(g, 9, 5)
return self.inversion(r, g)
def inversion(self, r, g):
e = -self.kbT * np.log(g)
e = -self.kbT * np.log(np.clip(g,1.0e-100,1.0e100))
e = self.complete_exponential(r, e)
return r, e,