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 22 commits
3d879b9
c2ce42c
c8f7ef0
bef9677
cd4864f
fb3a9a4
0f0b948
50f2791
90115d6
f772b19
e201356
907b6cd
dc3b24c
3c7e6ab
cad523e
4a032ed
7ae62e2
2997b6c
a6be0ae
8498274
a915d8d
3423bd3
496af8f
3b93770
da86bf6
50b9e84
c11b6f2
b02b526
16aa176
e0c0004
1644388
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Same here: the only change for
PointingInterpolator
should be the base classThere 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.
required columns as start and stop time shall be the class attributes and shall be frozen, they are mandatory. You can copy them to an instance and extend with a value column(s) when you engage a
__call__
.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.
as the functions that use required_columns are in the parent class and always look to that name it makes more sense to have it as a modifiable instance variable
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.
No. The original design idea was to have the required_columns frozen per "final" class. I.e.
MonitoringInterpolator
requiresaltitude
andazimuth
columns.This is due to the configuration system in ctapipe, which works on class name basis, not instances.
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, the most sensible way to keep the required units and columns as class variables is to have pedestal and flatfield interpolators that inherit from the ChunkInterpolator. The ChunkInterpolator now has no required columns or units, but rather the subclasses have those variables. If we use the FlatFieldInterpolator we know we will always look for a column with relative gain factors with no unit, similarly we know what data a PedestalInterpolator will need.
I made those classes, and if we want to use the Chunk interpolation later for some other data we can add another subclass.
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.
Why are these instance variables? And why are they empty?
This is not in line with how the other class works.
It seems this class variable is unused even.
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.
Here
required_columns
shall become class attributes, but the interpolators and expected units shall remain instance variable, to allow creation of multiple instances. We have to see in the future PR, whether we want further specialization (e.g. a factory ofVarNameInterpolator
s), that may lead to change this (they will basically become singletons).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.
expected units are unused because the quantity is dimensionless, we may want to actually enforce this through
u.dimensioneless_unscaled
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.
We had implemented that for collumns that are supposed to not have a unit we set the expected unit to None and check if the actual unit is equivalent. I put it like that.
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.
Why use
self._interpolators
, why keep that around at all?Why not just call
self._interpolate_chunk(tel_id, column, mjd)
?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.
read_table
checks if_interpolators
has already been set up for the given tel_id._check_interpolators
inMonitoringInterpolator
also does that check and adds data from hdf5file if the interpolator is not set. I can move column to be an argument of_interpolate_chunk
though.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.
Why store
start_time
andend_time
per column?