Skip to content

Commit 5d5f6a0

Browse files
committed
cleaning of contrib_spheroids.py
1 parent 81bde33 commit 5d5f6a0

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

mstm_studio/contrib_spheroid.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# #
1010
# ----------------------------------------------------- #
1111
"""
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.
1414
"""
1515
from __future__ import print_function
1616
from __future__ import division
@@ -134,31 +134,3 @@ def plot_shape(self, values, fig=None, axs=None):
134134
plt.show()
135135
return fig, axs
136136

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

Comments
 (0)