@@ -71,7 +71,7 @@ def test_form_factor():
7171 m = index_ratio (n_particle , n_matrix )
7272 x = size_parameter (wavelen , n_matrix , radius )
7373
74- angles = Quantity (np .linspace (0 , 180. , 19 ), 'deg' )
74+ angles = Quantity (np .linspace (0 , 180. , 19 ), 'deg' ). to ( "rad" ). magnitude
7575 # these values are calculated from MiePlot
7676 # (http://www.philiplaven.com/mieplot.htm), which uses BHMIE
7777 iperp_bhmie = np .array ([2046.60203864487 , 1282.28646423634 , 299.631502275208 ,
@@ -89,7 +89,7 @@ def test_form_factor():
8989 7.24176462105438 , 76.2910238480798 , 54.1983836607738 ,
9090 93.5508557840006 ])
9191
92- iparperp = mie .calc_ang_dist (m , x , angles )
92+ iparperp = mie .calc_ang_scat (m , x , angles )
9393 assert_array_almost_equal (iparperp [0 ], ipar_bhmie )
9494 assert_array_almost_equal (iparperp [1 ], iperp_bhmie )
9595
@@ -156,7 +156,7 @@ def test_absorbing_materials():
156156 m = index_ratio (n_particle , n_matrix )
157157 x = 10.0
158158
159- angles = Quantity (np .linspace (0 , 90. , 10 ), 'deg' )
159+ angles = Quantity (np .linspace (0 , 90. , 10 ), 'deg' ). to ( "rad" ). magnitude
160160 # these values are calculated from MiePlot
161161 # (http://www.philiplaven.com/mieplot.htm), which uses BHMIE
162162 iperp_bhmie = np .array ([4830.51401095968 , 2002.39671236719 ,
@@ -170,7 +170,7 @@ def test_absorbing_materials():
170170 24.9801217735053 , 53.2319915708624 ,
171171 8.26505988320951 , 47.4736966179677 ])
172172
173- iparperp = mie .calc_ang_dist (m , x , angles )
173+ iparperp = mie .calc_ang_scat (m , x , angles )
174174 assert_array_almost_equal (iparperp [0 ], ipar_bhmie )
175175 assert_array_almost_equal (iparperp [1 ], iperp_bhmie )
176176
@@ -186,7 +186,7 @@ def test_multilayer_spheres():
186186 radius = Quantity ('100.0 nm' )
187187 x = size_parameter (wavelen , n_sample , radius )
188188
189- f_parperp = mie .calc_ang_dist (m , x , angles )
189+ f_parperp = mie .calc_ang_scat (m , x , angles )
190190 cscat , cext , cabs , cback , asym = mie .calc_cross_sections (m , x , wavelen )
191191
192192 # form factor and cross section for a multilayer particle with a core that
@@ -195,7 +195,7 @@ def test_multilayer_spheres():
195195 multi_radius = Quantity (np .array ([100.0 , 100.0 ]),'nm' )
196196 xarray = size_parameter (wavelen , n_sample , multi_radius )
197197
198- f_parperp_multi = mie .calc_ang_dist (marray , xarray , angles )
198+ f_parperp_multi = mie .calc_ang_scat (marray , xarray , angles )
199199 cscat_multi , cext_multi , cabs_multi , cback_multi , asym_multi = mie .calc_cross_sections (marray , xarray , wavelen )
200200
201201 assert_array_almost_equal (f_parperp , f_parperp_multi )
@@ -212,7 +212,7 @@ def test_multilayer_spheres():
212212 multi_radius2 = Quantity (np .array ([100.0 , 110.0 ]),'nm' )
213213 xarray2 = size_parameter (wavelen , n_sample , multi_radius2 )
214214
215- f_parperp_multi2 = mie .calc_ang_dist (marray2 , xarray2 , angles )
215+ f_parperp_multi2 = mie .calc_ang_scat (marray2 , xarray2 , angles )
216216 cscat_multi2 , cext_multi2 , cabs_multi2 , cback_multi2 , asym_multi2 = mie .calc_cross_sections (marray2 , xarray2 , wavelen )
217217
218218 assert_array_almost_equal (f_parperp , f_parperp_multi2 )
@@ -228,7 +228,7 @@ def test_multilayer_spheres():
228228 multi_radius3 = Quantity (np .array ([100.0 , 100.0 , 100.0 ]),'nm' )
229229 xarray3 = size_parameter (wavelen , n_sample , multi_radius3 )
230230
231- f_parperp_multi3 = mie .calc_ang_dist (marray3 , xarray3 , angles )
231+ f_parperp_multi3 = mie .calc_ang_scat (marray3 , xarray3 , angles )
232232 cscat_multi3 , cext_multi3 , cabs_multi3 , cback_multi3 , asym_multi3 = mie .calc_cross_sections (marray3 , xarray3 , wavelen )
233233
234234 assert_array_almost_equal (f_parperp , f_parperp_multi3 )
@@ -245,7 +245,7 @@ def test_multilayer_spheres():
245245 multi_radius4 = Quantity (np .array ([100 , 110 , 120 ]),'nm' )
246246 xarray4 = size_parameter (wavelen , n_sample , multi_radius4 )
247247
248- f_parperp_multi4 = mie .calc_ang_dist (marray4 , xarray4 , angles )
248+ f_parperp_multi4 = mie .calc_ang_scat (marray4 , xarray4 , angles )
249249 cscat_multi4 , cext_multi4 , cabs_multi4 , cback_multi4 , asym_multi4 = mie .calc_cross_sections (marray4 , xarray4 , wavelen )
250250
251251 assert_array_almost_equal (f_parperp , f_parperp_multi4 )
@@ -266,8 +266,8 @@ def test_multilayer_absorbing_spheres():
266266 xarray = size_parameter (wavelen , n_sample , multi_radius )
267267 angles = Quantity (np .linspace (np .pi / 2 , np .pi , 20 ), 'rad' )
268268
269- f_parperp_multi_real = mie .calc_ang_dist (marray_real , xarray , angles )
270- f_parperp_multi_imag = mie .calc_ang_dist (marray_imag , xarray , angles )
269+ f_parperp_multi_real = mie .calc_ang_scat (marray_real , xarray , angles )
270+ f_parperp_multi_imag = mie .calc_ang_scat (marray_imag , xarray , angles )
271271
272272 cross_sections_multi_real = mie .calc_cross_sections (marray_real , xarray , wavelen )
273273 cross_sections_multi_imag = mie .calc_cross_sections (marray_imag , xarray , wavelen )
@@ -440,7 +440,7 @@ def test_pis_taus():
440440def test_differential_cross_section ():
441441 """
442442 Tests that the differential cross-sections from diff_scat_complex_medium()
443- and calc_ang_dist () are the same for a non-absorbing medium.
443+ and calc_ang_scat () are the same for a non-absorbing medium.
444444 """
445445 # set parameters
446446 wavelen = Quantity ("400.0 nm" )
@@ -455,7 +455,7 @@ def test_differential_cross_section():
455455 x = size_parameter (wavelen , n_matrix , radius )
456456
457457 # With far-field Mie solutions
458- I_parperp_cad = mie .calc_ang_dist (m , x , theta )
458+ I_parperp_cad = mie .calc_ang_scat (m , x , theta )
459459
460460 # With Mie solutions at surface of particle (but neglecting near-fields)
461461 kd = (k * distance ).to ("" ).magnitude
@@ -465,7 +465,7 @@ def test_differential_cross_section():
465465 incident_vector ,
466466 cartesian = False )
467467
468- # calc_ang_dist returns dimensionless differential cross-sections (times
468+ # calc_ang_scat returns dimensionless differential cross-sections (times
469469 # k^2). As noted in diff_scat_intensity_complex_medium(), this function
470470 # returns dimensionless values (scaled by k^2) muliplied by a factor of
471471 # 1/kd^2 for a non-absorbing medium. Therefore the
@@ -474,7 +474,7 @@ def test_differential_cross_section():
474474 # calculation is done. In short, both functions return dimensionless
475475 # cross-sections, but the ones returned by
476476 # diff_scat_intensity_complex_medium() need to be multiplied by a factor of
477- # kd^2 to compare them to those of calc_ang_dist ()
477+ # kd^2 to compare them to those of calc_ang_scat ()
478478 #
479479 # since both of these functions rely on the same routine to calculate the
480480 # amplitude scattering matrix, they should give results to within
0 commit comments