Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunk interpolation to select calibration data #2634

Merged
merged 31 commits into from
Feb 11, 2025
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ed3c86b
Adding the chunk function
Oct 29, 2024
15efaeb
Reverting to the previous implementation
Oct 29, 2024
050f404
Changing some variables
Oct 29, 2024
11ef1e2
Chaning to using scipy functions
Oct 30, 2024
7c08829
fixing docustring
Oct 30, 2024
c674bcc
Updating docustrings further
Oct 30, 2024
7bd017d
simplifying chunk interpolation
Oct 31, 2024
7504c20
Refactor ChunkInterpolator and its tests
mexanick Oct 31, 2024
9766719
adding changelog
Oct 31, 2024
f22a0c0
renaming changelog
Oct 31, 2024
366a3f3
Changing inheritance scheme
Nov 22, 2024
386faa8
reverting some tests
Nov 22, 2024
e5e2fde
documentation change
Nov 22, 2024
33377e5
fixing issue with class variable
Nov 25, 2024
e735ec1
implementing reviewer comment
Nov 27, 2024
8a0c213
moving some instance variales to class variables
Dec 2, 2024
3bad626
removing unnecessary class variables in parent classes
Dec 3, 2024
eaf34e2
moving ChunkInterpolator variables and making them mutable at first
Dec 4, 2024
53ec341
removing provate data definition from parent class
Dec 4, 2024
e7aa23d
moving a variable
Dec 4, 2024
c3da3d8
putting required units on ChunkInterpolator
Dec 4, 2024
3c1f685
implementing reviewer comment
Dec 4, 2024
c2530e4
making required_columns an instance variable
Dec 9, 2024
9a899df
making subclasses to ChunkInterpolator
Dec 9, 2024
0da6c5f
simplifying start_time and end_time
Dec 9, 2024
cd35c8e
adding data groups
Dec 10, 2024
4725326
adding child classes, making chunk function take arrays
Dec 12, 2024
7ac13d9
making the nan switch test check if the switch is done element-wise
Dec 12, 2024
3b8b4a0
adding imports to __init__
Dec 13, 2024
56afd67
Simplify logic in ChunkInterpolator
mexanick Jan 28, 2025
a3cdcb9
Removing unsed attribute `self._interpolators` from CunkInterpolator
mexanick Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
making required_columns an instance variable
  • Loading branch information
Christoph Toennis authored and mexanick committed Jan 28, 2025
commit c2530e49aca9ef191073d9d2b017f050b6c436fb
9 changes: 3 additions & 6 deletions src/ctapipe/monitoring/interpolation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from abc import ABCMeta, abstractmethod
from copy import deepcopy
from functools import partial
from typing import Any

Expand Down Expand Up @@ -223,10 +222,9 @@ class ChunkInterpolator(MonitoringInterpolator):
Simple interpolator for overlapping chunks of data.
"""

required_columns = frozenset(["start_time", "end_time"])

def __init__(self, h5file: None | tables.File = None, **kwargs: Any) -> None:
super().__init__(**kwargs)
self.required_columns = set(["start_time", "end_time"])
self._interpolators = {}
self.expected_units = {}
self.start_time = {}
Expand Down Expand Up @@ -289,9 +287,8 @@ def add_table(self, tel_id: int, input_table: Table, columns: list[str]) -> None
Names of the columns to interpolate.
"""

required_columns = set(deepcopy(self.required_columns))
required_columns.update(columns)
self.required_columns = frozenset(required_columns)
self.required_columns.update(columns)
self.required_columns = set(self.required_columns)
for col in columns:
self.expected_units[col] = None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here i set the unit of the new columns to None, which is then in the next line enforced by _check_tables. This way we ensure the values have no unit.

self._check_tables(input_table)
Expand Down