Skip to content

Problems connecting to Gatan camera #106

@komoto48g

Description

@komoto48g

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions