-
Notifications
You must be signed in to change notification settings - Fork 17
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
Using Pymovements with MIT1003 #853
Comments
could you show the error you're getting? |
Here's the error: threshold does not provide enough variance as required by min_threshold ([0. 0.] < 1e-10) |
can you show the entire output? |
|
it seems that in your dataframe there are only 0. velocities, maybe you can loop over the files while extracting the events and check whether the dataframe is empty or just 0 velocities? |
if you run again into the problem feel free to reopen the issue |
Thank you! I found that the samples that were causing these problems had eye stationary eye tracking data so it made sense that they would lead to 0 velocities, as you suggested. I removed them and was able to run the code. However, now I'm getting a different error when trying to use the dataset.compute_event_properties: experiment = pm.gaze.Experiment( # parameters from some code provided by dataset creators
screen_width_px=1024,
screen_height_px=768,
screen_width_cm=40.5,
screen_height_cm=30,
distance_cm=75,
origin='upper left',
sampling_rate=240,
)
filename_format = r'{filename}.csv'
filename_format_dtypes = {
'filename': str,
}
custom_read_kwargs = {
'separator': ',',
}
time_unit = 'step'
pixel_columns = ['x', 'y']
dataset_definition = pm.DatasetDefinition(
name='my_dataset',
experiment=experiment,
filename_format=filename_format,
filename_format_dtypes=filename_format_dtypes,
custom_read_kwargs=custom_read_kwargs,
time_column=time_column,
time_unit=time_unit,
pixel_columns=pixel_columns,
)
dataset = pm.Dataset(
definition=dataset_definition,
path='/shared/project-storage/users/nisar2/projects/pymovement/data/MIT1003',
)
dataset.load()
dataset.pix2deg()
dataset.pos2vel(method='savitzky_golay', degree=2, window_length=7)
dataset.apply('pos2acc', degree=2, window_length=7)
dataset.detect_events('ivt')
dataset.detect_events('microsaccades')
dataset.compute_event_properties("dispersion") # breaks here here is the error output:
|
hi -- thank you for your feedback -- the code you're showing and the code that outputs the error seem to be not the same.could you provide the output for your actual code snippet? |
however, the error indicates that no event were detect, could you check if this happens for one of the event dataframes? we should integrate a more helpful error message if this is the case. |
Hi sorry for that. Here is the code: experiment = pm.gaze.Experiment( # parameters from some code provided by dataset creators
screen_width_px=1024,
screen_height_px=768,
screen_width_cm=40.5,
screen_height_cm=30,
distance_cm=75,
origin='upper left',
sampling_rate=240,
)
filename_format = r'{filename}.csv'
filename_format_dtypes = {
'filename': str,
}
custom_read_kwargs = {
'separator': ',',
}
time_unit = 'step'
pixel_columns = ['x', 'y']
dataset_definition = pm.DatasetDefinition(
name='my_dataset',
experiment=experiment,
filename_format=filename_format,
filename_format_dtypes=filename_format_dtypes,
custom_read_kwargs=custom_read_kwargs,
time_column=time_column,
time_unit=time_unit,
pixel_columns=pixel_columns,
)
dataset = pm.Dataset(
definition=dataset_definition,
path='/shared/project-storage/users/nisar2/projects/pymovement/data/MIT1003',
)
dataset.load()
dataset.pix2deg()
dataset.pos2vel(method='savitzky_golay', degree=2, window_length=7)
dataset.apply('pos2acc', degree=2, window_length=7)
dataset.detect_events('ivt')
dataset.detect_events('microsaccades')
dataset.compute_event_properties("dispersion") # breaks here and the correct output/error message:
Regarding your second comment, it seems that detecting events like fixations and microsaccades works fine, but the issue is when I try to use compute_event_properties. Also, computing event properties works for many samples of data before crashing on the 5041 example. I hope I answered your question, but let me know if I can clarify further. |
can you reinstall pymovements from source, and then run again? if the error persists I'll reproduce it on my machine and patch it! thank you so much for your coorperation |
Question
Hi. I'm trying to analyze the MIT1003 dataset and perform some processing on it. I get an error when detecting microsaccades: threshold does not provide enough variance as required by min_threshold ([0. 0.] < 1e-10). The code runs for several files but eventually breaks. I think I'm probably setting up things incorrectly.
Sample Code
Please include relevant code snippets or files that provide context for your question.
One of the data files is attached:
ajs_i05june05_static_street_boston_p1010764.csv
The text was updated successfully, but these errors were encountered: