Fixed measurement_id input method.

Thu, 20 Mar 2014 09:17:09 +0200

author
Iannis <ioannis@inoe.ro>
date
Thu, 20 Mar 2014 09:17:09 +0200
changeset 21
406eb996a9cd
parent 20
18a77f8065c1
child 22
a2355e871b23

Fixed measurement_id input method.

generic.py file | annotate | diff | comparison | revisions
licel.py file | annotate | diff | comparison | revisions
--- a/generic.py	Thu Mar 20 09:16:22 2014 +0200
+++ b/generic.py	Thu Mar 20 09:17:09 2014 +0200
@@ -236,9 +236,9 @@
         
         # Add some mandatory global attributes
         input_values['Measurement_ID'] = self.info['Measurement_ID']
-        input_values['RawData_Start_Date'] = '\'%s\'' % self.info['start_time'].strftime('%Y%m%d')
-        input_values['RawData_Start_Time_UT'] = '\'%s\'' % self.info['start_time'].strftime('%H%M%S')
-        input_values['RawData_Stop_Time_UT'] = '\'%s\'' % self.info['stop_time'].strftime('%H%M%S')
+        input_values['RawData_Start_Date'] = self.info['start_time'].strftime('%Y%m%d')
+        input_values['RawData_Start_Time_UT'] = self.info['start_time'].strftime('%H%M%S')
+        input_values['RawData_Stop_Time_UT'] = self.info['stop_time'].strftime('%H%M%S')
         
         # Add some optional global attributes
         input_values['System'] = params.general_parameters['System']
@@ -258,7 +258,7 @@
         for (attrib,value) in global_att.iteritems():
             val = input_values.pop(attrib,value)
             if val: 
-                exec('f.%s = %s' % (attrib,val))
+                setattr(f, attrib, val)
         
         """ Variables """
         # Write the values of fixes channel parameters
--- a/licel.py	Thu Mar 20 09:16:22 2014 +0200
+++ b/licel.py	Thu Mar 20 09:17:09 2014 +0200
@@ -57,7 +57,7 @@
             raw_data = np.fromfile(f, 'i4', int(current_channel_info['DataPoints']))
             a = np.fromfile(f, 'b', 1)
             b = np.fromfile(f, 'b', 1)
-
+            
             if (a[0] != 13) | (b[0] != 10):
                 print "Warning: No end of line found after record. File could be corrupt"
             channel = LicelFileChannel(current_channel_info, raw_data)

mercurial