<commit_before>## Overview

An EDF parser written in coffee-script.

Primarily used for Polysomnographic signals, the EDF file format is multi-channel, supports multiple sampling rates on a per channel basis, and provides for an unlimited number of channels. More information can be found on the [wikipedia article](http://en.wikipedia.org/wiki/European_Data_Format).

## Usage and Examples

#### A simple Example
```CoffeeScript
util    = require "util"
edf             = require "edf"

# Create a new instance of edf.EDFFile.
my_edf = new edf.EDFFile "./path/to/some.edf"

# Get some information about the file.
file_duration   = my_edf.get_file_duration( )
num_signals     = my_edf.get_header_item "num_signals_in_data_record"

util.log "The file is " + file_duration + " seconds in length."
util.log "There are " + num_signals + " signals in this file."

# Get some information about the signals.
for signal_index in [0..num_signals-1]
        signal_label    = my_edf.get_signal_item signal_index, "label"
        sample_rate     = my_edf.get_header_item( "duration_of_data_record" ) / my_edf.get_signal_item( signal_index, "num_samples_in_data_record" )
        min             = my_edf.get_signal_item signal_index, "physical_min"
        max             = my_edf.get_signal_item signal_index, "physical_max"

        util.log signal_label + " has a sampling rate of " + sample_rate + " Hz."
        util.log signal_label + " has a min and max of " + min + ": " + max  + "."
```

#### Available header information

The following items are available in the EDF header and can be accessed by using ``get_header_item``.
 * version
 * patient_id
 * recording_id
 * start_date
 * start_time
 * number_of_bytes
 * reserved
 * num_data_records
 * duration_of_data_record
 * num_signals_in_data_record
 
These items are available using ``get_signal_item``. A signal index must be passed along as the first argument.
 * label
 * transducer_type
 * physical_dimensions
 * physical_min
 * physical_max
 * digital_min
 * digital_max
 * prefiltering
 * num_samples_in_data_record

## License
Three clause BSD. See [LICENSE](LICENSE).

## Thanks
Original work sponsored by [Younes Sleep Technologies](http://younessleeptechnologies.com/).
<commit_msg>Stupid tabbing.<commit_after>## Overview

An EDF parser written in coffee-script.

Primarily used for Polysomnographic signals, the EDF file format is multi-channel, supports multiple sampling rates on a per channel basis, and provides for an unlimited number of channels. More information can be found on the [wikipedia article](http://en.wikipedia.org/wiki/European_Data_Format).

## Usage and Examples

#### A simple Example
```CoffeeScript
util	= require "util"
edf		= require "edf"

# Create a new instance of edf.EDFFile.
my_edf = new edf.EDFFile "./path/to/some.edf"

# Get some information about the file.
file_duration	= my_edf.get_file_duration( )
num_signals	= my_edf.get_header_item "num_signals_in_data_record"

util.log "The file is " + file_duration + " seconds in length."
util.log "There are " + num_signals + " signals in this file."

# Get some information about the signals.
for signal_index in [0..num_signals-1]
	signal_label	= my_edf.get_signal_item signal_index, "label"
	sample_rate	= my_edf.get_header_item( "duration_of_data_record" ) / my_edf.get_signal_item( signal_index, "num_samples_in_data_record" )
	min		= my_edf.get_signal_item signal_index, "physical_min"
	max		= my_edf.get_signal_item signal_index, "physical_max"

	util.log signal_label + " has a sampling rate of " + sample_rate + " Hz."
	util.log signal_label + " has a min and max of " + min + ": " + max  + "."
```

#### Available header information

The following items are available in the EDF header and can be accessed by using ``get_header_item``.
 * version
 * patient_id
 * recording_id
 * start_date
 * start_time
 * number_of_bytes
 * reserved
 * num_data_records
 * duration_of_data_record
 * num_signals_in_data_record
 
These items are available using ``get_signal_item``. A signal index must be passed along as the first argument.
 * label
 * transducer_type
 * physical_dimensions
 * physical_min
 * physical_max
 * digital_min
 * digital_max
 * prefiltering
 * num_samples_in_data_record

## License
Three clause BSD. See [LICENSE](LICENSE).

## Thanks
Original work sponsored by [Younes Sleep Technologies](http://younessleeptechnologies.com/).

{'fraction_non_alphanumeric': 0.08751989088429188, 'fraction_numerical': 0.0009092975676290066, 'mean_word_length': 4.275779376498801, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3644447', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1372, 'n_words': 423}