Skip to content

Commit

Permalink
reverting some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Toennis committed Nov 22, 2024
1 parent dc3b24c commit 3c7e6ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions src/ctapipe/monitoring/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,19 @@ def add_table(self, tel_id: int, input_table: Table, columns: list[str]) -> None
)

def _interpolate_chunk(self, tel_id, column, mjd: float) -> float:
"""
Interpolates overlapping chunks of data preferring earlier chunks if valid
Parameters
----------
tel_id : int
tel_id for which data is to be interpolated
column : str
name of the column for which data is to be interpolated
mjd : float
Time for which to interpolate the data.
"""

start_time = self.start_time[tel_id][column]
end_time = self.end_time[tel_id][column]
values = self.values[tel_id][column]
Expand Down
10 changes: 5 additions & 5 deletions src/ctapipe/monitoring/tests/test_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_invalid_input():
wrong_unit = Table(
{
"time": Time(1.7e9 + np.arange(3), format="unix"),
"azimuth": np.radians([1, 2, 3]) * u.rad,
"azimuth": [1, 2, 3] * u.deg,
"altitude": [1, 2, 3],
}
)
Expand All @@ -188,8 +188,8 @@ def test_hdf5(tmp_path):
table = Table(
{
"time": t0 + np.arange(0.0, 10.1, 2.0) * u.s,
"azimuth": np.radians(np.linspace(0.0, 10.0, 6)) * u.rad,
"altitude": np.radians(np.linspace(70.0, 60.0, 6)) * u.rad,
"azimuth": np.linspace(0.0, 10.0, 6) * u.deg,
"altitude": np.linspace(70.0, 60.0, 6) * u.deg,
},
)

Expand All @@ -198,8 +198,8 @@ def test_hdf5(tmp_path):
with tables.open_file(path) as h5file:
interpolator = PointingInterpolator(h5file)
alt, az = interpolator(tel_id=1, time=t0 + 1 * u.s)
assert u.isclose(alt, np.radians(69) * u.rad)
assert u.isclose(az, np.radians(1) * u.rad)
assert u.isclose(alt, 69 * u.deg)
assert u.isclose(az, 1 * u.deg)


def test_bounds():
Expand Down

0 comments on commit 3c7e6ab

Please sign in to comment.