Skip to content

Commit 6e46700

Browse files
committed
removed diff. cross-secs from output of integrate_intensity_complex_medium()
1 parent 41c0b7e commit 6e46700

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

pymie/mie.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,13 +1281,13 @@ def integrate_intensity_complex_medium(dscat, thetas, kd,
12811281
12821282
Parameters
12831283
----------
1284-
dscat : array-like with shape (2, num_values, num_thetas, [num_phis])
1284+
dscat : array-like with shape (2, ..., num_thetas, [num_phis])
12851285
differential scattered intensities for both polarizations. Can be
12861286
functions of theta or of theta and phi. If a function of theta and phi,
12871287
the theta dimension MUST come first
1288-
thetas : array-like, shape num_thetas
1288+
thetas : array-like, shape ([angle_leading_dims], num_thetas)
12891289
scattering angles
1290-
kd : array-like, shape num_values
1290+
kd : array-like, shape (...)
12911291
wavevector in medium times distance (from the center of the particle)
12921292
at which to integrate intensity
12931293
phi_min : float
@@ -1296,21 +1296,17 @@ def integrate_intensity_complex_medium(dscat, thetas, kd,
12961296
phi_max : float
12971297
maximum azimuthal angle, default set to 2*pi. Used only if phis is None
12981298
(coordinate system is scattering plane)
1299-
phis : None or ndarray (shape num_phis)
1299+
phis : None or ndarray, shape ([angle_leading_dims], num_phis)
13001300
azimuthal angles
13011301
13021302
Returns
13031303
-------
1304-
sigma: array-like with shape num_values
1304+
sigma: array-like with shape (...)
13051305
integrated cross section
1306-
sigma_1: array-like with shape num_values
1306+
sigma_1: array-like with shape (...)
13071307
integrated cross section for first component of basis
1308-
sigma_2: array-like with shape num_values
1308+
sigma_2: array-like with shape (...)
13091309
integrated cross section for second component of basis
1310-
dsigma_1: array-like, shape num_values, num_angles
1311-
differential cross section for first component of basis
1312-
dsigma_2: array-like, shape num_values, num_angles
1313-
differential cross section for second component of basis
13141310
13151311
Notes
13161312
-----
@@ -1369,7 +1365,6 @@ def integrate_intensity_complex_medium(dscat, thetas, kd,
13691365

13701366
# kd has trailing axes for theta (and possibly phi) that are no longer
13711367
# needed after the integration. We remove them here
1372-
kd_shape = kd.shape
13731368
kd = np.atleast_1d(kd.squeeze())
13741369

13751370
# multiply by factor that accounts for attenuation in the incident light
@@ -1388,9 +1383,7 @@ def integrate_intensity_complex_medium(dscat, thetas, kd,
13881383
# calculate the averaged sigma
13891384
sigma = (sigma_1 + sigma_2)/2 * factor
13901385

1391-
return(sigma, (sigma_1*factor),
1392-
(sigma_2*factor), (dsigma_1*factor.reshape(kd_shape)/2),
1393-
(dsigma_2*factor.reshape(kd_shape)/2))
1386+
return(sigma, (sigma_1*factor), (sigma_2*factor))
13941387

13951388

13961389
def diff_abs_intensity_complex_medium(m, x, thetas, ktd):

pymie/tests/test_mie_vectorized.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ def test_vectorized_angular_functions(self, num_wavelen,
647647
sigma = np.zeros(num_wavelen)
648648
sigma_1 = np.zeros_like(sigma)
649649
sigma_2 = np.zeros_like(sigma)
650-
dsigma_1 = np.zeros(expected_shape)
651-
dsigma_2 = np.zeros_like(dsigma_1)
652650

653651
m = np.atleast_1d(m)
654652
x = np.atleast_1d(x)
@@ -681,8 +679,6 @@ def test_vectorized_angular_functions(self, num_wavelen,
681679
sigma[i] = integral_loop[0].squeeze()
682680
sigma_1[i] = integral_loop[1].squeeze()
683681
sigma_2[i] = integral_loop[2].squeeze()
684-
dsigma_1[i] = integral_loop[3].squeeze()
685-
dsigma_2[i] = integral_loop[4].squeeze()
686682

687683
assert_equal(mat[0], S1)
688684
assert_equal(mat[1], S2)
@@ -698,8 +694,6 @@ def test_vectorized_angular_functions(self, num_wavelen,
698694
assert_equal(integral[0], sigma)
699695
assert_equal(integral[1], sigma_1)
700696
assert_equal(integral[2], sigma_2)
701-
assert_equal(integral[3], dsigma_1)
702-
assert_equal(integral[4], dsigma_2)
703697

704698

705699
class TestVectorizedUserFunctions():

0 commit comments

Comments
 (0)