diff --git a/tp/calculate.py b/tp/calculate.py index 0704ef7..095722a 100644 --- a/tp/calculate.py +++ b/tp/calculate.py @@ -148,7 +148,8 @@ def lifetime(gamma, use_tprc=True): with np.errstate(divide='ignore', invalid='ignore'): lifetime = np.reciprocal(np.multiply(2e12 * 2 * np.pi, gamma)) - lifetime = np.where(np.isinf(lifetime), np.nanmax(lifetime), lifetime) + infmax = np.nanmax(np.where(np.isinf(lifetime), 0, lifetime)) + lifetime = np.where(np.isinf(lifetime), infmax, lifetime) lifetime = np.where(np.isnan(lifetime), np.nanmin(lifetime), lifetime) if use_tprc: diff --git a/tp/data/load.py b/tp/data/load.py index aa96a79..62db5c4 100644 --- a/tp/data/load.py +++ b/tp/data/load.py @@ -167,7 +167,7 @@ def amset(filename, quantities='all', doping='n'): data2[c] = np.multiply(data2[c], float(aconversions[c])) if 'power_factor' in quantities: - data2 = tp.calculate.power_factor_fromdict(data2) + data2 = tp.calculate.power_factor_fromdict(data2, use_tprc=False) for c in conversions: if c in data2: diff --git a/tp/plot/phonons.py b/tp/plot/phonons.py index 22eeb54..db785ea 100644 --- a/tp/plot/phonons.py +++ b/tp/plot/phonons.py @@ -1208,6 +1208,7 @@ def add_wideband(ax, kdata, pdata, temperature=300, poscar='POSCAR', main=True, c2 = np.abs(cinterp(x2)) fmax = np.amax(np.add(f, c2)) fmin = np.amin(np.subtract(f, c2)) + c2 = np.where(c2==0, np.nanmin(c2[np.nonzero(c2)]), c2) f2 = np.linspace(fmin, fmax, 2500) # broadening