diff --git a/tests/manual_check/f32/lnmoment_amcloud.py b/tests/manual_check/f32/lnmoment_amcloud.py deleted file mode 100644 index d34aaecb..00000000 --- a/tests/manual_check/f32/lnmoment_amcloud.py +++ /dev/null @@ -1,55 +0,0 @@ -"""comparison of the errors for exp(-9/2 log^2 sigmag) for FP32 jax - -Note: - this code was used to determine the optimal function of exp(-9/2 * log^2 sigmag) used in layeropacity.layer_optical_depth_clouds_lognormal - The conclusion is that we should use f(sig) in the following code. -""" - -import jax.numpy as jnp -import numpy as np - -def gnp(sig): - logs = np.log(sig) - return np.exp(-4.5*logs**2) - -def f0(sig): - return (sig**(-4.5*jnp.log(sig))) - -def f(sig): - return sig**(jnp.log(sig**-4.5)) - -def g(sig): - logs = jnp.log(sig) - return jnp.exp(-4.5*logs**2) - - -if __name__ == "__main__": - arr = np.logspace(0,3,10001) - - print(len(arr[f0(arr)>0.0])) - print(len(arr[f(arr)>0.0])) - print(len(arr[g(arr)>0.0])) - print(np.min(arr[f(arr)>0.0])) - print(np.max(arr[f(arr)>0.0])) - farr = f(arr) - print(np.min(farr[farr>0.0])) - print(np.max(farr)) - - import matplotlib.pyplot as plt - fig = plt.figure() - ax = fig.add_subplot(211) -# plt.plot(arr,np.log(arr)) - plt.plot(arr,gnp(arr)) - plt.xscale("log") - plt.yscale("log") - plt.axhline(1.0,color="gray",ls="dashed") - ax = fig.add_subplot(212) - plt.plot(arr,g(arr)/gnp(arr)-1.0,label="exp",alpha=0.3) - plt.plot(arr,f0(arr)/gnp(arr)-1.0,label="sig**(-4.5*jnp.log(sig))",alpha=0.3) - plt.plot(arr,f(arr)/gnp(arr)-1.0,label="sig**(jnp.log(sig**-4.5))",alpha=0.7) - plt.xscale("log") - plt.ylim(-2.e-5,2.e-5) - plt.legend() - plt.show() - - diff --git a/tests/manual_check/xs/Ttyp_demo.py b/tests/manual_check/xs/Ttyp_demo.py deleted file mode 100644 index 0fe23e54..00000000 --- a/tests/manual_check/xs/Ttyp_demo.py +++ /dev/null @@ -1,42 +0,0 @@ -from exojax.spec.lpf import auto_xsection -from exojax.spec import line_strength, doppler_sigma, gamma_natural -from exojax.spec.exomol import gamma_exomol -from exojax.spec import api -import numpy as np - -def demo(Tfix,Ttyp,crit=1.e-40): - """reproduce userguide/moldb.html#masking-weak-lines - - Args: - Tfix: gas temperature - Ttyp: Ttyp for line strength criterion - crit: line strength criterion - - Returns - nus, xsv - - """ - - nus=np.linspace(1000.0,10000.0,900000,dtype=np.float64) #cm-1 - mdbCO=api.MdbExomol('.database/CO/12C-16O/Li2015',nus, Ttyp=Ttyp, crit=crit) - Mmol=28.010446441149536 # molecular weight - Pfix=1.e-3 # we compute P=1.e-3 bar - qt=mdbCO.qr_interp(Tfix) - Sij=line_strength(Tfix,mdbCO.logsij0,mdbCO.nu_lines,mdbCO.elower,qt,mdbCO.Tref) - gammaL = gamma_exomol(Pfix,Tfix,mdbCO.n_Texp,mdbCO.alpha_ref)\ - + gamma_natural(mdbCO.A) - # thermal doppler sigma - sigmaD=doppler_sigma(mdbCO.nu_lines,Tfix,Mmol) - #line center - nu0=mdbCO.nu_lines - xsv=auto_xsection(nus,nu0,sigmaD,gammaL,Sij,memory_size=30) - return nus, xsv - -if __name__=="__main__": - Tfix=2000.0 - Ttyp=1000. - nus,xsv=demo(Tfix,Ttyp,crit=1.e-40) - import matplotlib.pyplot as plt - plt.plot(1.e4/nus,xsv) - plt.yscale("log") - plt.show()