aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-11-16 08:19:38 -0600
committertlatorre <tlatorre@uchicago.edu>2020-11-16 08:19:38 -0600
commit848c7cdce99cedc3d786df53173d635787fe775e (patch)
tree99a3d9e3453ac18eb3fd777b67ff7cfd024e8623 /utils
parent86b120cb7e66e72ca5b64c33e334ce33b2502646 (diff)
downloadsddm-848c7cdce99cedc3d786df53173d635787fe775e.tar.gz
sddm-848c7cdce99cedc3d786df53173d635787fe775e.tar.bz2
sddm-848c7cdce99cedc3d786df53173d635787fe775e.zip
return np.inf if parameters are out of bounds
Diffstat (limited to 'utils')
-rwxr-xr-xutils/chi22
-rwxr-xr-xutils/dm-search2
2 files changed, 2 insertions, 2 deletions
diff --git a/utils/chi2 b/utils/chi2
index 6dfd984..12b602a 100755
--- a/utils/chi2
+++ b/utils/chi2
@@ -211,7 +211,7 @@ def make_nll(data, muons, mc, atmo_scale_factor, muon_scale_factor, bins, print_
data_hists = get_data_hists(data,bins)
def nll(x, grad=None):
- if any(x[i] < 0 for i in (0,2,4,5)):
+ if (x < PRIORS_LOW).any() or (x > PRIORS_HIGH).any():
return np.inf
# Get the Monte Carlo histograms. We need to do this within the
diff --git a/utils/dm-search b/utils/dm-search
index b27e3fc..2a008d5 100755
--- a/utils/dm-search
+++ b/utils/dm-search
@@ -237,7 +237,7 @@ def make_nll(dm_particle_id, dm_mass, dm_energy, data, muons, mc, atmo_scale_fac
df_dict_dm[id] = dm_sample[dm_sample.id == id]
def nll(x, grad=None):
- if any(x[i] < 0 for i in (0,2,4,5,6)):
+ if (x < PRIORS_LOW).any() or (x > PRIORS_HIGH).any():
return np.inf
# Get the Monte Carlo histograms. We need to do this within the