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

Fix hillas width 0, fixes #772 #1240

Merged
merged 6 commits into from
Mar 23, 2020
Merged

Fix hillas width 0, fixes #772 #1240

merged 6 commits into from
Mar 23, 2020

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Mar 20, 2020

By rounding values very close to zero to exact zero, nan values are avoided.

These happend due to floating point imprecisions resulting in covariances like -8.47032947e-22,
and then sqrt returns nan.

@maxnoe
Copy link
Member Author

maxnoe commented Mar 20, 2020

Ah, dam. It only build the second commit on travis. I wanted to show that the first one fails and the fix makes it pass.

@maxnoe maxnoe requested review from kosack, thomasgas and vuillaut March 20, 2020 13:18
@maxnoe
Copy link
Member Author

maxnoe commented Mar 20, 2020

Fixes #772

kosack
kosack previously approved these changes Mar 20, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #1240 into master will increase coverage by 0.10%.
The diff coverage is 98.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1240      +/-   ##
==========================================
+ Coverage   86.47%   86.57%   +0.10%     
==========================================
  Files         185      185              
  Lines       11591    11626      +35     
==========================================
+ Hits        10023    10065      +42     
+ Misses       1568     1561       -7     
Impacted Files Coverage Δ
ctapipe/image/geometry_converter_hex.py 72.32% <ø> (ø)
ctapipe/io/containers.py 100.00% <ø> (ø)
ctapipe/io/simteleventsource.py 97.72% <ø> (-0.06%) ⬇️
ctapipe/visualization/mpl_camera.py 80.00% <85.71%> (ø)
ctapipe/calib/camera/calibrator.py 100.00% <100.00%> (ø)
ctapipe/calib/camera/tests/test_calibrator.py 100.00% <100.00%> (ø)
ctapipe/core/tests/test_tool.py 100.00% <100.00%> (ø)
ctapipe/core/tests/test_traits.py 100.00% <100.00%> (ø)
ctapipe/core/tool.py 85.29% <100.00%> (+0.10%) ⬆️
ctapipe/core/traits.py 94.52% <100.00%> (+0.07%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5acb7c3...f824053. Read the comment docs.

kosack
kosack previously approved these changes Mar 20, 2020
@maxnoe
Copy link
Member Author

maxnoe commented Mar 20, 2020

Sorry @kosack, one more time. We do indeed want to test for exact equality here and I also fixed the random seed.

@vuillaut
Copy link
Member

Hi @maxnoe
Is event weighting handled correctly when width=0 ?

@maxnoe
Copy link
Member Author

maxnoe commented Mar 23, 2020

Hi @maxnoe
Is event weighting handled correctly when width=0 ?

I think the hillas reconstructor raises if any telescope events have width=0 since #994

@vuillaut
Copy link
Member

Hi @maxnoe
Is event weighting handled correctly when width=0 ?

I think the hillas reconstructor raises if any telescope events have width=0 since #994

Indeed.
Looks good to me then.

@kosack kosack merged commit 6ff0f12 into master Mar 23, 2020
@maxnoe maxnoe deleted the fix_hillas_width_0 branch March 23, 2020 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants