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


WARNING:root:pymultinest not imported!
WARNING:root:DMDD_MAIN_PATH environment variable not defined, defaulting to:   ~/.dmdd

Testing PDF function in dmdd over time for SI and Anapole

On the colormaps near Q = 0, the pdf function seems to be predicting the wrong number of events for the SI and anapole models. SI should have more events in the end of the graph (days 200-350) and anapole should have more events in the beginning of the graph (days 50-150).

These graphs agree with the histogram plots that have annual modulation as well as the line graphs that I made over the summer. The SI model experiences a lower probability from days t=50-150 and a higher probability from t=200-350, and the anapole model is opposite. However this disagrees with the values

Note: I had to do this with an unnormalized PDF, as the integral function wouldn't work from the notebook for some reason.


In [10]:
pdf_list = []
times = np.linspace(0, 365, 366) #365 days to test
#test all days at same energies, where energy = 3
for i,time in enumerate(times):
    value = dmdd.PDF(Q=[5.], time=time, element = 'xenon', mass = 50.,
                                sigma_si= 75.5, sigma_anapole = 0.,
                                Qmin = np.asarray([5.]), Qmax = np.asarray([10.]),
                                Tmin = 0, Tmax = 365)
    pdf_list.append(value)
    
plt.plot(times, pdf_list)
plt.xlabel("Time in Days")
plt.ylabel("Predicted PDF SI Model")
plt.title("Predicted PDF over Time for SI Model")


#PDF values show correct annual modulation for events over time (not normalized)


Out[10]:
<matplotlib.text.Text at 0x10a89d610>

In [11]:
pdf_list = []
times = np.linspace(0, 365, 366) #365 days to test
#test all days at same energies, where energy = 3
for i,time in enumerate(times):
    value = dmdd.PDF(Q=[5.], time=time, element = 'xenon', mass = 50.,
                                sigma_si= 0., sigma_anapole = 44.25,
                                Qmin = np.asarray([5.]), Qmax = np.asarray([10.]),
                                Tmin = 0, Tmax = 365)
    pdf_list.append(value)
    
plt.plot(times, pdf_list)
plt.xlabel("Time in Days")
plt.ylabel("Predicted PDF")
plt.title("Predicted PDF over Time for Anapole Model")


Out[11]:
<matplotlib.text.Text at 0x10a8dda50>

Testing graphing without a normalized PDF function

The following cell tests graphing a theory plot without normalizing the PDF function. If it displays correctly now, then the problem is likely the normalization, not the PDF function or the colormap graph. If it still displays incorrectly, the problem is with the colormap.


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_lowQ = dmdd.Experiment('1xe', 'xenon', 5, 10, 1000, dmdd.eff.efficiency_unit, energy_resolution=True)

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

#make cross section particularly large to generate more events
#max pdf value is about 1.74


pdf_list = []
times = np.linspace(0, 365, 366) #365 days to test
#test all days at same energies, where energy = 3
for i,time in enumerate(times):
    value = dmdd.PDF(Q=[5.], time=time, element = 'xenon', mass = 50.,
                                sigma_si= 75.5, sigma_anapole = 0.,
                                Qmin = np.asarray([5.]), Qmax = np.asarray([10.]),
                                Tmin = 0, Tmax = 365)
    pdf_list.append(value)
plt.figure(2)
plt.plot(times, pdf_list)
plt.xlabel("Time in Days")
plt.ylabel("Predicted PDF SI Model")
plt.title("Predicted PDF over Time for SI Model")


#PDF values show correct annual modulation for events over time (not normalized)


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


61
simulated: 61 events (expected 68).
Out[12]:
<matplotlib.text.Text at 0x10a7f46d0>

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

#make cross section particularly large to generate more events
#max pdf value is about 1.74

pdf_list = []
times = np.linspace(0, 365, 366) #365 days to test
#test all days at same energies, where energy = 3
for i,time in enumerate(times):
    value = dmdd.PDF(Q=[5.], time=time, element = 'xenon', mass = 50.,
                                sigma_si= 0., sigma_anapole = 44.25,
                                Qmin = np.asarray([5.]), Qmax = np.asarray([10.]),
                                Tmin = 0, Tmax = 365)
    pdf_list.append(value)
plt.figure(2)
plt.plot(times, pdf_list)
plt.xlabel("Time in Days")
plt.ylabel("Predicted PDF")
plt.title("Predicted PDF over Time for Anapole Model")


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


80
simulated: 80 events (expected 68).
Out[13]:
<matplotlib.text.Text at 0x10b6ecb90>

Conclusion

So it appears that the PDF function and the normalization functions are working properly, and it is the way that I am graphing my theory plot that is incorrect, as it predicts exactly the opposite of what the PDF function itself predicts. I'm still not sure why this is happening.


In [ ]: