In [ ]:
filename = 'data/nanodiamant_histo.phu'
In [ ]:
import phconvert as phc
import matplotlib.pyplot as plt
import numpy as np
In [ ]:
hist, bin_size, meta = phc.pqreader.load_phu(filename)
In [ ]:
hist.shape  # the array containing all the histograms
In [ ]:
bin_size  # one bin size per histogram
In [ ]:
assert all(bin_size == bin_size[0])  # all curves must have the same bin size
In [ ]:
meta.keys()
In [ ]:
meta['acquisition_duration']  # in seconds
In [ ]:
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();
In [ ]:
phc.pqreader._ptu_print_tags(meta['tags'])
In [ ]:
np.equal([1,2,3], [1,2,3])
In [ ]:
np.alltrue