Closed tomkooij closed 8 years ago
What values cause these errors? To large/to small/to negative floats?
In core_reconstruction some warnings are suppressed using:
with warnings.catch_warnings(record=True):
Using the numpy warning setter may be more specific. Though, do we know that the other numpy warnings never occur, and if they do, can they also be ignored or not?
I'll try to investigate (when time permits...). We need an overview of warnings (with causes) to properly decide which warnings to suppress.
Some warnings are suppressed in the tests, disabling those filters and catches then running the tests might reveal many warnings.
The invalid value encountered in double_scalars
all seem to be caused by 'area' being very small (smaller than 'eps') in:
# area triangle is |cross product|
area = abs(dx1 * dy2 - dx2 * dy1 + dy1 * dz2 - dy2 * dz1 +
dz1 * dx2 - dz2 * dx1)
# sine of angle is area divided by two sides
sin1 = area / lenvec01 / lenvec02
sin2 = area / lenvec01 / lenvec12
sin3 = area / lenvec02 / lenvec12
These are easily prevented, so there is no need to suppress them. I'll push a PR.
I have tested many reconstructions and (after merging #149) I only encounter RuntimeWarning: All-NaN axis encountered
from numpy.nanmin
in event_utils.station_arrival_times
. This seems to be due to all NaN detector_arrival_times
probably caused by (nan, nan, nan, nan)
detector offsets, but I have not verified that yet.
There is a similar warning from numpy.nanmean
in core reconstruction, which is probably due to the same nan
detector offsets.
I'd like to fix these as well (or throw a real verbose warning). But I need to investigate more. (Again when time permits)
The warnings are indeed from (nan, nan, nan, nan)
detector offsets (see above).
There is no need in throwing a verbose warning, because this is just one of the many cases that can make a reconstruction fail.
I'd like to discard events before the warning is thrown, for example by adding a check here or supress the warnings as suggested by @153957 above.
While doing direction reconstructions users encouter many (useless) warnings:
Besides being confusing for newbies, these warnings have an undesirable side effect: real warnings (
All NaN axis-encountered
) are no longer registered by the user. This is a real problem.The first warning is from
CoincidenceQuery.__init__()
about missing stations groups: link I suggest removing this warningand letting the query fail when it is indeed a problem. Perhaps make such a failure verbose.this will make_get_events()
throw a verbose warning when events are actually missing.I suggest turning off warnings about
invalid value encountered in double_scalars
bynumpy.setterr(invalid='ignore')
.