Skip to content

Commit 725e7a6

Browse files
committed
Produces EDF file from WFDB format
1 parent c698f03 commit 725e7a6

File tree

4 files changed

+404
-6
lines changed

4 files changed

+404
-6
lines changed

wfdb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from wfdb.io.record import (Record, MultiRecord, rdheader, rdrecord, rdsamp,
2-
wrsamp, dl_database, edf2mit, wav2mit, wfdb2mat, sampfreq, signame)
2+
wrsamp, dl_database, edf2mit, mit2edf, wav2mit, wfdb2mat, sampfreq, signame)
33
from wfdb.io.annotation import (Annotation, rdann, wrann, show_ann_labels,
44
show_ann_classes, ann2rr)
55
from wfdb.io.download import get_dbs, get_record_list, dl_files, set_db_index_url

wfdb/io/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from wfdb.io.record import (Record, MultiRecord, rdheader, rdrecord, rdsamp, wrsamp,
2-
dl_database, edf2mit, wav2mit, wfdb2mat, sampfreq, signame, SIGNAL_CLASSES)
2+
dl_database, edf2mit, mit2edf, wav2mit, wfdb2mat, sampfreq, signame, SIGNAL_CLASSES)
33
from wfdb.io._signal import est_res, wr_dat_file
44
from wfdb.io.annotation import (Annotation, rdann, wrann, show_ann_labels,
55
show_ann_classes, ann2rr)

wfdb/io/_signal.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def adc(self, expanded=False, inplace=False):
432432
for ch in range(self.n_sig):
433433
# NAN locations for the channel
434434
ch_nanlocs = np.isnan(self.e_p_signal[ch])
435-
ch_d_signal = self.e_p_signal.copy()
435+
ch_d_signal = self.e_p_signal[ch].copy()
436436
np.multiply(ch_d_signal, self.adc_gain[ch], ch_d_signal)
437437
np.add(ch_d_signal, self.baseline[ch], ch_d_signal)
438438
ch_d_signal = ch_d_signal.astype(intdtype, copy=False)
@@ -704,9 +704,14 @@ def convert_dtype(self, physical, return_res, smooth_frames):
704704
if current_dtype != return_dtype:
705705
self.p_signal = self.p_signal.astype(return_dtype, copy=False)
706706
else:
707-
for ch in range(self.n_sig):
708-
if self.e_p_signal[ch].dtype != return_dtype:
709-
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
707+
if self.e_p_signal is not None:
708+
for ch in range(self.n_sig):
709+
if self.e_p_signal[ch].dtype != return_dtype:
710+
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
711+
else:
712+
for ch in range(self.n_sig):
713+
if self.p_signal[ch].dtype != return_dtype:
714+
self.p_signal[ch] = self.p_signal[ch].astype(return_dtype, copy=False)
710715
else:
711716
return_dtype = 'int'+str(return_res)
712717
if smooth_frames is True:

0 commit comments

Comments
 (0)