|
9 | 9 | # #
|
10 | 10 | # ----------------------------------------------------- #
|
11 | 11 | """
|
12 |
| -Contributions to UV/vis extinction spectra other |
13 |
| -then obtained from MSTM. |
| 12 | +Contributions to optical extinction spectra from axial-symmetric |
| 13 | +particles. Currently, spheroids. |
14 | 14 | """
|
15 | 15 | from __future__ import print_function
|
16 | 16 | from __future__ import division
|
@@ -134,31 +134,3 @@ def plot_shape(self, values, fig=None, axs=None):
|
134 | 134 | plt.show()
|
135 | 135 | return fig, axs
|
136 | 136 |
|
137 |
| - |
138 |
| -if __name__== '__main__': |
139 |
| - # tests come here |
140 |
| - from mstm_studio.alloy_AuAg import AlloyAuAg |
141 |
| - wls = np.linspace(300, 800, 51) |
142 |
| - npsize = 10 |
143 |
| - sph = SpheroidSP(wavelengths=wls) |
144 |
| - sph.set_material(AlloyAuAg(x_Au=1), 1.5) |
145 |
| - sph.NORDER = 5 |
146 |
| - sph.plot_shape([1, npsize, 1.0]) |
147 |
| - ext_sph = sph.calculate([1, npsize, 1.0]) |
148 |
| - # sph.plot([1, 10, 1.0]) # scale, diameter, aspect |
149 |
| - |
150 |
| - from mstm_studio.contributions import MieSingleSphere |
151 |
| - mie = MieSingleSphere(name='mie', wavelengths=wls) |
152 |
| - mie.set_material(AlloyAuAg(x_Au=1), 1.5) |
153 |
| - ext_mie = mie.calculate([1, npsize]) |
154 |
| - |
155 |
| - ext_sph = ext_sph |
156 |
| - norm_sph = np.sum(ext_sph) |
157 |
| - ext_mie = ext_mie |
158 |
| - norm_mie = np.sum(ext_mie) |
159 |
| - scale = norm_mie / norm_sph |
160 |
| - print('scale mult: %f' % scale) |
161 |
| - plt.plot(wls, ext_sph * scale, label='T-mat') |
162 |
| - plt.plot(wls, ext_mie, label='Mie') |
163 |
| - plt.legend() |
164 |
| - plt.show() |
0 commit comments