Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Casting issues with anaylising data from EyeLink(numpy and error)

edited November 2017 in PyGaze

Hi folks,

I'm trying to run analysis from an EyeLink file that has been converted from .edf to .asc. I'm using found here , if anybody is familiar. I had previously used this to run analysis on data gotten from using an EyeTribe, which worked fine. I've edited parts of the script to work with EyeLink. However, when I go to run the script, I get the following error:

cannot cast ufunc add output from dtype('float32') to dtype('uint8')

This points to line 402 in which reads:
screen[y:y+h,x:x+w,:] += img

Looking around online it seems that numpy became more strict on implicit casting and no longer allows casts between floating points and integers. I've tried downgrade to older numpy versions but that's sprang up different problems. There seems to be a number of solutions online, and I think I need to edit in some way but I'm not quite sure how.

Apologies if this isn't specific enough. If anybody has used PyGazeAnalyser on EyeLink data and encountered the same I'd love to hear from you.

Many thanks,


  • Hi Denis,

    Thanks for flagging this up! Seems to me like maybe we should make sure that both img and screen are of the same data type? If you edit the offending line to the following, does it help?

    screen[y:y+h,x:x+w,:] += img.astype(screen.dtype)


Sign In or Register to comment.