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

Change DL1 charge calibration in event to be a single, relative coefficient per channel / pixel #1397

Open
maxnoe opened this issue Jul 22, 2020 · 6 comments · May be fixed by #2433
Open

Change DL1 charge calibration in event to be a single, relative coefficient per channel / pixel #1397

maxnoe opened this issue Jul 22, 2020 · 6 comments · May be fixed by #2433

Comments

@maxnoe
Copy link
Member

maxnoe commented Jul 22, 2020

The documentation of these factors makes no mention that in fact, that the absolute_factor is used not as factor but as divisor.

they are applied as :

charge *= relative / absolute

But the documentation of these values never mentions that and I think the naming is very confusing.

Also, why do we have these two factors in the same step? Why are these different calibration constants?

@watsonjj
Copy link
Contributor

So this came from the equation I believe is used in HESS, but with the naming changed:
relative = flat field (camera average divided by pixel value, when illuminated with uniform light source)
absolute = gain (mV per p.e.)
The naming was changed in an attempt to make this more explicit, but I agree I wasn't very successful...

@watsonjj
Copy link
Contributor

I believe they are kept in separate values as they are updated on different timescales

@maxnoe
Copy link
Member Author

maxnoe commented Oct 26, 2020

After implementing #1463 and discussing with @watsonjj, we had the following idea for a simplification:

The DL1CameraCalibrationContainer has just one field for this amplitude correction factor, e.g. flatfielding.

This would contain the total necesseray corrections for an individual event, which would make the code in CameraCalibrator simple (just charge *= flatfielding) and avoid these confusingly named and differently applied relative / absolute factor / divisor.

The complexity would then be shifted where it actually belongs: filling the correct value for an event from different monitoring data.

Application is simple, calculating the correct calibration value is hard. So the complexity should be where it is conceptually.

@maxnoe
Copy link
Member Author

maxnoe commented Oct 23, 2023

Since in the CTAO data model, R1 data will already contain the absolute calibration and we will only need to apply a relative update computed from interleaved calibration events, we should really implement the above conclusion.

@maxnoe maxnoe changed the title DL1 calibration's relative_factor / absolute_factor are confusingly named, documented and applied Change DL1 charge calibration in event to be a single, relative coefficient per channel / pixel Oct 23, 2023
@StFroese StFroese self-assigned this Oct 27, 2023
@kosack
Copy link
Contributor

kosack commented Aug 19, 2024

Since in the CTAO data model, R1 data will already contain the absolute calibration and we will only need to apply a relative update computed from interleaved calibration events, we should really implement the above conclusion.

Note that this is not 100% correct: in R1 calibration there will be a rough DC/PE factor applied, but it doesn't mean we will not correct that factor in the offline analysis with better calibration information.

The main reason these are separated is that they are really different things: one is a conversion factor from DC to PE, so the units are important there. It uses no inter-pixel information, only the position of the single-PE peak in the charge distribution. The flatfielding factor is something else: it corrects for residual differences between pixels, just to make doing things like Hillas parameterization easier (at the expense of losing some information about the pixel's gain factor). It should be a numer very close to 1.0 if the pixels are well-matched in the camera. However, there are reconstruction techniques that use only the PE/DC factor and need to know its value (e.g. Model++), and need to be able to "un-correct" the flatfielding.

So I would disagree with this issue partially (I agree the naming and one being multiplicative and the other a divisor is bad):
We need to know both factors separately, and for data quality, we also want to track how both change.

@StFroese StFroese removed their assignment Aug 19, 2024
@maxnoe
Copy link
Member Author

maxnoe commented Sep 3, 2024

So I would disagree with this issue partially (I agree the naming and one being multiplicative and the other a divisor is bad):

Similar comment to my comment in the PR: this issue is about changing the field in the event data structure, not the monitoring data.

I think it is good to move the complexity of combining the different monitored quantities like gain and other relative pixel differences to the monitoring code that computes the correction for the current event and only have the result of that computation in the event data structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants