Muon fit chord length fix#2803
Conversation
…itter. It now checks that no non-physical solutions are returned.
…on-physical solutions for chodr vs phi.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
| rho = 3 | ||
| phi = np.deg2rad(180) | ||
| length = chord_length(radius, rho, phi) | ||
| assert np.isclose(length, 0, atol=1e-15) |
There was a problem hiding this comment.
according to sonar, these two lines are not covered by tests:
if np.abs(phi) < np.arcsin(1.0 / rho):
chord = 2 * radius * np.sqrt(chord)Please check and ensure this is covered by proper tests.
There was a problem hiding this comment.
your test verifies the part when condition np.abs(phi) < np.arcsin(1.0 / rho) is not met, but looks like it doesn't check when it is met.
There was a problem hiding this comment.
Okay, values where rho is greater than 1 and phi is 0 can be included
There was a problem hiding this comment.
You have four cases in the function: no chord, a muon outside of the circle, and two cases for muon inside the circle. All of them have to be tested. Also, border cases (e.g. a hit straight in the center) and at the tangentially with φ=π/2 could be interesting to test. as well.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I'm not sure why the sonar coverage is ill-computed... @kosack @maxnoe any idea? Could it be a consequence of a transfer to the new sonar instance? @burmist-git I compiled the documentation and discovered that no sphinx doc is produced for the the module-level functions in the
Also I noticed the a couple of warnings like the following one, all in the Please fix them too. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@burmist-git sorry, I discussed with @mexanick offline and we agreed that the docs should stay and it's the correct workaround for an issue with numba: numba/numba#5755 Could you revert the last two commits? This will also fix the ci |
|
@maxnoe Sure, I can do that. The only remaining question is the directory of chord_length.rst. It was here: docs/api-reference/image/chord_length.rst, but it probably should be here: docs/api-reference/image/muon/chord_length.rst. |
There currently is no muon subdirectory in the documentation, everything is flat in image in files, so it's fine. Maybe call the file |
This comment has been minimized.
This comment has been minimized.
|
Ah, sorry, misread the commits. |
|
You need to change the entry in the toc in Edit: done now |
Fix toc name
burmist-git
left a comment
There was a problem hiding this comment.
change the name of the rts file
|
@maxnoe The only valid option for me was to review changes, could not apply them. |
Analysis Details0 IssuesCoverage and DuplicationsProject ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs |



Modified the chord_length function to fix a bug. It now filters out non-physical solutions for chodr vs phi.
Updated the test for chord_length calculation in the muon intensity fitter. It now checks that no non-physical solutions are returned (more details in here : issue #2760).