diff --git a/src/elli/importer/accurion.py b/src/elli/importer/accurion.py index 87393b9..874fae1 100644 --- a/src/elli/importer/accurion.py +++ b/src/elli/importer/accurion.py @@ -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() diff --git a/tests/test_accurion.py b/tests/test_accurion.py index 8e10b96..0d7170d 100644 --- a/tests/test_accurion.py +++ b/tests/test_accurion.py @@ -1,5 +1,6 @@ """Tests for reading accurion files""" +import numpy as np import pytest from fixtures import datadir # pylint: disable=unused-import @@ -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])