Releases: cta-observatory/pyeventio
Releases · cta-observatory/pyeventio
v1.5.1.post1
v1.5.1
v1.4.2
v1.4.1
v1.4.1
- Introduce
EventIOFile.peek
to look at the next eventio object in a file without advancing the iterator.
Beware, that this might prevent from reading the previous object if the file is not back-seekable.
To be safe, only call peek after reading/parsing the current object. - Fix that
SimTelFile.iter_mc_events
had the wrongTelescopeData
. It always used the last available, which was either the one from the previous event or even older since events might not haveTelescopeData
at all
v1.4.0
v1.4.0
-
Change to the
PhotoElectrons[1208]
object: store photoelectrons and amplitudes in 1d-arrays together with an array of pixel ids instead of lists of lists. This brings a considerable performance improvement, both for reading this data from simtel files and for dealing with the data.See https://numpy.org/doc/stable/reference/generated/numpy.ufunc.at.html for how to do operations on these pairs of indices / values arrays, e.g. to compute the mean arrival time in each pixel, you could use:
def mean_at(n, array, indices):
mean = np.zeros(len(n))
np.add.at(mean, indices, array)
# avoid divide by zero warning
mask = n > 0
mean[mask] /= n[mask]
mean[~mask] = np.nan
return mean
mean_time = mean_at(pe['photoelectrons'], pe['time'], pe['pixel_id'])
- The
photon_counts
field of thePhotoElectrons[1208]
object was renamed tophotons