Adding chi examples

This commit is contained in:
2020-07-14 11:19:01 -05:00
parent a7c33fb5df
commit 064b7ee94c
3 changed files with 47 additions and 1 deletions

19
pynam/noise/chi.py Normal file
View File

@@ -0,0 +1,19 @@
from typing import Callable
import numpy as np
import scipy.integrate
import pynam.noise.im_ref
def get_chi_zz_e(eps: Callable[[float], complex]) -> Callable[[float], float]:
im_ref_p = pynam.noise.im_ref.get_im_ref_p(eps)
def chi_zz_e(z: float) -> float:
def integrand(y: float) -> float:
return (y**2) * im_ref_p(y / z) * np.exp(-2 * y)
return scipy.integrate.quad(integrand, 0, np.inf, epsabs=1e-10, epsrel=1e-10)[0] / (z**3)
return chi_zz_e