Browse Source

update calc-spectra.py

Konstantin Ladutenko 6 years ago
parent
commit
e27858efa0
1 changed files with 4 additions and 3 deletions
  1. 4 3
      examples/calc-spectra.py

+ 4 - 3
examples/calc-spectra.py

@@ -29,14 +29,13 @@
 import sys
 sys.path.insert(0,'..')  # to be able to import scattnlay from the upper dir
 
-from scattnlay import scattnlay,scattcoeffs,fieldnlay, switch_to_double_precision, switch_to_multiple_precision
+from scattnlay import scattnlay,scattcoeffs,fieldnlay
 
 import matplotlib.pyplot as plt
 import numpy as np
 import cmath
 
 
-switch_to_multiple_precision()
 from_WL = 400
 to_WL = 800
 WL_points= 100
@@ -59,7 +58,9 @@ for WL in WLs:
     x[0] = 2.0*np.pi*core_r/WL#/4.0*3.0
     m[0] = index_NP
     terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 = scattnlay(
-        np.array(x), np.array(m))
+        np.array(x), np.array(m),
+        mp=True
+    )
     print(np.array([Qsca]))
     terms, an, bn = scattcoeffs(x, m,24)
     # Qsca_vec.append(Qsca*np.pi*core_r**2*1e-5)