12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- from scattnlay import scattnlay
- import numpy as np
- size = np.linspace(0.1, 100., 1000)
- x = np.vstack((0.99**(1.0/3.0)*size, size)).transpose()
- m = np.array((1.33, 1.59 + 0.66j), dtype = np.complex128)
- terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 = scattnlay(x, m)
- result = np.vstack((x[:, 1], Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo)).transpose()
- try:
- import matplotlib.pyplot as plt
- plt.figure(1)
- plt.subplot(311)
- plt.plot(x[:, 1], Qext, 'k')
- plt.ylabel('Qext')
- plt.subplot(312)
- plt.plot(x[:, 1], Qsca, 'r')
- plt.ylabel('Qsca')
- plt.subplot(313)
- plt.plot(x[:, 1], Albedo, 'g')
- plt.ylabel('Albedo')
- plt.xlabel('X')
- plt.show()
- finally:
- np.savetxt("test02.txt", result, fmt = "%.5f")
- print(result)
|