Skip to content

bug in writeeventfile if onset fields are {'onset' 'onset'} #243

@ReneSkukies

Description

@ReneSkukies

Hey,

there seems to be a check missing in the writeeventfile function. Early on, the function checks if an 'onset' field is already present in the data to be used as the 'onset' saved in the tsv file, otherwise it should use 'latency' as basis.

Later on onset is then calculated as

onset = (EEG.event(iEvent).(tmpField)-1)/EEG.srate

This only works if latency is the basis of onset, otherwise onset should be used as is (since it's already in seconds, per eeglab standard iirc)

I can make a PR with my fix (it's just including an additional if statement)

onset = (EEG.event(iEvent).(tmpField)-1)/EEG.srate;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions