class pycollect.edfwriter.EDF(filename)[source]

Bases: object

Create an EDF+ file format.

__init__(filename)[source]

Create an EDF+ file format.

Parameters:filename (str) – Filename for new EDF+ file.
add_channel(channel)[source]

Add new chanel to current EDF+.

Parameters:chanel (EDFChannel object) –
save()[source]

Save as EDF+ file.

set_header(**kwargs)[source]

Sets the file header.

Parameters:
  • admincode (str) – Sets the admincode.
  • birthdate (date object from datetime) – Sets the birthdate.
  • equipment (str) – Describes the measurement equpipment.
  • gender (int) – Sets the gender, 1 is male, 0 is female.
  • patientcode (str) – Sets the patient code.
  • patientname (str) – Sets the patient name.
  • patient_additional (str) – Sets the additional patient info.
  • recording_additional (str) – Sets the additional recordinginfo.
  • startdate (datetime object) – Sets the recording start Time.
  • technician (str) – Sets the technicians name.
write_annotation(onset, description, duration=-1)[source]

Writes an annotation/event to the file.

Parameters:
  • onset (int) – Second, where happened the annotation
  • duration (int, optional) – Duration of event anotated
  • description (str) – Description of event
class pycollect.edfwriter.EDFChannel(data, **kwargs)[source]

Bases: object

New EDF+ channel.

__init__(data, **kwargs)[source]

New channel.

Parameters:
  • data (array, required) –
  • label (str, recommended) – channel label (string, <= 16 characters, must be unique
  • dimension (str, recommended) – physical dimension (e.g., mV) (string, <= 8 characters)
  • sample_rate (int, required) – sample frequency in hertz
  • physical_max (float, required) – maximum physical value
  • physical_min (float, required) – minimum physical value
  • digital_max (int, optional) – maximum digital value (int, -2**15 <= x < 2**15)
  • digital_min (int, optional) – minimum digital value (int, -2**15 <= x < 2**15)
  • transducer (str, optional) – sets the transducer used in this channel
  • prefilter (str, optional) – sets the prefilter used in this chanel (“HP:0.1Hz”, “LP:75Hz N:50Hz”, etc.)