Skip to content

Conversation

@jlenain
Copy link
Collaborator

@jlenain jlenain commented Oct 2, 2025

This PR aims at adding support of multiple NectarCAM cameras within nectarchain.

At the moment, support for the submission of DIRAC DQM jobs, the DQM itself, and parsing the DQM results have been implemented.

Support in core classes is currently missing, as well as in the DQM Bokeh website.

[EDIT] Support in core classes is now included.

@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 49.47368% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.83%. Comparing base (09b87e2) to head (ad870b9).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/nectarchain/makers/core.py 50.00% 8 Missing ⚠️
src/nectarchain/dqm/charge_integration.py 14.28% 6 Missing ⚠️
src/nectarchain/dqm/mean_camera_display.py 14.28% 6 Missing ⚠️
src/nectarchain/dqm/pixel_participation.py 20.00% 4 Missing ⚠️
src/nectarchain/data/management.py 40.00% 3 Missing ⚠️
src/nectarchain/dqm/camera_monitoring.py 25.00% 3 Missing ⚠️
src/nectarchain/dqm/mean_waveforms.py 25.00% 3 Missing ⚠️
src/nectarchain/dqm/pixel_timeline.py 25.00% 3 Missing ⚠️
src/nectarchain/dqm/start_dqm.py 0.00% 3 Missing ⚠️
src/nectarchain/makers/component/core.py 85.00% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
+ Coverage   51.79%   51.83%   +0.04%     
==========================================
  Files          78       79       +1     
  Lines        6505     6542      +37     
==========================================
+ Hits         3369     3391      +22     
- Misses       3136     3151      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jlenain jlenain marked this pull request as ready for review October 2, 2025 14:03
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 3, 2025

Support in core classes has been implemented by @guillaumegrolleron , thanks a lot !

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 3, 2025

Hi !

Anyone willing to review this PR, please ?

@jlenain jlenain marked this pull request as draft October 3, 2025 14:10
@jlenain jlenain linked an issue Oct 3, 2025 that may be closed by this pull request
@jlenain
Copy link
Collaborator Author

jlenain commented Oct 6, 2025

Hi @guillaumegrolleron !

I have a small issue with this PR: in data.management.DataManagement.findrun, I wanted to add the possibility to request for which camera (QM, NectarCAM-2, NectarCAM-3, ...) a run should be fetched. Indeed, the same run number could correspond to different data, since each camera has its proper run number. So far, so good: https://github.com/cta-observatory/nectarchain/pull/218/files#diff-1808a3bbae11ffe2370dacb57610b8b31ad793e8c1e8a8746a0dc64e79df2ddaR34-R71

However, findrun is used in makers.core.load_run, which itself is used e.g. in makers.calibration.gain.photostat_makers._load_eventsource.

What would be the best way to pass the camera we would want to use throughout the code ? By e.g. passing a camera option to our tools ?

Many thanks !

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 6, 2025

Hi @guillaumegrolleron !

I have a small issue with this PR: in data.management.DataManagement.findrun, I wanted to add the possibility to request for which camera (QM, NectarCAM-2, NectarCAM-3, ...) a run should be fetched. Indeed, the same run number could correspond to different data, since each camera has its proper run number. So far, so good: https://github.com/cta-observatory/nectarchain/pull/218/files#diff-1808a3bbae11ffe2370dacb57610b8b31ad793e8c1e8a8746a0dc64e79df2ddaR34-R71

However, findrun is used in makers.core.load_run, which itself is used e.g. in makers.calibration.gain.photostat_makers._load_eventsource.

What would be the best way to pass the camera we would want to use throughout the code ? By e.g. passing a camera option to our tools ?

Many thanks !

Hi @guillaumegrolleron !

At the moment, I think the easiest would be to add a camera field to the class EventsLoopNectarCAMCalibrationTool. Commit coming.

However, I have an issue currently when doing that with:

Traceback (most recent call last):
  File "/home/jlenain/local/src/python/cta-observatory/nectarchain/src/nectarchain/user_scripts/ggrolleron/load_wfs_compute_charge.py", line 171, in main
    tool = ChargesNectarCAMCalibrationTool(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: nectarchain.makers.charges_makers.ChargesNectarCAMCalibrationTool() got multiple values for keyword argument 'camera'

Would you be able to help here please ?
EDIT: Fixed.

@guillaumegrolleron
Copy link
Contributor

Hi @jlenain
I also think the easiest way is to add a camera field, I quickly checked your changes and it looks good! Thanks!

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 6, 2025

Hi @jlenain I also think the easiest way is to add a camera field, I quickly checked your changes and it looks good! Thanks!

Thanks a lot, @guillaumegrolleron !
Still one thing I am not happy about: the propagation of the camera is not yet done properly. For instance:

python load_wfs_compute_charge.py --camera="NectarCAM2" -r 133 --max_events 100  --method GlobalPeakWindowSum --extractor_kwargs '{"window_width":16,"window_shift":4}' --overwrite 

still fetch data from the QM:

[...]
2025-10-06 10:34:39,362 INFO [nectarchain.data.management] (management.findrun): will search files on GRID and fetch them
/vo.cta.in2p3.fr/nectarcam/2016/20160706/NectarCAM.Run0133.fits.fz
/vo.cta.in2p3.fr/nectarcam/2016/20160706/Run0133.fits.fz
2025-10-06 10:34:41 UTC Framework/GFAL2_SRM2Storage/GFAL2_StorageBase._getSingleFile INFO: Trying to download srm://ccsrm02.in2p3.fr:8443/srm/managerv2?SFN=/pnfs/in2p3.fr/data/vo.cta.in2p3.fr/nectarcam/2016/20160706/NectarCAM.Run0133.fits.fz to /data/users/jlenain/tmp/runs/NectarCAM.Run0133.fits.fz
2025-10-06 10:34:42 UTC Framework/GFAL2_SRM2Storage/GFAL2_StorageBase._getSingleFile INFO: Trying to download srm://ccsrm02.in2p3.fr:8443/srm/managerv2?SFN=/pnfs/in2p3.fr/data/vo.cta.in2p3.fr/nectarcam/2016/20160706/Run0133.fits.fz to /data/users/jlenain/tmp/runs/Run0133.fits.fz
[...]

Something is still fishy, I am investigating...

@guillaumegrolleron
Copy link
Contributor

Hi @jlenain I also think the easiest way is to add a camera field, I quickly checked your changes and it looks good! Thanks!

Thanks a lot, @guillaumegrolleron ! Still one thing I am not happy about: the propagation of the camera is not yet done properly. For instance:

python load_wfs_compute_charge.py --camera="NectarCAM2" -r 133 --max_events 100  --method GlobalPeakWindowSum --extractor_kwargs '{"window_width":16,"window_shift":4}' --overwrite 

still fetch data from the QM:

[...]
2025-10-06 10:34:39,362 INFO [nectarchain.data.management] (management.findrun): will search files on GRID and fetch them
/vo.cta.in2p3.fr/nectarcam/2016/20160706/NectarCAM.Run0133.fits.fz
/vo.cta.in2p3.fr/nectarcam/2016/20160706/Run0133.fits.fz
2025-10-06 10:34:41 UTC Framework/GFAL2_SRM2Storage/GFAL2_StorageBase._getSingleFile INFO: Trying to download srm://ccsrm02.in2p3.fr:8443/srm/managerv2?SFN=/pnfs/in2p3.fr/data/vo.cta.in2p3.fr/nectarcam/2016/20160706/NectarCAM.Run0133.fits.fz to /data/users/jlenain/tmp/runs/NectarCAM.Run0133.fits.fz
2025-10-06 10:34:42 UTC Framework/GFAL2_SRM2Storage/GFAL2_StorageBase._getSingleFile INFO: Trying to download srm://ccsrm02.in2p3.fr:8443/srm/managerv2?SFN=/pnfs/in2p3.fr/data/vo.cta.in2p3.fr/nectarcam/2016/20160706/Run0133.fits.fz to /data/users/jlenain/tmp/runs/Run0133.fits.fz
[...]

Something is still fishy, I am investigating...

I guess the problem comes from the propagation of the self.camera argument here

self.event_source = self.enter_context(

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 6, 2025

I guess the problem comes from the propagation of the self.camera argument here

self.event_source = self.enter_context(

Argh, good catch, many thanks ! That does the trick !

@jlenain
Copy link
Collaborator Author

jlenain commented Oct 10, 2025

It may be easier to me to have the relevant changes for the bokeh app in another PR. Marking this PR as ready for review.

@jlenain jlenain marked this pull request as ready for review October 10, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DQM should be able to handle several NectarCAM cameras Manage data for multiple cameras

3 participants