GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 446be24d authored by Thomas Vincent's avatar Thomas Vincent

hide 0 division warnings

parent 9e8df4e1
......@@ -36,11 +36,13 @@ import ctypes
import multiprocessing
from threading import Thread
import multiprocessing.sharedctypes as mp_sharedctypes
from import snip1d
import warnings
import numpy as np
from scipy.optimize import leastsq
from import snip1d
from ... import config
from import QSpaceH5
from import BackgroundTypes
......@@ -325,7 +327,9 @@ def project(data, hits=None):
:rtype: List[numpy.ndarray]
if hits is not None:
data /= hits
with warnings.catch_warnings():
warnings.simplefilter('ignore', RuntimeWarning)
data /= hits
data[hits <= 0] = 0
dim2_sum = data.sum(axis=0).sum(axis=0)
......@@ -376,7 +380,6 @@ def _gaussian_err(parameters, axis, signal):
_SQRT_2_PI = np.sqrt(2 * np.pi)
# TODO double check
def gaussian_fit(axis, signal):
"""Returns gaussian fitting information
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment