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

Upgrade nectarchain to ctapipe 0.19 #68

Merged
merged 19 commits into from
Jul 12, 2023

Conversation

jlenain
Copy link
Collaborator

@jlenain jlenain commented Jun 16, 2023

This PR, work in progress, is meant to upgrade nectarchain to ctapipe v0.19, for all code components.

@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (c67c57f) 0.38% compared to head (f9314c1) 0.38%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #68      +/-   ##
=========================================
- Coverage    0.38%   0.38%   -0.01%     
=========================================
  Files          30      30              
  Lines        3350    3404      +54     
=========================================
  Hits           13      13              
- Misses       3337    3391      +54     
Impacted Files Coverage Δ
...ain/calibration/NectarGain/SPEfit/NectarGainSPE.py 0.00% <0.00%> (ø)
...ation/NectarGain/SPEfit/NectarGainSPE_singlerun.py 0.00% <0.00%> (ø)
src/nectarchain/calibration/container/charge.py 0.00% <0.00%> (ø)
src/nectarchain/calibration/container/utils.py 0.00% <0.00%> (ø)
src/nectarchain/calibration/container/waveforms.py 0.00% <0.00%> (ø)
src/nectarchain/dqm/charge_integration.py 0.00% <0.00%> (ø)
src/nectarchain/dqm/mean_camera_display.py 0.00% <0.00%> (ø)
src/nectarchain/dqm/start_calib.py 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jlenain jlenain mentioned this pull request Jun 16, 2023
(Next commit should ake care of flagged bad pixels and how to deal with them)
(Fixing bad pixel handling hsould come next)
@guillaumegrolleron
Copy link
Contributor

I detected some issues with the astropy upgrade (the version needed by ctapipe has changed). Please do not merge until I solved this problem !

@jlenain
Copy link
Collaborator Author

jlenain commented Jun 20, 2023

I detected some issues with the astropy upgrade (the version needed by ctapipe has changed). Please do not merge until I solved this problem !

Hi @guillaumegrolleron , no problem. What kind of issues did you spot? Indeed, we are moving from astropy v4 to v5.

@jlenain jlenain added the enhancement New feature or request label Jun 20, 2023
@jlenain jlenain marked this pull request as draft June 20, 2023 10:06
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jlenain jlenain linked an issue Jun 20, 2023 that may be closed by this pull request
@jlenain
Copy link
Collaborator Author

jlenain commented Jun 29, 2023

Hi @hashkar ,
I am testing several aspects for what concerns this upgrade.
I don't know whether this is related to the upgrade to ctapipe v0.19.1, but for the DQM, on recent runs (e.g. 4415, 4414 or 4410), I got the following error:

Traceback (most recent call last):
  File "/opt/cta/nectarchain/src/nectarchain/dqm/start_calib.py", line 181, in <module>
    Chan, Samp = p.DefineForRun(reader1)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/cta/nectarchain/src/nectarchain/dqm/dqm_summary_processor.py", line 41, in DefineForRun
    self.Samp = len(evt1.r0.tel[0].waveform[0][0])
                    ~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

right when grabbing the run configuration through DefineForRun. Do you have an idea about what is going on ?

@sizun
Copy link
Contributor

sizun commented Jun 30, 2023

The fact that these runs were taken with gain selection might be a factor.

@tibaldo
Copy link
Member

tibaldo commented Jun 30, 2023

Indeed, the r0 container is not filled for gain-selected runs, that's why r0 is a 'NoneType' object. To read gain-selected files you should disable the r0->r1 corrections and then read the raw data in the r1 container.

@jlenain
Copy link
Collaborator Author

jlenain commented Jun 30, 2023

OK, thanks @sizun , @tibaldo !
@hashkar , this linked to #64 , could you please implement cta-observatory/ctapipe_io_nectarcam#34 (comment) in the DQM, then ?
Many thanks!

@guillaumegrolleron
Copy link
Contributor

guillaumegrolleron commented Jul 5, 2023

I detected some issues with the astropy upgrade (the version needed by ctapipe has changed). Please do not merge until I solved this problem !

Finally I solved this problem very easily. I have computed again the charge and it appears that the parameters estimators for the fit initialization didn't work. I fixed this problem and the SPE fit works well now.

@jlenain
Copy link
Collaborator Author

jlenain commented Jul 5, 2023

I detected some issues with the astropy upgrade (the version needed by ctapipe has changed). Please do not merge until I solved this problem !

Finally I solved this problem very easily. I have computed again the charge and it appears that the parameters estimators for the fit initialization didn't work. I fixed this problem and the SPE fit works well now.

Hi @guillaumegrolleron ,
Thanks a lot!
Do you need to push a commit, or was it just a matter of re-generating the pre-processed charge inputs?

@guillaumegrolleron
Copy link
Contributor

Hi @jlenain,
I have to push some commits, I will do on tomorrow

Jean-Philippe Lenain added 2 commits July 6, 2023 12:15
@jlenain jlenain marked this pull request as ready for review July 11, 2023 10:46
Copy link
Member

@tibaldo tibaldo left a comment

Choose a reason for hiding this comment

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

There are several entirely new files and many modifications for which to me it's hard to see the relationship with the upgrade to ctapipe 0.19. It's hard to review the code for me since I miss the context. If other changes/enhancements were added along with the modifications for the upgrade of ctapipe it would be useful to provide the relevant information in the PR for future documentation.

src/nectarchain/user_scripts/vmarandon/CalibrationData.py Outdated Show resolved Hide resolved
src/nectarchain/user_scripts/vmarandon/ShowDataContent.py Outdated Show resolved Hide resolved
src/nectarchain/user_scripts/vmarandon/Utils.py Outdated Show resolved Hide resolved
@jlenain
Copy link
Collaborator Author

jlenain commented Jul 11, 2023

There are several entirely new files and many modifications for which to me it's hard to see the relationship with the upgrade to ctapipe 0.19. It's hard to review the code for me since I miss the context. If other changes/enhancements were added along with the modifications for the upgrade of ctapipe it would be useful to provide the relevant information in the PR for future documentation.

Hum, it seems the last commits by @guillaumegrolleron merged modifications coming from other PR (such as e.g. #70 ). @guillaumegrolleron , would it be possible to undo/clean the commit history of your last contribution, please ?

-update SPE fit parameters initialization
following updates of the ctapipe extractors
-improve the limits of generated charge histogram plots
@guillaumegrolleron
Copy link
Contributor

Hi all,
The commit history has been cleaned, but @jlenain please let me know if there is still any trouble.

@jlenain
Copy link
Collaborator Author

jlenain commented Jul 12, 2023

Hi all, The commit history has been cleaned, but @jlenain please let me know if there is still any trouble.

Hi @guillaumegrolleron , thanks a lot for that! This is all fine now.

Copy link
Member

@tibaldo tibaldo left a comment

Choose a reason for hiding this comment

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

There are still a few changes in the DQM part for which I'm not sure I understand the relationship with the upgrade to ctapipe 0.19

src/nectarchain/dqm/charge_integration.py Outdated Show resolved Hide resolved
src/nectarchain/dqm/mean_camera_display.py Outdated Show resolved Hide resolved
@jlenain
Copy link
Collaborator Author

jlenain commented Jul 12, 2023

Thanks a lot for the review, @tibaldo !

@jlenain jlenain merged commit cdded69 into cta-observatory:master Jul 12, 2023
5 of 8 checks passed
@jlenain jlenain deleted the ctapipe0.19 branch July 12, 2023 14:25
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.

Move to latest ctapipe for dependency (ctapipe-0.19)
5 participants