Qudi
|
Perform a gated counting measurement with the hardware. More...
Public Member Functions | |
def | __init__ (self, config, kwargs) |
Create CounterLogic object with connectors. More... | |
def | on_activate (self) |
Initialisation performed during activation of the module. | |
def | on_deactivate (self) |
Deinitialisation performed during deactivation of the module. | |
def | set_num_bins_histogram (self, num_bins, update=True) |
Set the number of bins. More... | |
def | do_calculate_histogram (self, mode='normal') |
Passes all the needed parameters to the appropriated methods. More... | |
def | calculate_histogram (self, trace, num_bins=None, custom_bin_arr=None) |
Calculate the histogram of a given trace. More... | |
def | analyze_flip_prob (self, trace, num_bins=None, threshold=None) |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold. More... | |
def | analyze_flip_prob2 (self, trace, threshold=1, analyze_mode='full') |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold. More... | |
def | analyze_flip_prob3 (self, trace, init_threshold=[1, ana_threshold=[1, analyze_mode='full') |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold. More... | |
def | analyze_flip_prob4 (self, trace, bins=30, init_threshold=[1, ana_threshold=[1, analyze_mode='full') |
def | analyze_flip_prob_postselect (self) |
Post select the data trace so that the flip probability is only calculated from a jump from below a threshold value to an value above threshold. More... | |
def | get_fit_functions (self) |
Return all fit functions, which are currently implemented for that module. More... | |
def | do_fit (self, fit_function=None) |
Makes the a fit of the current fit function. More... | |
def | do_no_fit (self) |
Perform no fit, basically return an empty array. More... | |
def | analyze_lifetime (self, trace, dt, method='postselect', distr='gaussian_normalized', state='|-1 >', num_bins=50) |
Perform an lifetime analysis of a 1D time trace. More... | |
def | do_gaussian_fit (self, axis, data) |
Perform a gaussian fit. More... | |
def | do_doublegaussian_fit (self, axis, data) |
def | do_doublepossonian_fit (self, axis, data) |
def | do_possonian_fit (self, axis, data) |
def | get_poissonian (self, x_val, mu, amplitude) |
Calculate, bases on the passed values a poisson distribution. More... | |
def | guess_threshold (self, hist_val=None, trace=None, max_ratio_value=0.1) |
Assume a distribution between two values and try to guess the threshold. More... | |
def | calculate_threshold (self, hist_data=None, distr='poissonian') |
Calculate the threshold by minimizing its overlap with the poissonian fits. More... | |
def | calculate_binary_trace (self, trace, threshold) |
Calculate for a given threshold all the trace values und output a binary array, where True = Below or equal Threshold False = Above Threshold. More... | |
def | extract_filtered_values (self, trace, threshold, below=True) |
Extract only those values, which are below or equal a certain Threshold. More... | |
Public Attributes | |
hist_data | |
spin_flip_prob | |
fidelity_left | |
fidelity_right | |
trace | |
current_fit_function | |
debug_lifetime_x | |
debug_lifetime_y | |
Static Public Attributes | |
counterlogic1 = Connector(interface='CounterLogic') | |
savelogic = Connector(interface='SaveLogic') | |
fitlogic = Connector(interface='FitLogic') | |
sigHistogramUpdated = QtCore.Signal() | |
sigAnalysisResultsUpdated = QtCore.Signal() | |
Perform a gated counting measurement with the hardware.
def trace_analysis_logic.TraceAnalysisLogic.__init__ | ( | self, | |
config, | |||
kwargs | |||
) |
Create CounterLogic object with connectors.
dict | config: module configuration |
dict | kwargs: optional parameters |
def trace_analysis_logic.TraceAnalysisLogic.analyze_flip_prob | ( | self, | |
trace, | |||
num_bins = None , |
|||
threshold = None |
|||
) |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold.
np.array | trace: 1D trace of data |
int | num_bins: optional, if a specific size for the histogram is desired, which is used to calculate the threshold. |
float | threshold: optional, if a specific threshold is going to be used, otherwise the threshold is calculated from the data. |
def trace_analysis_logic.TraceAnalysisLogic.analyze_flip_prob2 | ( | self, | |
trace, | |||
threshold = 1 , |
|||
analyze_mode = 'full' |
|||
) |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold.
np.array | trace: 1D trace of data |
int | num_bins: optional, if a specific size for the histogram is desired, which is used to calculate the threshold. |
float | threshold: optional, if a specific threshold is going to be used, otherwise the threshold is calculated from the data. |
def trace_analysis_logic.TraceAnalysisLogic.analyze_flip_prob3 | ( | self, | |
trace, | |||
init_threshold = [1 , |
|||
ana_threshold = [1 , |
|||
analyze_mode = 'full' |
|||
) |
General method, which analysis how often a value was changed from one data point to another in relation to a certain threshold.
np.array | trace: 1D trace of data |
float | threshold: optional, if a specific threshold is going to be used, otherwise the threshold is calculated from the data. |
def trace_analysis_logic.TraceAnalysisLogic.analyze_flip_prob_postselect | ( | self | ) |
Post select the data trace so that the flip probability is only calculated from a jump from below a threshold value to an value above threshold.
def trace_analysis_logic.TraceAnalysisLogic.analyze_lifetime | ( | self, | |
trace, | |||
dt, | |||
method = 'postselect' , |
|||
distr = 'gaussian_normalized' , |
|||
state = '|-1>' , |
|||
num_bins = 50 |
|||
) |
Perform an lifetime analysis of a 1D time trace.
The analysis is based on the method provided ( for now only post select is implemented ).
numpy | array trace: 1 D array |
string | method: The method used for the lifetime analysis |
string | distr: distribution used for analysis |
string | state: State that the mw was applied to |
int | num_bins: number of bins used in the histogram to determine the threshold before digitalisation of data |
def trace_analysis_logic.TraceAnalysisLogic.calculate_binary_trace | ( | self, | |
trace, | |||
threshold | |||
) |
Calculate for a given threshold all the trace values und output a binary array, where True = Below or equal Threshold False = Above Threshold.
np.array | trace: a 1D array containing the y data, e.g. ccunts |
float | threshold: value to decide whether a point in the trace is below/equal (True) or above threshold (False). |
def trace_analysis_logic.TraceAnalysisLogic.calculate_histogram | ( | self, | |
trace, | |||
num_bins = None , |
|||
custom_bin_arr = None |
|||
) |
Calculate the histogram of a given trace.
np.array | trace: a 1D trace |
int | num_bins: number of bins between the minimal and maximal value of the trace. That must be an integer greater than or equal to 1. |
np.array | custom_bin_arr: optional, 1D array. If a specific, non-uniform binning array is desired then it can be passed to the numpy routine. Then the parameter num_bins is ignored. Otherwise a uniform binning is applied by default. |
def trace_analysis_logic.TraceAnalysisLogic.calculate_threshold | ( | self, | |
hist_data = None , |
|||
distr = 'poissonian' |
|||
) |
Calculate the threshold by minimizing its overlap with the poissonian fits.
np.array | hist_data: 2D array which represent the x and y values of a histogram of a trace. string tells the function on what distribution it should calculate the threshold ( Added because it might happen that one normalizes data between (-1,1) and then a poissonian distribution won't work anymore. |
def trace_analysis_logic.TraceAnalysisLogic.do_calculate_histogram | ( | self, | |
mode = 'normal' |
|||
) |
Passes all the needed parameters to the appropriated methods.
def trace_analysis_logic.TraceAnalysisLogic.do_fit | ( | self, | |
fit_function = None |
|||
) |
Makes the a fit of the current fit function.
str | fit_function: name of the chosen fit function. |
def trace_analysis_logic.TraceAnalysisLogic.do_gaussian_fit | ( | self, | |
axis, | |||
data | |||
) |
Perform a gaussian fit.
axis | |
data |
def trace_analysis_logic.TraceAnalysisLogic.do_no_fit | ( | self | ) |
Perform no fit, basically return an empty array.
def trace_analysis_logic.TraceAnalysisLogic.extract_filtered_values | ( | self, | |
trace, | |||
threshold, | |||
below = True |
|||
) |
Extract only those values, which are below or equal a certain Threshold.
np.array | trace: |
float | threshold: |
def trace_analysis_logic.TraceAnalysisLogic.get_fit_functions | ( | self | ) |
Return all fit functions, which are currently implemented for that module.
def trace_analysis_logic.TraceAnalysisLogic.get_poissonian | ( | self, | |
x_val, | |||
mu, | |||
amplitude | |||
) |
Calculate, bases on the passed values a poisson distribution.
float | mu: expected value of poisson distribution |
float | amplitude: Amplitude to which is multiplied on distribution |
int,float | or np.array x_val: x values for poisson distribution, also works for numbers (int or float) |
def trace_analysis_logic.TraceAnalysisLogic.guess_threshold | ( | self, | |
hist_val = None , |
|||
trace = None , |
|||
max_ratio_value = 0.1 |
|||
) |
Assume a distribution between two values and try to guess the threshold.
np.array | hist_val: 1D array which represent the y values of a histogram of a trace. Optional, if None is passed here, the passed trace will be used for calculations. |
np.array | trace: optional, 1D array containing the y values of a meausured counter trace. If None is passed to hist_y_val then the threshold will be calculated from the trace. |
float | max_ratio_value: the ratio how strong the lower y values will be cut off. For max_ratio_value=0.1 all the data which are 10% or less in amptitude compared to the maximal value are neglected. The guess procedure tries to find all values, which are max_ratio_value * maximum value of the histogram of the trace and selects those by indices. Then taking the first an the last might and assuming that the threshold is in the middle, gives a first estimate of the threshold value. FIXME That guessing procedure can be improved! |
def trace_analysis_logic.TraceAnalysisLogic.set_num_bins_histogram | ( | self, | |
num_bins, | |||
update = True |
|||
) |
Set the number of bins.
int | num_bins: number of bins for the histogram |
bool | update: if the change of bins should evoke a recalculation of the histogram. |