filename = 'data/nanodiamant_histo.phu'
import phconvert as phc
import matplotlib.pyplot as plt
import numpy as np
hist, bin_size, meta = phc.pqreader.load_phu(filename)
hist.shape # the array containing all the histograms
bin_size # one bin size per histogram
assert all(bin_size == bin_size[0]) # all curves must have the same bin size
meta.keys()
meta['acquisition_duration'] # in seconds
n = 600
ns = 1e9
time = np.arange(hist.shape[1]) * bin_size[0] # in s
for i in range(hist.shape[0]):
plt.plot(time * ns, hist[i], label=f'Curve {i}')
plt.xlabel('Time (ns)');
plt.legend()
plt.xlim(-10, 125)
plt.grid();
phc.pqreader._ptu_print_tags(meta['tags'])
np.equal([1,2,3], [1,2,3])
np.alltrue