-
Notifications
You must be signed in to change notification settings - Fork 35
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
Raytracer does not use scipy.integrate.quad for attenuation #722
base: develop
Are you sure you want to change the base?
Conversation
(True or False) if you want to use the optimization. (Default: None, i.e., use optimization if ice model is | ||
listed in speedup_attenuation_models) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc string needs to be adjusted
if overwrite_speedup is None: | ||
self._use_optimized_calculation = True | ||
else: | ||
self._use_optimized_calculation = overwrite_speedup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be written as one-liner self._use_optimized_calculation = True if overwrite_speedup is None else overwrite_speedup
@christophwelling can you finish that? |
I don't want to get too involved with this - probably simplifying and unifying the way the attenuation length is calculated in Python is a good idea, and I think this should get merged once the docstring is updated, but I'm not aware of any cases where the current implementation causes errors. The 'bigger' problem is in the C++ backend (#541), where the integration fails silently because of much stricter convergence limits than in the Python case. I believe @EnriqueHuesca has a solution already (other than just relaxing the convergence requirement), which I hope he will contribute soon : ) |
Hi everyone, I justed merged #660 which makes the python version (using numba) as fast as the C++ implementation (except for the attenuation length calculation). However, there is one important thing that we need to check for! @christophwelling argued that an accuracy of 10% would be acceptable because the uncertainty of the attenuation length is not better. This is true, BUT we need much, much smaller relative error. When we calculate the attenuation for two rays to two nearby antennas, the result should be identical. In general, for one event, the relative error between the paths to different antennas needs to be on the <1% level, because we use the amplitude differences in a reconstruction to determine the viewing angle and vertex distance. @christophwelling can you merge the recent develop into your branch and implement such a test? |
I commited a fix for the error in the raytracing test. The test still fails, but I think that's just because it now defaults to a different way of calculating the integral. |
Using scipy.integrate.quad to calculate the attenuation can occasionally cause problems.
With this PR, the integral will by default be calculated using a simple Rieman sum over a fixed number of point. While this is a bit less precise, the difference is far smaller than the uncertainty on the attenuation length itself.