Skip to content

Commit

Permalink
adds clock rate to saved data
Browse files Browse the repository at this point in the history
  • Loading branch information
gadamc committed Feb 3, 2023
1 parent c6cb96a commit 617a2eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/applications/piezoscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 617a2eb

Please sign in to comment.