Skip to content

Commit

Permalink
Fix Wollam test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJMue committed Oct 1, 2024
1 parent 1fcae6d commit c95a417
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions tests/test_wollam.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
"""Tests for reading woollam"""

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

import elli


# pylint: disable=redefined-outer-name
def test_reading_of_psi_delta_woollam(datadir):
"""Psi/delta Spectraray file is read w/o errors"""
"""Psi/delta Wollam file is read w/o errors"""
data_wvase = elli.read_woollam_psi_delta(datadir / "wvase_example.dat")
data_cease = elli.read_woollam_psi_delta(datadir / "complete_ease_example.dat")

assert data_wvase.shape == (542, 2)
assert data_cease.shape == (3263, 2)
assert len(data_wvase) == 2
assert len(data_cease) == 2

assert len(data_wvase.Wavelength) == 181
assert len(data_cease.Wavelength) == 1088

np.testing.assert_array_equal(data_wvase["Angle of Incidence"], [65, 70, 75])
np.testing.assert_array_equal(data_cease["Angle of Incidence"], [50, 60, 70])


# pylint: disable=redefined-outer-name
def test_reading_and_conv_to_woollam(datadir):
"""Rho values are read from Psi / Delta file"""
"""Rho values are calculated from Psi / Delta file"""
data_wvase = elli.read_woollam_rho(datadir / "wvase_example.dat")
data_cease = elli.read_woollam_rho(datadir / "complete_ease_example.dat")

assert data_wvase.shape == (542,)
assert data_cease.shape == (3263,)
assert isinstance(data_wvase, xr.DataArray)
assert isinstance(data_cease, xr.DataArray)

assert len(data_wvase.Wavelength) == 181
assert len(data_cease.Wavelength) == 1088

np.testing.assert_array_equal(data_wvase["Angle of Incidence"], [65, 70, 75])
np.testing.assert_array_equal(data_cease["Angle of Incidence"], [50, 60, 70])


# pylint: disable=redefined-outer-name
Expand Down

0 comments on commit c95a417

Please sign in to comment.