Skip to content

Commit

Permalink
Updated to work on NERSC, and also changed the verbosity
Browse files Browse the repository at this point in the history
vvelan committed Sep 19, 2024
1 parent b7fd5ba commit 61fd564
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions darklim/sensitivity/_sens_est.py
Original file line number Diff line number Diff line change
@@ -447,7 +447,7 @@ def run_sim(self, threshold, e_high, e_low=1e-6, m_dms=None, nexp=1, npts=1000,

t_start = time.time()
try:
rate_temp = drdefunction[ii](en_interp) * exposure
rate_temp = drdefunction[ii](en_interp) * self.exposure
except ValueError:
# rate = np.zeros_like(en_interp)
# for jj, en in enumerate(en_interp):
@@ -460,7 +460,6 @@ def run_sim(self, threshold, e_high, e_low=1e-6, m_dms=None, nexp=1, npts=1000,

print(f'Finished mass {ii}. Took {(time.time()-t_start)/60:.2f} minutes.')


for ii in range(nexp):
evts_sim = self._generate_background(
en_interp, plot_bkgd=plot_bkgd and ii==0,
@@ -478,7 +477,7 @@ def run_sim(self, threshold, e_high, e_low=1e-6, m_dms=None, nexp=1, npts=1000,
cl=0.9, # C.L.
res=res, # include smearing of DM spectrum
gauss_width=10, # if smearing, number of sigma to go out to
verbose=verbose, # print outs
verbose=(verbose*(ii==0)), # print outs
drdefunction=drdefunction, # lambda function for dRdE(E)
hard_threshold=threshold, # hard threshold for energies
sigma0=sigma0, # Starting guess for sigma
@@ -607,7 +606,7 @@ def run_sim_fc(self, known_bkgs_list, threshold, e_high, e_low=1e-6, m_dms=None,
ax.axvline(ul,ls='--',color='red')
ax.set_xlabel('Upper Limit [Events]')
ax.set_xlim(0,max(np.asarray(uls)))
outdir = '/global/scratch/users/vvelan/DarkLim/examples/'
outdir = '/global/cfs/cdirs/lz/users/vvelan/Test/DarkLim/examples/'
plt.savefig(outdir+pltname+'.png',dpi=300, facecolor='white',bbox_inches='tight')

return m_dms, sig, ul
@@ -768,7 +767,7 @@ def run_fast_fc_sim(self, known_bkgs_list, threshold, e_high, e_low=1e-6, m_dms=
ax.axvline(median_ul,ls='--',color='red')
ax.set_xlabel('Upper Limit [Events]')
ax.set_xlim(0,max(uls))
outdir = '/global/scratch/users/vvelan/DarkLim/examples/'
outdir = '/global/cfs/cdirs/lz/users/vvelan/Test/DarkLim/examples/'
plt.savefig(outdir+pltname+'.png',dpi=300, facecolor='white',bbox_inches='tight')

# expected bkg rate, made to match m_dm len just to make analysis easier

0 comments on commit 61fd564

Please sign in to comment.