Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems connecting to Gatan camera #106

Open
komoto48g opened this issue Jan 9, 2025 · 0 comments
Open

Problems connecting to Gatan camera #106

komoto48g opened this issue Jan 9, 2025 · 0 comments

Comments

@komoto48g
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant