Skip to content

Conversation

@tibaldo
Copy link
Member

@tibaldo tibaldo commented Oct 20, 2025

This PR combined several fixes and enhancements related to pedestal extraction and assessement in thermal tests data.

  • Fix a bug in PedestalNectarCAMCalibrationTool in the computation of the the pedestal RMS for a combined dataset when using slicing.
  • Enhance NectarCAMPedestalContainer, PedestalEstimationComponent, and PedestalNectarCAMCalibrationTool to systematically compute statistics for the pedestal charge (useful for performance assessment and monitoring).
  • Introduce user scripts to analyse the pedestal properties in thermal test-type data, both as a function of temperature and NSB intensities.
  • Fix a bug in an example script used in the documentation (plot_pedestal_output.py) due to evolutions in the naming conventions within nectarchain.

tibaldo and others added 20 commits October 2, 2025 16:50
Use online mean/variance algorithm for efficiency
…ry#213)

* Only fill charges container if waveforms are available

* Cleanup commented stuff from some previous PR

* Pin `persistent` (dependency for `ZODB`) version to fix CI

---------

Co-authored-by: Jean-Philippe Lenain <[email protected]>
# Conflicts:
#	src/nectarchain/makers/component/pedestal_component.py
…ry#213)

* Only fill charges container if waveforms are available

* Cleanup commented stuff from some previous PR

* Pin `persistent` (dependency for `ZODB`) version to fix CI

---------

Co-authored-by: Jean-Philippe Lenain <[email protected]>
# Conflicts:
#	src/nectarchain/makers/component/pedestal_component.py
…ry#213)

* Only fill charges container if waveforms are available

* Cleanup commented stuff from some previous PR

* Pin `persistent` (dependency for `ZODB`) version to fix CI

---------

Co-authored-by: Jean-Philippe Lenain <[email protected]>
# Conflicts:
#	src/nectarchain/makers/component/pedestal_component.py
@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 98.93617% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 51.68%. Comparing base (09b87e2) to head (4cdec61).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
.../nectarchain/makers/calibration/pedestal_makers.py 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #230      +/-   ##
==========================================
- Coverage   51.79%   51.68%   -0.11%     
==========================================
  Files          78       78              
  Lines        6505     6598      +93     
==========================================
+ Hits         3369     3410      +41     
- Misses       3136     3188      +52     

☔ 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 self-requested a review October 29, 2025 10:03
@jlenain jlenain added bug Something isn't working enhancement New feature or request labels Oct 29, 2025
Copy link
Collaborator

@jlenain jlenain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tibaldo !

Thanks a lot for this work !
This PR looks good to me. I just made a few, minor modifications after commenting some parts.

Do you intend to push further commits to this PR, or could we un-draft and merge it ?

One comment is pending, though, [EDIT]: and I also would like to push a final commit to fix the docs in CI.

else:
log.error("Unexpected shape for means array")

mean = np.sum(nevents_expanded * means, axis=0) / total_nevents_expanded
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tibaldo !

I was wondering whether this static method is really needed. To my understanding, numpy already offers the possibility to compute the mean and standard deviations when input with several arrays, see e.g. https://stackoverflow.com/a/18461943. I think the same should apply to numpy.std.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jlenain, thanks a lot for reviewing the PR and for the fixes you made in several places. I'm going to undraft it so that when we have solved this pending item it can be merged.
The method mean_std_multisample calculates the mean and standard deviation of a combined sample from the aggregated statistics (means and standard deviations) of multiple subsamples. To my knowledge numpy.mean and numpy.std always operate directly on raw data (it is the case in the stack overflow thread you linked if I understand it correctly) — they can’t combine aggregated statistics.
If you know a numpy function that calculates the mean and standard deviation of a combined sample from the aggregated statistics of multiple subsamples could you please point me to it?

@tibaldo tibaldo marked this pull request as ready for review October 29, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants