Skip to content

Commit

Permalink
fuction renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
mlietzow committed Sep 9, 2024
1 parent 6e92a4e commit 3fe0d73
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The scattering amplitude functions are an array with size `2*nang-1`.
To calculate the scattering matrix elements, use

```python
scat_mat = miex.get_scattering_matrix_elements(S1, S2)
scat_mat = miex.get_scattering_matrix(S1, S2)
```

where $S_1$ and $S_2$​ are the scattering amplitude functions.
Expand Down
2 changes: 1 addition & 1 deletion miex/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .miex import get_mie_coefficients, get_scattering_matrix_elements
from .miex import get_mie_coefficients, get_scattering_matrix
2 changes: 1 addition & 1 deletion miex/miex.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def get_mie_coefficients(x, ri, nang=2, doSA=False, nterm=2e7, eps=1.0e-20, xmin
return results


def get_scattering_matrix_elements(SA_1, SA_2):
def get_scattering_matrix(SA_1, SA_2):
"""Calculations of the scattering matrix elements
Parameters
Expand Down
2 changes: 1 addition & 1 deletion miex_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def bruggeman_mix(x):

g_sca[ilam] += miex_res["g_sca"] * wqscx

scat_mat = miex.get_scattering_matrix_elements(miex_res["SA_1"], miex_res["SA_2"])
scat_mat = miex.get_scattering_matrix(miex_res["SA_1"], miex_res["SA_2"])

S11[:, ilam] += scat_mat["S_11"] * weight
S12[:, ilam] += scat_mat["S_12"] * weight
Expand Down
12 changes: 6 additions & 6 deletions miex_notebook_1.ipynb

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions test_miex.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_bh(self):
self.assertAlmostEqual(result["Q_sca"], 3.10543, msg="incorrect Q_sca", delta=0.00001)
self.assertAlmostEqual(result["Q_bk"], 2.92534, msg="incorrect Q_bk", delta=0.00001)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = -scat_mat["S_12"] / S_11
S_33 = scat_mat["S_33"] / S_11
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_w_1(self):
result["g_sca"], 0.742913, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_w_2(self):
result["g_sca"], 0.818246, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -391,7 +391,7 @@ def test_w_3(self):
result["g_sca"], 0.827882, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -505,7 +505,7 @@ def test_w_4(self):
result["g_sca"], 0.829592, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -619,7 +619,7 @@ def test_w_5(self):
result["g_sca"], 0.922350, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -733,7 +733,7 @@ def test_w_6(self):
result["g_sca"], 0.950392, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -847,7 +847,7 @@ def test_w_7(self):
result["g_sca"], 0.950880, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down Expand Up @@ -961,7 +961,7 @@ def test_w_8(self):
result["g_sca"], 0.950650, msg="incorrect g_sca", delta=0.000001
)

scat_mat = miex.get_scattering_matrix_elements(result["SA_1"], result["SA_2"])
scat_mat = miex.get_scattering_matrix(result["SA_1"], result["SA_2"])
S_11 = scat_mat["S_11"]
S_12 = scat_mat["S_12"]
S_12 /= S_11
Expand Down

0 comments on commit 3fe0d73

Please sign in to comment.