1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- from scattnlay import scattnlay
- import numpy as np
- x = np.ones((400, 2), dtype = np.float64)
- x[:, 1] = np.arange(0.1, 100.0, 0.25)
- x[:, 0] = 0.99**(1.0/3.0)*x[:, 1]
- m = np.ones((400, 2), dtype = np.complex128)
- m[:, 0] *= 1.33
- m[:, 1] *= 1.59 + 0.66j
- 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
|