[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ishiikurisu/edf

Repository files navigation

Go support for EDF+

This package provides a Go implementation of the EDF format. It reads EDF+ files into one struct containing:

  • A map from strings to strings, representing the main header in the EDF file.
  • A slice of slices of int16, each one representing one channel's recording.
  • A slice of slices of float64, each one representing the physical values of one channel's recording.

These structures are generated by the ReadFile(string) function and stored in a struct. The header information can be accessed through the keys given by the GetSpecsList() function. This query will give the raw string contained in the EDF file to be processed.

The records can be accessed through their label's index. They are stored in their raw form (int16) and in their converted (=physical) form (float64).

Getting started

To install the EDF lib, run on terminal:

go get github.com/ishiikurisu/edf

Then import it on your code:

import "github.com/ishiikurisu/edf"
import "fmt"

func main() {
    edfFile := "your_file.edf"
    edfContents := edf.ReadFile(edfFile)
    fmt.Println(edfContents.WriteCSV())
}