Files
notes-archive/statics/physics/modern-phys-lab/decay.ipynb
2025-09-30 13:19:42 -05:00

37 KiB

In [1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas

data = pandas.read_csv('20250212_EC_decays.txt')
data.describe()
Out[1]:
<style scoped=""> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
Decay Times in Microseconds
count 1257.000000
mean 3.421448
std 3.931721
min 0.319997
25% 0.960001
50% 1.880002
75% 4.120004
max 20.319996
In [2]:
cropped_data = data[data['Decay Times in Microseconds'] >= 0.3]
cropped_data.describe()
Out[2]:
<style scoped=""> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
Decay Times in Microseconds
count 1257.000000
mean 3.421448
std 3.931721
min 0.319997
25% 0.960001
50% 1.880002
75% 4.120004
max 20.319996
In [12]:
data_range = (0.3, max(data['Decay Times in Microseconds']))
bins = np.arange(0.3, max(data['Decay Times in Microseconds']) + 0.5, 0.5)
hist = cropped_data.hist(range=data_range, bins=bins)
hist[0][0].set_yscale('log')
No description has been provided for this image
In [33]:
cropped_data_2 = cropped_data[cropped_data['Decay Times in Microseconds'] <= 7]
data_range = (0.3, max(cropped_data_2['Decay Times in Microseconds']))
bins = np.arange(0.3, max(cropped_data_2['Decay Times in Microseconds']) + 0.5, 0.5)
hist = cropped_data_2.hist(range=data_range, bins=bins)
hist[0][0].set_yscale('log')

times, bins = np.histogram(cropped_data_2, bins=bins, range=data_range)
times = np.log(times)
bins = bins[:-1]
No description has been provided for this image
In [43]:
line = np.polynomial.polynomial.Polynomial.fit(bins, times, deg=1)
line.convert()
line.roots()
Out[43]:
array([11.89013872])