Skip to content

Commit

Permalink
Adds fix for wvase import when dpolE is present
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Aug 10, 2023
1 parent 6fa20e8 commit eb38832
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/elli/importer/woollam.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def scale_to_nm(unit: str, dataframe: pd.DataFrame) -> pd.DataFrame:
try:
scaling = ureg(unit).to("nm").magnitude
dataframe.index = dataframe.index.set_levels(
dataframe.index.levels[1] * scaling, level=1
dataframe.index.levels[1].astype(float) * scaling, level=1
)

return dataframe
Expand Down Expand Up @@ -107,10 +107,13 @@ def _read_wvase_dataframe(file_object: TextIO) -> pd.DataFrame:
file_object,
sep="\t",
header=None,
names=["Ψ", "Δ", "Ψ_err", "Δ_err"],
index_col=(1, 0),
names=["Wavelength", "Angle of Incidence", "Ψ", "Δ", "Ψ_err", "Δ_err"],
)
dframe = (
dframe[dframe.iloc[:, 0] != "dpolE"]
.set_index(["Wavelength", "Angle of Incidence"])
.swaplevel(0, 1)
)
dframe.index.names = ("Angle of Incidence", "Wavelength")
return dframe


Expand Down

0 comments on commit eb38832

Please sign in to comment.