:py:mod:`antibunching` ====================== .. py:module:: antibunching .. autoapi-nested-parse:: Module for performing antibunching-type calculations. Currently only performs simple second-order correlation. More advanced functionality might be added in the future. Bertus van Heerden, University of Pretoria, 2023 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: antibunching.AntibunchingAnalysis Attributes ~~~~~~~~~~ .. autoapisummary:: antibunching.__docformat__ antibunching.logger .. py:data:: __docformat__ :value: "'NumPy'" .. py:data:: logger :value: "'antibunching'" .. py:class:: AntibunchingAnalysis(particle) Performs second-order correlation and stores the result. Parameters: ----------- particle : smsh5.particle particle object to perform analysis on. .. py:attribute:: _particle .. py:attribute:: uuid .. py:attribute:: corr_hist :value: 'None' .. py:attribute:: corr_bins :value: 'None' .. py:attribute:: corr_events :value: 'None' .. py:attribute:: has_corr :value: 'False' .. py:method:: correlate_particle(difftime: float, window: float, binsize: float) Calculate second-order correlation for this particle. Mainly a wrapper around static method `correlate_times`. Stores result in class attributes `corr_bins`, `corr_hist` and `corr_events` and sets `has_corr` to `True`. Arguments: ---------- difftime : float time difference between channels (ch. 1 - ch. 2) in ns window : float time window for correlation in ns binsize : float bin size for correlation histogram in ns .. py:method:: correlate_times(abstimes1, abstimes2, microtimes1, microtimes2, difftime=0.0, window=500.0, binsize=0.5) :staticmethod: Calculate second-order correlation based on time-tagged time-resolved photon data. The function is a simple nested loop that runs through every photon within a certain window and checks for coincidences. Each coincidence gets a relative time, which are all put in a histogram to get the second-order correlation. Before the calculation, the arrival times are corrected based on the difftime parameter, which accounts for possible delay between two TCSPC cards. Arguments: ---------- abstimes1 : 1D array absolute times for channel 1 in ns abstimes2 : 1D array absolute times for channel 2 in ns microtimes1 : 1D array micro times for channel 1 in ns microtimes2 : 1D array micro times for channel 2 in ns difftime : float time difference between channels (ch. 1 - ch. 2) in ns window : float time window for correlation in ns binsize : float bin size for correlation histogram in ns Returns: -------- bins : 1D array correlation histogram bins corr : 1D array correlation histogram values events : 1D array difftimes used to construct histogram, returned in case rebinning is needed. .. py:method:: rebin_corr(window, binsize)