Commits

Chris Lee-Messer committed b4da5b8 Merge
  • Participants
  • Parent commits 462a3c6, b083e71

Comments (0)

Files changed (1)

File edflib/_edflib.pyx

         def __get__(self):
             return self.hdr.annotations_in_file
 
+    property patientcode:
+        def __get__(self):
+            return self.hdr.patientcode
+
+    property gender:
+        def __get__(self):
+            return self.hdr.gender
+
+    property birthdate:
+        def __get__(self):
+            return self.hdr.birthdate
+
+    property patientname:
+        def __get__(self):
+            return self.hdr.patient_name
+
+    property patient_additional:
+        def __get__(self):
+            return self.hdr.patient_additional
+
+    property startdate_year:
+        def __get__(self):
+            return self.hdr.startdate_year
+
+    property startdate_month:
+        def __get__(self):
+            return self.hdr.startdate_month
+
+    property startdate_day:
+        def __get__(self):
+            return self.hdr.startdate_day
+
+    property starttime_hour:
+        def __get__(self):
+            return self.hdr.starttime_hour
+
+    property starttime_minute:
+        def __get__(self):
+            return self.hdr.starttime_minute
+
+    property starttime_second:
+        def __get__(self):
+            return self.hdr.starttime_second
+
+    property admincode:
+        def __get__(self):
+            return self.hdr.admincode
+
+    property technician:
+        def __get__(self):
+            return self.hdr.technician
+
+    property equipment:
+        def __get__(self):
+            return self.hdr.equipment
+
+    property recording_additional:
+        def __get__(self):
+            return self.hdr.recording_additional
+
     # signal parameters
     def signal_label(self, channel):
         return self.hdr.signalparam[channel].label
     def samples_in_datarecord(self, channel):
         return self.hdr.signalparam[channel].smp_in_datarecord
 
+    def physical_dimension(self, channel):
+        return self.hdr.signalparam[channel].physdimension
+
     def physical_max(self, channel):
         return self.hdr.signalparam[channel].phys_max
 
     def digital_min(self, channel):
         return self.hdr.signalparam[channel].dig_min
 
+    def prefilter(self, channel):
+        return self.hdr.signalparam[channel].prefilter
+
+    def transducer(self, channel):
+        return self.hdr.signalparam[channel].transducer
+
     def samplefrequency(self, channel):
         return (<double>self.hdr.signalparam[channel].smp_in_datarecord / self.hdr.datarecord_duration) * EDFLIB_TIME_DIMENSION
 
 
     def close(self):
         edfclose_file(self.hdr.handle)
-        
+    
+    def read_digital_signal(self, signalnum, start, n, np.ndarray[np.int32_t, ndim=1] sigbuf):
+       """read @n number of samples from signal number @signum starting at @start
+          into numpy int32 array @sigbuf sigbuf must be at least n long
+       """
+       edfseek(self.hdr.handle, signalnum, start, EDFSEEK_SET)
+       readn = read_int_samples(self.handle, signalnum, n, sigbuf)
+       if readn != n:
+           print "read %d, less than %d requested!!!" % (readn, n)    
+
     def readsignal(self, signalnum, start, n, np.ndarray[np.float64_t, ndim=1] sigbuf):
 
         """read @n number of samples from signal number @signum starting at