DIY Auto-Correlator 1.0
Auto-Correlator Card implementation using Teensy 4.x microcontrollers.
Functions | Variables
photon_statistics Namespace Reference

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
 

Function Documentation

◆ periodic_callback_fn()

def photon_statistics.periodic_callback_fn (   period_ms = measurement_sampling_delay)

◆ update_fn()

def photon_statistics.update_fn ( )

Variable Documentation

◆ acffile

photon_statistics.acffile = open(os.path.join(parent_dir, y_file_name), 'a')

◆ byte_size

int photon_statistics.byte_size = 4

◆ col

photon_statistics.col

◆ config

photon_statistics.config = json.load(f)

◆ count_file_name

string photon_statistics.count_file_name = f"{name_}_countrate.dat"

◆ count_rate_y

photon_statistics.count_rate_y = deque(maxlen = 100)

◆ countratefile

photon_statistics.countratefile = open(os.path.join(parent_dir, count_file_name), 'w')

◆ DATASEP

string photon_statistics.DATASEP = ','

◆ fmt

photon_statistics.fmt

◆ live_graph

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 )

◆ mean_file_name

string photon_statistics.mean_file_name = f"{name_}_meanintensity.dat"

◆ mean_int_y

photon_statistics.mean_int_y = deque(maxlen = 100)

◆ meanfile

photon_statistics.meanfile = open(os.path.join(parent_dir, mean_file_name), 'w')

◆ measure_clock_start

photon_statistics.measure_clock_start = now_tmp

◆ measure_clock_stop

photon_statistics.measure_clock_stop = now_tmp

◆ measurement_sampling_delay

photon_statistics.measurement_sampling_delay = int(config['SamplingDelay_ms']/2)

◆ measurement_thread

photon_statistics.measurement_thread = QtCore.QTimer()

◆ multitau_param_set

list photon_statistics.multitau_param_set = [config['LinCorrs'], config['SeriesSize'], config['BinRatio']]

◆ name_

photon_statistics.name_ = sys.argv[1]

◆ newline

photon_statistics.newline

◆ norm_args

list photon_statistics.norm_args = []

◆ norm_mode

tuple photon_statistics.norm_mode = ("no" * (not config["EnablePointsNorm"])) + ("points" * (not config["EnableMeanNorm"]) * config["EnablePointsNorm"]) + ("mean" * config["EnableMeanNorm"] * config["EnablePointsNorm"])

◆ normalizer

photon_statistics.normalizer = Normalizer(*multitau_param_set)

◆ now_tmp

photon_statistics.now_tmp = time.perf_counter()

◆ openfilelist

list photon_statistics.openfilelist = []

◆ parent_dir

string photon_statistics.parent_dir = "./runs/"

◆ pen

photon_statistics.pen

◆ pf_acf_y

photon_statistics.pf_acf_y = deque(maxlen = 100)

◆ pf_serial_y

photon_statistics.pf_serial_y = deque(maxlen = 100)

◆ port

photon_statistics.port = Serial(port=config["Port"], baudrate=config["Baud"], timeout=None)

◆ received_data_estimate

tuple photon_statistics.received_data_estimate = total_struct_size * update_id

◆ row

photon_statistics.row

◆ rowspan

photon_statistics.rowspan

◆ stop_code_asserted

bool photon_statistics.stop_code_asserted = False

◆ struct_rep

photon_statistics.struct_rep = StructRepresentation(config)

◆ symbolBrush

photon_statistics.symbolBrush

◆ symbolSize

photon_statistics.symbolSize

◆ this_channel_size

photon_statistics.this_channel_size = multitau.channel_size(*multitau_param_set)

◆ time_x

photon_statistics.time_x = deque(maxlen = 100)

◆ title

photon_statistics.title

◆ total_struct_size

int photon_statistics.total_struct_size
Initial value:
1= ( (config['EnableACFCalc'] * this_channel_size) +
2 config['EnableCountRate'] +
3 config['EnablePointsNorm'] +
4 config['EnableSyncCode'] +
5 config['EnableMeanNorm'] +
6 config['Enable PC Histogram'] * config['PC Histogram Bins'] +
7 ((config['EnableACFCalc'] + 1) * config['Enable Performance Counters'])
8 ) * byte_size

◆ update_id

int photon_statistics.update_id = 0

◆ update_time_start

photon_statistics.update_time_start = now_tmp

◆ update_time_stop

photon_statistics.update_time_stop = now_tmp

◆ x_file_name

string photon_statistics.x_file_name = f"{name_}_x_taus.dat"

◆ x_tau_values

photon_statistics.x_tau_values = multitau.x_tics(*multitau_param_set)

◆ y_file_name

string photon_statistics.y_file_name = f"{name_}_y.dat"