slmsuite / slmsuite-examples

slmsuite examples in notebook format.
https://slmsuite.readthedocs.io/en/latest/examples.html
MIT License
0 stars 1 forks source link

Error message for simulated camera in simulation example #1

Closed lufermar closed 1 year ago

lufermar commented 1 year ago

Hi, I tried to execute the 'simulation' example but got an error message for the cell:

# Take a sample picture
img = cam.get_image(plot=False)
plt.imshow(img)

The error message is the following one:

RuntimeError Traceback (most recent call last) /var/folders/c5/vbgkkc494z3f_phk_nrp33n40000gn/T/ipykernel_2435/452030160.py in 1 # Take a sample picture ----> 2 img = cam.get_image(plot=False) 3 plt.imshow(img)

~/opt/anaconda3/lib/python3.8/site-packages/slmsuite/hardware/cameras/simulated.py in get_image(self, plot) 135 # Update phase; calculate the far-field 136 self._hologram.reset_phase(self._slm.phase + self._slm.phase_offset) --> 137 ff = self._hologram.extract_farfield(affine=self.affine) 138 139 # INCORRECT! Unpadding FF to same resolution --> magnification.

~/opt/anaconda3/lib/python3.8/site-packages/slmsuite/holography/algorithms.py in extract_farfield(self, affine) 1144 else: 1145 if affine is not None: -> 1146 sp_affine_transform( 1147 input=farfield, 1148 matrix=affine["M"],

~/opt/anaconda3/lib/python3.8/site-packages/scipy/ndimage/interpolation.py in affine_transform(input, matrix, offset, output_shape, output, order, mode, cval, prefilter) 560 kwargs = dict(offset=offset, output_shape=output_shape, order=order, 561 mode=mode, prefilter=prefilter) --> 562 affine_transform(input.real, matrix, output=output.real, 563 cval=numpy.real(cval), **kwargs) 564 affine_transform(input.imag, matrix, output=output.imag,

~/opt/anaconda3/lib/python3.8/site-packages/scipy/ndimage/interpolation.py in affine_transform(input, matrix, offset, output_shape, output, order, mode, cval, prefilter) 597 offset = numpy.asarray(offset, dtype=numpy.float64) 598 if offset.ndim != 1 or offset.shape[0] < 1: --> 599 raise RuntimeError('no proper offset provided') 600 if not offset.flags.contiguous: 601 offset = offset.copy()

RuntimeError: no proper offset provided

I am running python 3.8 on a Mac with Intel. Other examples which did not include hardware .dlls worked in the past. I also checked that I was running the correct branch. What could the issue be? Best, L.

lufermar commented 1 year ago

Solved using a Windows.