Core Features
arora.core.get_signal
arora.core.get_signal(file, signal_name)
- Parameters:
- filestr
Path to the edf file that is to be imported
- signal_namestr or list of str or list of dict
The name of the signals that is wanted, can also be a list of signals that are wanted
- Returns:
List of all the signals that were requested.
For example:
>>> foldername = "path/to/file/file.edf"
>>> arora.core.get_signals(foldername, 'cRIP Flow')
[array([2.42926359e-06, 2.45956329e-06, 2.42926589e-06, ...,
2.45226589e-06, 2.45226389e-06, 2.45926359e-06])]
arora.core.epochize
arora.core.epochize(data, channel_name, epoch_len, sampling_freq)
Note
This method is in development.
- Parameters:
- datalist of int
The signal data
- channel_namelist of str
The names of the channels to be used
- epoch_lenint
The length of the epoch
- sampling_freqint or float
The sampling frequency of the data
start_timestamp : ?
- Returns
A dataframe with the epochs - will be changed later on to a tuple with the epoch, start and duration
For example:
>>> arora.core.epochize()
arora.core.segmentation
arora.core.segmentation(signals, freq, onset, duration, only_signal, time_unit)
- Parameters:
- signalslist of int or float
List of the signals given in a 1D array
- freqfloat, default is 250
The frequency of the signals
- onsetint, default is 0
The beginning onset in seconds
- durationint, default 30
The duration of the segment in the time_unit specified (sec, min, hour)
- only_signalbool, default is False
If the boolean is true then it will only return the signal list. This can be used to lessen the overhead of the signal
- time_unitstr, optional, default is sec
the time unit for the duration option of sec, min and hour
- Returns:
- If only_signal is False then:
A list of EEG signals and pandas DataFrame including the beginning and end index of the sample
- If only_signal is True then:
A list of EEG signals
For example:
>>> signals = [823, 99, 5, 5, 16, 84, 26, 11, 10, 12, 55, 29, 30, 82, 99, 5, 5, 16, 84, 26, 11, 10, 12, 55, 29, 30, 82, 99, 5, 5, 16, 84, 26, 11, 10, 12, 55, 29, 30] # dummy data
>>> arora.core.segmentation(signals, 1, 2, 10)
([[5, 5, 16, 84, 26, 11, 10, 12, 55, 29, 30],
[82, 99, 5, 5, 16, 84, 26, 11, 10, 12],
[55, 29, 30, 82, 99, 5, 5, 16, 84, 26]],
beg_index end_index
0 23 32
1 13 22
2 2 12)