예제 #1
0
 def get_angular(self):
     try:
         f = Finddir().find_beam_file()
         if f == '':
             pass
         else:
             self.angular_line.setText(str(f))
     except TypeError:
         pass
예제 #2
0
 def get_spectrum(self):
     try:
         f = Finddir().find_beam_file()
         if f == '':
             pass
         else:
             self.spectrum_line.setText(str(f))
     except TypeError:
         pass
예제 #3
0
 def load_file(self):
     try:
         f = Finddir().find_filepath()
         self.load_name = os.path.basename(f)
         self.load_label.setText('Loaded Spectrum File: ' + self.load_name)
         self.loaded_file = np.loadtxt(f, dtype=str)
         self.loaded_array = self.loaded_file[0:15, 1:20]
         if self.loaded_array.shape == (15, 19):
             for i in range(0, 15):
                 for j in range(0, 19):
                     self.data_table.setItem(
                         i, j, QTableWidgetItem(self.loaded_array[i, j]))
         else:
             QMessageBox.warning(
                 self, 'Error',
                 'This file is not an angular distribution file, please check.'
             )
     except OSError:
         pass
     self.loaded_data()
예제 #4
0
 def load_file(self):
     try:
         f = Finddir().find_beam_file()
         self.load_name = os.path.basename(f)
         self.load_label.setText('Loaded Spatial File: ' + self.load_name)
         a = np.loadtxt(f, dtype=str)
         if a.shape == (3, 2):
             self.x_line.setText(a[1, 1])
             self.y_line.setText(a[2, 1])
             if a[0, 0] == 'gaussian':
                 self.gaussian_button.setChecked(True)
             else:
                 self.uniform_button.setChecked(True)
         else:
             QMessageBox.warning(
                 self, 'Error',
                 'This file is not a spatial distribution file, please check.'
             )
     except OSError:
         pass
예제 #5
0
 def load_file(self):
     try:
         f = Finddir().find_filepath()
         self.load_name = os.path.basename(f)
         self.load_label.setText('Loaded Angular File: ' + self.load_name)
         self.a = np.loadtxt(f, dtype=str)
         self.loaded_data = []
         if self.a.shape == (3, 16):
             for i in range(0, 15):
                 self.data_table.setItem(
                     0, i, QTableWidgetItem(self.a[0, 15 - i]))
                 self.data_table.setItem(
                     1, i, QTableWidgetItem(self.a[2, 15 - i]))
             for col in range(0, 15):
                 self.loaded_data.append(
                     float(self.data_table.item(1, col).text()))
         else:
             QMessageBox.warning(
                 self, 'Error',
                 'This file is not an angular distribution file, please check.'
             )
     except OSError:
         pass
예제 #6
0
 def find_dir(self):
     d = Finddir().find_dir()
     if d == '':
         d = self.dir_line.text()
     self.dir_line.setText(d)
예제 #7
0
 def find_dir(self):
     d = Finddir().find_dir()
     if d == '':
         pass
     else:
         self.dir_line.setText(d)
예제 #8
0
 def get_spatial(self):
     try:
         f = Finddir().find_filepath()
         self.spatial_line.setText(str(f))
     except TypeError:
         pass
예제 #9
0
 def get_angular(self):
     try:
         f = Finddir().find_filepath()
         self.angular_line.setText(str(f))
     except TypeError:
         pass