Commit 8d005525 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Use float32 for data

parent 73d740b2
Pipeline #23726 passed with stages
in 2 minutes and 32 seconds
......@@ -121,7 +121,7 @@ class _ScanMock:
if self.scene == 'noise':
return numpy.random.random((self.det_height * self.det_width)).reshape((self.det_width, self.det_height))
elif self.scene == 'increasing value':
return numpy.zeros((self.det_width, self.det_height)) + index
return numpy.zeros((self.det_width, self.det_height), dtype="f") + index
elif self.scene == 'arange':
start = index * (self.det_height * self.det_width)
stop = (index + 1) * (self.det_height * self.det_width)
......@@ -190,7 +190,8 @@ class MockHDF5(_ScanMock):
scan_range=scan_range,
n_recons=n_recons,
n_pag_recons=n_pag_recons,
recons_vol=recons_vol, dim=dim)
recons_vol=recons_vol, dim=dim,
scene=scene)
if create_ini_dark:
self.add_initial_dark()
if create_ini_ref:
......@@ -201,7 +202,7 @@ class MockHDF5(_ScanMock):
def add_initial_dark(self):
dark = numpy.random.random((self.det_height * self.det_width)).reshape(
(1, self.det_width, self.det_height))
(1, self.det_width, self.det_height)).astype("f")
self._append_frame(data_=dark,
rotation_angle=self.rotation_angle[-1],
image_key=ImageKey.DARK_FIELD.value,
......@@ -210,7 +211,7 @@ class MockHDF5(_ScanMock):
def add_initial_ref(self):
for i in range(self._n_refs):
flat = numpy.random.random((self.det_height * self.det_width)).reshape(
(1, self.det_width, self.det_height))
(1, self.det_width, self.det_height)).astype("f")
self._append_frame(data_=flat,
rotation_angle=self.rotation_angle[0],
image_key=ImageKey.FLAT_FIELD.value,
......@@ -219,7 +220,7 @@ class MockHDF5(_ScanMock):
def add_final_ref(self):
for i in range(self._n_refs):
flat = numpy.random.random((self.det_height * self.det_width)).reshape(
(1, self.det_width, self.det_height))
(1, self.det_width, self.det_height)).astype("f")
self._append_frame(data_=flat,
rotation_angle=self.rotation_angle[-1],
image_key=ImageKey.FLAT_FIELD.value,
......@@ -227,6 +228,7 @@ class MockHDF5(_ScanMock):
def add_radio(self, index=None):
radio = self._get_radio_data(index=index)
radio = radio.reshape((1, self.det_height, self.det_width))
self._append_frame(data_=radio,
rotation_angle=self.rotation_angle[index],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment