summaryrefslogtreecommitdiffstats
path: root/tests/roof/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roof/config.py')
-rw-r--r--tests/roof/config.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/roof/config.py b/tests/roof/config.py
index e085ed8..8f72014 100644
--- a/tests/roof/config.py
+++ b/tests/roof/config.py
@@ -13,10 +13,15 @@ class RoofConfig:
self.path = self.get_opt('data', 'base_path', './')
self.planes = self.get_opt('hardware', 'planes', 1)
- self.modules = self.get_opt('hardware', 'modules', None)
- self.streams = self.get_opt('network', 'streams', 1 if self.modules is None else self.modules)
+ self.modules = self.get_opt('hardware', 'modules', 0)
+ self.streams = self.get_opt('network', 'streams', self.modules if self.modules else 1)
self.bit_depth = self.get_opt('hardware', 'bit_depth', 8)
+ self.sample_rate = self.get_opt('hardware', 'sample_rate', 0)
+ self.imaging_rate = self.get_opt('hardware', 'imaging_rate', 0)
+ self.fan_bins = self.modules * self.get_opt('hardware', 'channels_per_module', 16)
+ self.fan_projections = self.get_opt('hardware', 'samples_per_rotation', (self.sample_rate / self.imaging_rate) if (self.imaging_rate and self.sample_rate) else 1000)
+
if self.args.number is None: self.args.number = 0 if self.args.benchmark else self.planes
# Consistency and default mode
@@ -46,6 +51,13 @@ class RoofConfig:
if subpath is None: raise "Unknown data type %s is requested" % subpath
return subpath if subpath.startswith('/') else self.path + '/' + subpath
+ def get_roof_glob(self, data_type):
+ path = self.get_roof_path(data_type)
+ if path is None: return None
+
+ globre = re.compile('%.?(\d+)[luid]')
+ return globre.sub('*', path)
+
def get_writer_type(self):
return None if self.args.benchmark else self.args.write if self.args.write else 'raw_sinograms'