From 617a2eb59380801501640e47f9080f905aae9d09 Mon Sep 17 00:00:00 2001 From: G Adam Cox Date: Fri, 3 Feb 2023 13:25:39 -0800 Subject: [PATCH] adds clock rate to saved data --- src/applications/piezoscan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/applications/piezoscan.py b/src/applications/piezoscan.py index cbb3e1a0..0ed65233 100644 --- a/src/applications/piezoscan.py +++ b/src/applications/piezoscan.py @@ -420,17 +420,20 @@ def start_scan(self, event = None): self.scan_thread.start() def save_scan(self, event = None): - myformats = [('Compressed Numpy MultiArray', '*.npz'), ('Numpy Array', '*.npy'), ('HDF5', '*.h5')] + myformats = [('Compressed Numpy MultiArray', '*.npz'), ('Numpy Array (count rate only)', '*.npy'), ('HDF5', '*.h5')] afile = tk.filedialog.asksaveasfilename(filetypes=myformats, defaultextension='.npz') logger.info(afile) file_type = afile.split('.')[-1] if afile is None or afile == '': return # selection was canceled. - data = dict(raw_counts=self.counter_scanner.scanned_raw_counts, + data = dict( + raw_counts=self.counter_scanner.scanned_raw_counts, count_rate=self.counter_scanner.scanned_count_rate, scan_range=self.counter_scanner.get_completed_scan_range(), - step_size=self.counter_scanner.step_size) + step_size=self.counter_scanner.step_size, + daq_clock_rate=self.counter_scanner.rate_counter.clock_rate, + ) if file_type == 'npy': np.save(afile, data['count_rate'])