Beispiel #1
0
 def calc_data1(self):
     list_A = []
     for rows in self.data['list_data'][0]:
         row = []
         for item in rows:
             value_degree = Method.degree_trans(item)
             if (value_degree > 1000) | (value_degree < -1000):
                 print('数据出现错误,请检查实验表格第' +
                       str(self.data['list_data'].index(rows) + 4) + '行第' +
                       str(rows.index(item) + 2) + '列的度和分是否以空格分隔')
             else:
                 row.append(value_degree)
         value_A = (row[3] + row[2] - row[1] - row[0]) / 4
         if value_A < 0:
             value_A = value_A + 90
         list_A.append(value_A)
     aver_A = Method.average(list_A)
     self.data['list_A'] = list_A
     self.data['aver_A'] = aver_A
Beispiel #2
0
 def calc_data2(self):
     list_delta_m = []
     for rows in self.data['list_data'][1]:
         row = []
         for item in rows:
             value_degree = Method.degree_trans(item)
             if (value_degree > 1000) | (value_degree < -1000):
                 print('数据出现错误,请检查实验表格第' +
                       str(self.data['list_data'].index(rows) + 4) + '行第' +
                       str(rows.index(item) + 8) + '列的度和分是否以空格分隔')
             else:
                 row.append(value_degree)
         value_delta_m = (row[3] + row[2] - row[1] - row[0]) / 2
         if value_delta_m < 0:
             value_delta_m = value_delta_m + 180
         list_delta_m.append(value_delta_m)
     delta_m = Method.average(list_delta_m)
     n1 = float(
         sin((delta_m + self.data['aver_A']) / 360 * pi) /
         sin(self.data['aver_A'] / 360 * pi))
     self.data['list_delta_m'] = list_delta_m
     self.data['aver_delta_m'] = delta_m
     self.data['n1'] = n1
Beispiel #3
0
 def calc_data3(self):
     list_delta = []
     for rows in self.data['list_data'][2]:
         row = []
         for item in rows:
             value_degree = Method.degree_trans(item)
             if (value_degree > 1000) | (value_degree < -1000):
                 print('数据出现错误,请检查实验表格第' +
                       str(self.data['list_data'].index(rows) + 4) + '行第' +
                       str(rows.index(item) + 14) + '列的度和分是否以空格分隔')
             else:
                 row.append(value_degree)
         value_delta = (row[0] + row[1] - row[2] - row[3]) / 2
         if value_delta < 0:
             value_delta = value_delta + 180
         list_delta.append(value_delta)
     delta = Method.average(list_delta)
     n2 = float(
         sqrt((
             (cos(self.data['aver_A'] / 180 * pi) + sin(delta / 180 * pi)) /
             sin(self.data['aver_A'] / 180 * pi))**2 + 1))
     self.data['list_delta'] = list_delta
     self.data['aver_delta'] = delta
     self.data['n2'] = n2