added counters keyword to scan.Scans scans

This commit is contained in:
2019-06-04 14:55:30 +02:00
parent a4d18879ab
commit 140eeed9a5
2 changed files with 14 additions and 7 deletions
+2 -2
View File
@@ -154,8 +154,8 @@ class BStools:
def acquire(self, file_name=None, Npulses=100):
file_name += ".h5"
if default_path:
fina = self._default_file_path % fina
if self._default_file_path:
file_name = self._default_file_path % file_name
def acquire():
self.h5(fina=file_name, N_pulses=Npulses)
+12 -5
View File
@@ -181,11 +181,13 @@ class Scans:
self.checker = checker
self._scan_directories = scan_directories
def a2scan(self,adjustable0,start0_pos,end0_pos,adjustable1,start1_pos,end1_pos,N_intervals,N_pulses,file_name=None,start_immediately=True, step_info = None):
def a2scan(self,adjustable0,start0_pos,end0_pos,adjustable1,start1_pos,end1_pos,N_intervals,N_pulses,file_name=None,counters=[], start_immediately=True, step_info = None):
positions0 = np.linspace(start0_pos,end0_pos,N_intervals+1)
positions1 = np.linspace(start1_pos,end1_pos,N_intervals+1)
values = [[tp0,tp1] for tp0,tp1 in zip(positions0,positions1)]
s = Scan([adjustable0, adjustable1],values,self._default_counters,file_name,Npulses=N_pulses,basepath=self.data_base_dir,scan_info_dir=self.scan_info_dir,checker=self.checker,scan_directories=self._scan_directories)
if not counters:
counters = self._default_counters
s = Scan([adjustable0, adjustable1],values,self.counters,file_name,Npulses=N_pulses,basepath=self.data_base_dir,scan_info_dir=self.scan_info_dir,checker=self.checker,scan_directories=self._scan_directories)
if start_immediately:
s.scanAll(step_info=step_info)
return s
@@ -198,16 +200,19 @@ class Scans:
N_intervals,
N_pulses,
file_name="",
counters=[],
start_immediately=True,
step_info=None,
):
positions = np.linspace(start_pos, end_pos, N_intervals + 1)
values = [[tp] for tp in positions]
file_name = self.filename_generator.get_nextrun_filename(file_name)
if not counters:
counters = self._default_counters
s = Scan(
[adjustable],
values,
self._default_counters,
counters,
file_name,
Npulses=N_pulses,
basepath=self.data_base_dir,
@@ -227,6 +232,7 @@ class Scans:
N_intervals,
N_pulses,
file_name="",
counters=[],
start_immediately=True,
):
positions = np.linspace(start_pos, end_pos, N_intervals + 1)
@@ -236,7 +242,7 @@ class Scans:
s = Scan(
[adjustable],
values,
self._default_counters,
counters,
file_name,
Npulses=N_pulses,
basepath=self.data_base_dir,
@@ -260,6 +266,7 @@ class Scans:
posList,
N_pulses,
file_name="",
counters=[],
start_immediately=True,
step_info=None,
):
@@ -269,7 +276,7 @@ class Scans:
s = Scan(
[adjustable],
values,
self._default_counters,
counters,
file_name,
Npulses=N_pulses,
basepath=self.data_base_dir,