Commit 1f657b0a authored by Nahuel Ferreiro-Iachellini's avatar Nahuel Ferreiro-Iachellini
Browse files

Update CPD_DM_Search_Data_Release.pdf, cpd_data_release.ipynb, recon_energies_roi.txt files

parents
%% Cell type:markdown id: tags:
# Notebook for Quickly Recreating Publication Plots
----
CPD DM Search Public Data Release, SuperCDMS Collaboration
Accompanies arXiv:2007.14289
%% Cell type:code id: tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from matplotlib.cm import ScalarMappable
from matplotlib.colors import Normalize
from matplotlib import rc
rc('text', usetex=True)
rc('font', family="serif")
rc('axes', labelsize=12)
rc('font', size=12)
rc('legend', fontsize=10)
rc('xtick', labelsize=12)
rc('ytick', labelsize=12)
```
%% Cell type:markdown id: tags:
## Plotting Figure 1
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(figsize=(1.5 * (3 + 3/8), 3 + 3/8))
rawpulse = np.loadtxt('figure1/rawpulse.txt', delimiter=',')
optimumfilter = np.loadtxt('figure1/optimumfilter.txt', delimiter=',')
fitresult = np.loadtxt('figure1/fitresult.txt', delimiter=',')
fpgafilter = np.loadtxt('figure1/fpgafilter.txt', delimiter=',')
ax.plot(
rawpulse[:, 0] * 1e3,
rawpulse[:, 1],
label="Raw Pulse",
color='xkcd:grey',
)
ax.plot(
optimumfilter[:, 0] * 1e3,
optimumfilter[:, 1],
label="Optimum Filter",
color='blue',
linestyle='-',
)
ax.plot(
fitresult[:, 0] * 1e3,
fitresult[:, 1],
label="Fit Result",
color='k',
linestyle='dashed',
)
ax.plot(
fpgafilter[:, 0] * 1e3,
fpgafilter[:, 1],
label='FPGA Filter',
color='red',
marker='.',
)
ax.axhline(11.77, color='k', linestyle='dotted', label='Threshold')
ax.set_xlim(
25.6,
26.3,
)
ax.set_ylim(-60, 175)
ax.tick_params(which="both", direction="in", right=True, top=True)
ax.set_ylabel("Amplitude [ADC Bins]", fontsize=12)
ax.set_xlabel("Time [ms]", fontsize=12)
fig.tight_layout()
```
%% Output
%% Cell type:markdown id: tags:
## Plotting Figure 2
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(figsize=(1.5 * (3 + 3/8), 3 + 3/8))
ax.step(*np.loadtxt('figure2/recon_energy_drde.txt', delimiter=',', unpack=True), where='mid', linestyle='-', color='k')
left, bottom, width, height = [0.4, 0.52, 0.54, 0.38]
ax2 = fig.add_axes([left, bottom, width, height])
ax2.step(*np.loadtxt('figure2/e_etf_drde.txt', delimiter=',', unpack=True), where='mid', linestyle='-', color='k')
colors = plt.get_cmap("cool_r")(np.array([0, 0.5, 1]))
ax2.axvline(
1.5,
linestyle ='--',
color=colors[0],
)
ax2.axvline(
5.9,
linestyle ='--',
color=colors[1],
)
ax2.axvline(
6.5,
linestyle ='--',
color=colors[2],
)
ax2.axvline(
(6.5 - 1.739),
linestyle ='dotted',
color='grey',
)
ax2.axvline(
(5.9 - 1.739),
linestyle = 'dotted',
color='grey',
)
ax2.grid(b=False, which='both')
ax2.set_title('')
ax2.set_ylim(1e-2, 1e4)
ax2.set_xlim(0, 7)
ax2.set_yscale('log')
ax2.tick_params(which="both", direction="in", top=True, right=True, labelsize=12)
ax2.set_ylabel('')
ax2.set_xlabel(r"Calibrated $E_\mathrm{ETF}$ [keV]", fontsize=12)
ax2.set_yticks(ticks=np.geomspace(1e-2, 1e4, num=4))
ax2.set_xticks(ticks=np.linspace(0, 7, num=8))
ax.tick_params(which="both", direction="in", right=True, top=True)
ax.grid(b=False, which='both')
ax.set_ylabel(r"Differential Rate [events/($\mathrm{g}\ \mathrm{eV}\ \mathrm{day}$)]", fontsize=12)
ax.set_xlabel("Reconstructed Energy, $E'$ [eV]", fontsize=12)