Skip to content

Commit

Permalink
adapt accurion importer
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJMue committed Oct 8, 2024
1 parent 55b1f19 commit b2a0b9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/elli/importer/accurion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ def read_accurion_psi_delta(fname: str) -> pd.DataFrame:
psi_delta_df = psi_delta_df.reindex(columns=list(["AOI", "Lambda", "Delta", "Psi"]))
psi_delta_df = psi_delta_df.rename(
columns={
"AOI": "Angle of Incidence",
"AOI": "Angle_of_Incidence",
"Lambda": "Wavelength",
"Delta": "Δ",
"Psi": "Ψ",
}
)
psi_delta_df = psi_delta_df.groupby(["Angle of Incidence", "Wavelength"]).sum()
psi_delta_df = psi_delta_df.groupby(["Angle_of_Incidence", "Wavelength"]).sum()

# wrap delta range
psi_delta_df.loc[:, "Δ"] = psi_delta_df.loc[:, "Δ"].where(
psi_delta_df.loc[:, "Δ"] <= 180, psi_delta_df.loc[:, "Δ"] - 360
)

return psi_delta_df
return psi_delta_df.to_xarray()
4 changes: 3 additions & 1 deletion tests/test_accurion.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for reading accurion files"""

import numpy as np
import pytest
from fixtures import datadir # pylint: disable=unused-import

Expand All @@ -13,4 +14,5 @@ def test_reading_of_psi_delta_woollam(datadir):
datadir / "Si3N4_on_4inBF33_W02_20240903-150451.ds.dat"
)

assert data.shape == (114, 2)
assert len(data.Wavelength) == 57
np.testing.assert_array_equal(data.Angle_of_Incidence, [40, 50])

0 comments on commit b2a0b9f

Please sign in to comment.