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

Binary wgts bug #13

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion hera_filters/dspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from scipy.optimize import leastsq, lsq_linear
import copy
from scipy import linalg
from functools import lru_cache

#DEFAULT PARAMETERS FOR CLEANs
CLEAN_DEFAULTS_1D={'tol':1e-9, 'window':'none',
Expand Down Expand Up @@ -118,7 +119,7 @@ def _are_wgts_binary(wgts):
Returns:
Value of True if wgts contains only 1's and 0's
"""
binary_total = np.sum(np.isclose(wgts, 0) + np.isclose(wgts, 1))
binary_total = np.sum(np.equal(wgts, 0)) + np.sum(np.equal(wgts, 1))
return binary_total == np.prod(wgts.shape)

def place_data_on_uniform_grid(x, data, weights, xtol=1e-3):
Expand Down