In [1]:
import dmdd
import numpy as np
%matplotlib inline


WARNING:root:pymultinest not imported!
WARNING:root:DMDD_MAIN_PATH environment variable not defined, defaulting to:   ~/.dmdd
ERROR: Line magic function `%matplotlab` not found.

In [2]:
# shortcut for scattering models corresponding to rates coded in rate_UV:
anapole_model = dmdd.UV_Model('Anapole', ['mass','sigma_anapole'])
SI_model = dmdd.UV_Model('SI', ['mass','sigma_si'])

print 'model: {}, parameters: {}.'.format(anapole_model.name, anapole_model.param_names)
print 'model: {}, parameters: {}.'.format(SI_model.name, SI_model.param_names)


model: Anapole, parameters: ['mass', 'sigma_anapole'].
model: SI, parameters: ['mass', 'sigma_si'].

In [3]:
# intialize an Experiment with XENON target, to be passed to Simulation_AM:
xe = dmdd.Experiment('1xe', 'xenon', 5, 80, 1000, dmdd.eff.efficiency_unit, energy_resolution=True)

In [4]:
xe_si = dmdd.Simulation_AM('SI', xe, SI_model, 
                        {'mass':50.,'sigma_si':75.5}, Qmin = np.asarray([5.]), 
                        Qmax = np.asarray([80.]), 
                        Tmin = 0, Tmax = 365, sigma_si = 75.5, 
                        element = 'xenon', force_sim = True)

#maybe use a histogram to see what it looks like?


Simulation data and/or pickle file does not exist. Forcing simulation.


Q = 9.925775 ; T = 69.246753 ; pdf = 417.460802 ; U = 161.396090 .
Q = 6.170858 ; T = 276.975596 ; pdf = 608.724886 ; U = 208.582056 .
Q = 26.904223 ; T = 214.876183 ; pdf = 64.920031 ; U = 40.497403 .
Q = 10.983663 ; T = 205.918716 ; pdf = 371.550551 ; U = 166.025161 .
Q = 7.353098 ; T = 304.085822 ; pdf = 537.917171 ; U = 126.385947 .
Q = 14.646756 ; T = 203.891100 ; pdf = 254.354230 ; U = 117.612741 .
Q = 26.192023 ; T = 35.008801 ; pdf = 80.515181 ; U = 12.173796 .
Q = 15.822840 ; T = 159.404431 ; pdf = 233.546449 ; U = 202.795227 .
Q = 7.728866 ; T = 35.572293 ; pdf = 512.082021 ; U = 423.812771 .
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-4-39e078dcf6ce> in <module>()
      3                         Qmax = np.asarray([80.]),
      4                         Tmin = 0, Tmax = 365, sigma_si = 75.5,
----> 5                         element = 'xenon', force_sim = True)
      6 
      7 #maybe use a histogram to see what it looks like?

/Users/katelynneese/dmddACT/dmdd/dmdd.py in __init__(self, name, experiment, model, parvals, Qmin, Qmax, element, sigma_si, sigma_anapole, mass, v_amplitude, Tmin, Tmax, path, force_sim, asimov, nbins_asimov, plot_nbins, plot_theory, silent)
   1068                 raise ValueError('Asimov simulations not yet implemented!')
   1069             else:
-> 1070                 Q = self.simulate_data()
   1071                 np.savetxt(self.datafile,Q)
   1072                 fout = open(self.picklefile,'wb')

/Users/katelynneese/dmddACT/dmdd/dmdd.py in simulate_data(self)
   1134                 pdf_value = PDF(Q_rand, T_rand, element = self.element, mass = self.mass,
   1135                                         sigma_si= self.sigma_si, sigma_anapole = self.sigma_anapole,
-> 1136                                         Qmin = np.asarray([self.Qmin]), Qmax = np.asarray([self.Qmax]), Tmin = self.Tmin, Tmax = self.Tmax)/env
   1137                 if U < pdf_value:
   1138                     #increment matches

/Users/katelynneese/dmddACT/dmdd/dmdd.py in PDF(Q, time, element, mass, sigma_si, sigma_anapole, Qmin, Qmax, Tmin, Tmax)
    117                     Tmin = Tmin, Tmax = Tmax,
    118                     element = element, sigma_si = sigma_si,
--> 119                     sigma_anapole = sigma_anapole, mass = mass)
    120 
    121     return drdq/norm[0] #for now removed efficiency and made it 1

/Users/katelynneese/dmddACT/dmdd/dmdd.py in integral(Qmin, Qmax, Tmin, Tmax, Qpoints, Tpoints, function, sigma_si, sigma_anapole, mass, element, v_amplitude)
    102         for j,T in enumerate(T_box):
    103             a_sum = np.sum(function(Q = np.asarray(Q), time = T, sigma_si = sigma_si, sigma_anapole = sigma_anapole,
--> 104                                     mass = mass, element = element, v_amplitude = v_amplitude))
    105             total_sum.append(a_sum)
    106 

/Users/katelynneese/dmddACT/dmdd/dmdd.py in dRdQ_AM(mass, sigma_si, sigma_anapole, Q, time, element, vlag_mean, v_amplitude)
     81     #print type(v_lag) #vlag must be a number not an array
     82 
---> 83     rate_QT = rate_UV.dRdQ(Q = energy, v_lag = v_lag, mass = mass, sigma_si = sigma_si, sigma_anapole = sigma_anapole, element = element)
     84 
     85     "Return a 1D array with the rate based on the time and energy given"

KeyboardInterrupt: 

In [5]:
xe_anapole = dmdd.Simulation_AM('Anapole', xe, anapole_model, 
                        {'mass':50.,'sigma_anapole':44.25}, Qmin = np.asarray([5.]), 
                        Qmax = np.asarray([80.]), 
                        Tmin = 0, Tmax = 365, sigma_anapole = 44.25, 
                        element = 'xenon', force_sim = True)

#maybe use a histogram to see what it looks like?
# sigma_si can be anywhere upwards of 671 but sigma_anapole is around 140 at the highest


Simulation data and/or pickle file does not exist. Forcing simulation.


Q = 6.381130 ; T = 156.116963 ; pdf = 132.190687 ; U = 44.486517 .
Q = 5.719233 ; T = 191.132699 ; pdf = 133.019339 ; U = 42.874222 .
Q = 11.028532 ; T = 344.533253 ; pdf = 77.740594 ; U = 23.087695 .
Q = 5.839922 ; T = 209.423475 ; pdf = 127.930576 ; U = 36.598667 .
Q = 7.277484 ; T = 128.441628 ; pdf = 126.229305 ; U = 29.245389 .
Q = 11.871179 ; T = 203.195273 ; pdf = 71.330390 ; U = 43.161002 .
Q = 5.706679 ; T = 155.437479 ; pdf = 140.636488 ; U = 126.072719 .
Q = 10.769414 ; T = 79.142648 ; pdf = 93.400179 ; U = 35.462004 .
Q = 14.518289 ; T = 34.440256 ; pdf = 61.660346 ; U = 57.466819 .
Q = 25.245608 ; T = 117.800356 ; pdf = 21.232331 ; U = 19.671319 .
Q = 26.166661 ; T = 204.036493 ; pdf = 14.728469 ; U = 10.501656 .
Q = 5.053704 ; T = 223.484309 ; pdf = 135.373652 ; U = 19.818466 .
Q = 6.073428 ; T = 236.890840 ; pdf = 120.950870 ; U = 92.749639 .
Q = 8.881020 ; T = 39.805147 ; pdf = 107.141326 ; U = 2.766484 .
Q = 39.959558 ; T = 209.523388 ; pdf = 2.603834 ; U = 1.798069 .
Q = 17.604956 ; T = 59.592031 ; pdf = 47.185314 ; U = 5.868140 .
Q = 9.733886 ; T = 281.637568 ; pdf = 82.100802 ; U = 21.715242 .
Q = 10.548089 ; T = 236.310687 ; pdf = 77.223397 ; U = 70.258617 .
Q = 20.487111 ; T = 82.358094 ; pdf = 35.851156 ; U = 18.482762 .
Q = 17.855928 ; T = 167.022174 ; pdf = 41.891597 ; U = 10.420574 .
simulated: 163 events (expected 168).

In [ ]: