| DIY Auto-Correlator 1.0
    Auto-Correlator Card implementation using Teensy 4.x microcontrollers. | 
| Functions | |
| def | update_fn () | 
| def | periodic_callback_fn (period_ms=measurement_sampling_delay) | 
| Variables | |
| name_ = sys.argv[1] | |
| config = json.load(f) | |
| list | multitau_param_set = [config['LinCorrs'], config['SeriesSize'], config['BinRatio']] | 
| this_channel_size = multitau.channel_size(*multitau_param_set) | |
| int | byte_size = 4 | 
| tuple | total_struct_size | 
| bool | stop_code_asserted = False | 
| int | update_id = 0 | 
| list | openfilelist = [] | 
| string | parent_dir = "./runs/" | 
| string | DATASEP = ',' | 
| now_tmp = time.perf_counter() | |
| update_time_start = now_tmp | |
| update_time_stop = now_tmp | |
| measure_clock_start = now_tmp | |
| measure_clock_stop = now_tmp | |
| x_tau_values = multitau.x_tics(*multitau_param_set) | |
| normalizer = Normalizer(*multitau_param_set) | |
| tuple | norm_mode = ("no" * (not config["EnablePointsNorm"])) + ("points" * (not config["EnableMeanNorm"]) * config["EnablePointsNorm"]) + ("mean" * config["EnableMeanNorm"] * config["EnablePointsNorm"]) | 
| list | norm_args = [] | 
| struct_rep = StructRepresentation(config) | |
| time_x = deque(maxlen = 100) | |
| count_rate_y = deque(maxlen = 100) | |
| mean_int_y = deque(maxlen = 100) | |
| pf_serial_y = deque(maxlen = 100) | |
| pf_acf_y = deque(maxlen = 100) | |
| string | y_file_name = f"{name_}_y.dat" | 
| string | x_file_name = f"{name_}_x_taus.dat" | 
| fmt | |
| newline | |
| acffile = open(os.path.join(parent_dir, y_file_name), 'a') | |
| string | count_file_name = f"{name_}_countrate.dat" | 
| countratefile = open(os.path.join(parent_dir, count_file_name), 'w') | |
| string | mean_file_name = f"{name_}_meanintensity.dat" | 
| meanfile = open(os.path.join(parent_dir, mean_file_name), 'w') | |
| live_graph = LiveGraph(xRange=x_tau_values[-1], port=config['Port'], title="Auto-Correlation Function", x_label = "Lag", y_label="ACF", x_units="Tau", y_units="G(Tau)", config=config ) | |
| title | |
| row | |
| col | |
| rowspan | |
| pen | |
| symbolBrush | |
| symbolSize | |
| port = Serial(port=config["Port"], baudrate=config["Baud"], timeout=None) | |
| measurement_sampling_delay = int(config['SamplingDelay_ms']/2) | |
| measurement_thread = QtCore.QTimer() | |
| tuple | received_data_estimate = total_struct_size * update_id | 
| def photon_statistics.periodic_callback_fn | ( | period_ms = measurement_sampling_delay | ) | 
| def photon_statistics.update_fn | ( | ) | 
| photon_statistics.acffile = open(os.path.join(parent_dir, y_file_name), 'a') | 
| int photon_statistics.byte_size = 4 | 
| photon_statistics.col | 
| photon_statistics.config = json.load(f) | 
| string photon_statistics.count_file_name = f"{name_}_countrate.dat" | 
| photon_statistics.count_rate_y = deque(maxlen = 100) | 
| photon_statistics.countratefile = open(os.path.join(parent_dir, count_file_name), 'w') | 
| string photon_statistics.DATASEP = ',' | 
| photon_statistics.fmt | 
| photon_statistics.live_graph = LiveGraph(xRange=x_tau_values[-1], port=config['Port'], title="Auto-Correlation Function", x_label = "Lag", y_label="ACF", x_units="Tau", y_units="G(Tau)", config=config ) | 
| string photon_statistics.mean_file_name = f"{name_}_meanintensity.dat" | 
| photon_statistics.mean_int_y = deque(maxlen = 100) | 
| photon_statistics.meanfile = open(os.path.join(parent_dir, mean_file_name), 'w') | 
| photon_statistics.measure_clock_start = now_tmp | 
| photon_statistics.measure_clock_stop = now_tmp | 
| photon_statistics.measurement_sampling_delay = int(config['SamplingDelay_ms']/2) | 
| photon_statistics.measurement_thread = QtCore.QTimer() | 
| list photon_statistics.multitau_param_set = [config['LinCorrs'], config['SeriesSize'], config['BinRatio']] | 
| photon_statistics.name_ = sys.argv[1] | 
| photon_statistics.newline | 
| list photon_statistics.norm_args = [] | 
| tuple photon_statistics.norm_mode = ("no" * (not config["EnablePointsNorm"])) + ("points" * (not config["EnableMeanNorm"]) * config["EnablePointsNorm"]) + ("mean" * config["EnableMeanNorm"] * config["EnablePointsNorm"]) | 
| photon_statistics.normalizer = Normalizer(*multitau_param_set) | 
| photon_statistics.now_tmp = time.perf_counter() | 
| list photon_statistics.openfilelist = [] | 
| string photon_statistics.parent_dir = "./runs/" | 
| photon_statistics.pen | 
| photon_statistics.pf_acf_y = deque(maxlen = 100) | 
| photon_statistics.pf_serial_y = deque(maxlen = 100) | 
| tuple photon_statistics.received_data_estimate = total_struct_size * update_id | 
| photon_statistics.row | 
| photon_statistics.rowspan | 
| bool photon_statistics.stop_code_asserted = False | 
| photon_statistics.struct_rep = StructRepresentation(config) | 
| photon_statistics.symbolBrush | 
| photon_statistics.symbolSize | 
| photon_statistics.this_channel_size = multitau.channel_size(*multitau_param_set) | 
| photon_statistics.time_x = deque(maxlen = 100) | 
| photon_statistics.title | 
| int photon_statistics.total_struct_size | 
| int photon_statistics.update_id = 0 | 
| photon_statistics.update_time_start = now_tmp | 
| photon_statistics.update_time_stop = now_tmp | 
| string photon_statistics.x_file_name = f"{name_}_x_taus.dat" | 
| photon_statistics.x_tau_values = multitau.x_tics(*multitau_param_set) | 
| string photon_statistics.y_file_name = f"{name_}_y.dat" |