py4dstem / py4DSTEM

GNU General Public License v3.0
199 stars 135 forks source link

dp_mask not on device #651

Closed ARSadri closed 4 months ago

ARSadri commented 4 months ago

thanks for your useful fast software

dp_mask not on device

When passing dp_mask to reconstruct in multislice ptychography, i sent a 2d numpy, Debug shows that in the following file/line dp_mask is not on device:

py4DSTEM/py4DSTEM/process/phase/phase_base_class.py : line 689, intensities_mask = intensities * dp_mask

My workaround::

    intensities_mask = intensities * copy_to_device(dp_mask, device)

py4DSTEM version 0.14.8

Best regards Alireza

gvarnavi commented 4 months ago

Thanks for reporting the issue @ARSadri.
Indeed, this was a bug that has been fixed a while ago (circa version 0.14.9).

For your reference, this the updated line in the current version.

Can you perhaps update to the newest version (0.14.14)? Note the API has changed a bit, as discussed at the top of the README file. Hoping to find time update the tutorials very soon..