I am getting an (Infinite loop) error when trying to connect to a Gatan K3 camera using "gatansocket3.py".
After some research, I found this error might be due to a type mismatch: on Windows 10 (64-bit) platform, np.int_ is np.int64 (long long), not np.int32 (long).
For example, the following part raises ValueError: buffer size must be a multiple of element size because the 4 byte chars are being converted into an 8-byte array.
|
# filter name |
|
filt_str = filt + '\0' |
|
extra = len(filt_str) % 4 |
|
if extra: |
|
npad = 4 - extra |
|
filt_str = filt_str + npad * '\0' |
|
longarray = np.frombuffer(filt_str.encode(), dtype=np.int_) |
Best regards, K
I am getting an (Infinite loop) error when trying to connect to a Gatan K3 camera using "gatansocket3.py".
After some research, I found this error might be due to a type mismatch: on Windows 10 (64-bit) platform,
np.int_isnp.int64(long long), not np.int32 (long).For example, the following part raises
ValueError: buffer size must be a multiple of element sizebecause the 4 byte chars are being converted into an 8-byte array.instamatic/src/instamatic/camera/gatansocket3.py
Lines 339 to 345 in f9cf3f7
Best regards, K