-
Notifications
You must be signed in to change notification settings - Fork 20
Addition of CalibrationWriterNectarCAM tool for writing Category A calibration files #207
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
Addition of CalibrationWriterNectarCAM tool for writing Category A calibration files #207
Conversation
…rom `lstcam_calib` with minor adaptations for `nectarchain`.
…edestal output files that use various groups to store data
…ctarCAM containers
…ib` example file)
…xel status with missing pixels (so a missing pixel = True for those that are added, i.e. due that were not included due to hardware failure)
|
Hi @pcorcam, thank you for doing this! I'm a bit confused about the pedestal subtraction. I think that for the NectarCAM we want a correction per sample and not averaged over all samples for each pixel? |
|
Hi @tibaldo! The reason why I averaged over the samples is because, in first instance, I wanted to create a Category-A calibration file à la |
Hi @pcorcam okay let's discuss it at the first occasion also with the Event builder experts. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
==========================================
- Coverage 52.25% 51.38% -0.87%
==========================================
Files 76 78 +2
Lines 6329 6475 +146
==========================================
+ Hits 3307 3327 +20
- Misses 3022 3148 +126 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Many thanks for this, @pcorcam ! |
|
I think we can wait a bit; that way, if there is an issue arising from the functional test, we can update it in this pull request. And there is no rush to add it anyways, since we will be developing other parts of the code first! |
|
Since the functional test documented at https://redmine.cta-observatory.org/issues/54306 seems successful, let's merge this PR ! Many thanks ! |
…libration files (cta-observatory#207) * Add script to obtain metadata of `ctapipe` and `nectarchain`. Taken from `lstcam_calib` with minor adaptations for `nectarchain`. * added group name as option to HDF5 readout, particularly useful for pedestal output files that use various groups to store data * first attempt for a Tool that writes a category A output file from NectarCAM containers * Add example script for the usage of the CalibrationWriterNectarCAM tool * ensure that filled arrays have the correct type (based on `lstcam_calib` example file) * do one-padding instead of zero-padding to expand arrays related to pixel status with missing pixels (so a missing pixel = True for those that are added, i.e. due that were not included due to hardware failure) * fixed hardware failing pixel status bug
First attempt at creating a Category A calibration file, inspired by
lstcam_calib.tools.create_calibration_file. For now, thisCalibrationWriterNectarCAMtool works as follows:.h5output files from aNectarCAMCalibrationTool, which contain results of pedestal, etc., in aNectarCAMPedestalContainer, etc.ctapipecontainers that are used to produce the Category A calibration file. In some cases, this requires some further computations. For example, innectarchain, theNectarCAMPedestalContainercontains the average pedestal per pixel per sample, while inctapipe, thePedestalContainerexpects the pedestal per pixel averaged over all samples..h5,.fits, or.fits.gzformats, as done inlstcam_calib.An usage example of this tool has been added to
user_scripts/pcorrea/example_create_catA_calibration_file.py.I chose this way of implementing this tool so I don't have to make any changes to the already existing
nectarchaintools at this stage. I also opted to not depend onlstcam_calibinnectarchainhere, sincelstcam_calibuses their customEventSourcein theirCalibrationWritertool, which also performs the actual computation of the calibration coefficients for a specific run.However, this version of the tool is a bit cumbersome since you just copy information from
NectarCAMContainersto standardctapipecontainers. Probably there is a better way to deal with this, but this makes more sense to implement after creating a pipeline that enchains all theNectarCAMCalibrationTools.