Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
base: main
Are you sure you want to change the base?
Chunk interpolation to select calibration data #2634
Changes from 8 commits
3d879b9
c2ce42c
c8f7ef0
bef9677
cd4864f
fb3a9a4
0f0b948
50f2791
90115d6
f772b19
e201356
907b6cd
dc3b24c
3c7e6ab
cad523e
4a032ed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check failure on line 234 in src/ctapipe/monitoring/interpolation.py
CTAO-DPPS-SonarQube / ctapipe Sonarqube Results
src/ctapipe/monitoring/interpolation.py#L234
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a bit weird here to store closures in a dict instead of just calling a method with
tel_id
andcolumn
that then checks if the necessary table exists.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll change it to a method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation follows the PointingInterpolator approach, but of course can be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so,
_check_interpolators
in the parent class assumes the current implementation. If i change it to what you describe i will need to make changes to the parent class or forgo this check for theChunkInterpolator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keeping it like this is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good, the
__call__
method is missing on the interface thoughI am not sure if putting the private methods you listed here to the base class will work out in the end, but you'll see how much code can be shared between the chunk interpolator and the linear interpolator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll work on the implementation now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we take an opportunity and stop using
interp1d
? It is legacy, andscipy
suggests this: https://docs.scipy.org/doc/scipy/tutorial/interpolate/1D.html#tutorial-interpolate-1dsectionAlso, if we call a base class LinearInterpolator, I guess we should enforce linearity (in the example above, e.g. cubic spline can be applied)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no replacement for linear 1d interpolation for interp1d. It is legacy, but not deprecated.
See scipy/scipy#21258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also got tricked by "may be removed in the future"