Exemplo n.º 1
0
 def mg_same_thick_test(self):
     sigma = self.b.full_sigma_calculation([[1.8,100]], 5)
     r1 = self.b.ranges(200, '10B4C 2.24g/cm3')
     thick = 1
     # check if mg with 1 blade and single blade gives the same value
     assert numpy.isclose(mg_same_thick(sigma[0], r1, thick, 1), [efficiency4boron(thick, r1[0], r1[1], r1[2], r1[3], sigma[0])[0]], rtol=1e-05, atol=1e-08, equal_nan=False)
     assert numpy.isclose( mg_same_thick(sigma[0], r1, thick, 20), [0.69218537268800717], rtol=1e-05, atol=1e-08, equal_nan=False)
Exemplo n.º 2
0
 def eff_boron_multiblade_doublecoated(self):
     """Deprecated"""
     print('')
     print('Boron multi-blade double coated calculation ')
     ranges = self.Boron.ranges(self.thresholdSpinBox.value(),
                                str(self.converterComboBox.currentText()))
     sigma = self.Boron.full_sigma_calculation([self.lambdaSpinBox.value()],
                                               self.angleSpinBox.value())
     # TODO add aluminium consideration
     result = efftools.mg_same_thick(sigma, ranges, self.BSpinBox.value(),
                                     self.bladeSpinBox.value())
     self.plotTitleLAbel.setText('Multi blade plots')
     self.figure.clf()
     data = efftools.data_samethick_vs_thickandnb(
         sigma, ranges, [self.bladeSpinBox.value()], self)
Exemplo n.º 3
0
 def plotview(self):
     """Deprecated  This method is called when the plot button is pushed """
     if self.yAxisComboBox.currentText() == 'Efficiency':
         if self.xAxisComboBox.currentText() == 'Thickness':
             if self.varComboBox.currentText() == 'Number of blades':
                 if len(self.plotlist) < 1:
                     self.plotTitleLAbel.setText(
                         '<html><head/><body><p><span style=" font-size:14pt; font-weight:600;">Efficiency VS Thickness with different Number of blades</span></p></body></html>'
                     )
                     self.thresholdSpinBox.setEnabled(False)
                     self.converterComboBox.setEnabled(False)
                     self.angleSpinBox.setEnabled(False)
                     self.lambdaSpinBox.setEnabled(False)
                     self.BSpinBox.setEnabled(False)
                     self.xAxisComboBox.setEnabled(False)
                     self.yAxisComboBox.setEnabled(False)
                     self.varComboBox.setEnabled(False)
                 ranges = self.Boron.ranges(
                     self.thresholdSpinBox.value(),
                     str(self.converterComboBox.currentText()))
                 sigma = self.Boron.full_sigma_calculation(
                     [self.lambdaSpinBox.value()],
                     self.angleSpinBox.value())
                 eff = efftools.mg_same_thick(sigma, ranges,
                                              self.BSpinBox.value(),
                                              self.bladeSpinBox.value())[0]
                 metadata = efftools.metadata_samethick_vs_thickandnb(
                     sigma, ranges, self.bladeSpinBox.value())
                 newplot = {
                     str(len(self.plotlist)): {
                         'thickness': self.BSpinBox.value(),
                         'nb': self.bladeSpinBox.value(),
                         'wavelength': self.lambdaSpinBox.value(),
                         'angle': self.angleSpinBox.value(),
                         'threshold': self.thresholdSpinBox.value(),
                         'eff': eff,
                         'meta': metadata
                     }
                 }
                 self.add_new_plot(newplot)
                 # id = newplot.keys()[0]
                 self.plotlist.update(newplot)
                 self.plot_list('d (um)', 'Efficiency')
         elif self.xAxisComboBox.currentText() == 'Wavelength':
             if len(self.plotlist) < 1:
                 self.plotTitleLAbel.setText(
                     '<html><head/><body><p><span style=" font-size:14pt; font-weight:600;">Efficiency VS Thickness with different Number of blades</span></p></body></html>'
                 )
                 self.thresholdSpinBox.setEnabled(False)
                 self.converterComboBox.setEnabled(False)
                 self.angleSpinBox.setEnabled(False)
                 self.lambdaSpinBox.setEnabled(False)
                 self.BSpinBox.setEnabled(False)
                 self.xAxisComboBox.setEnabled(False)
                 self.yAxisComboBox.setEnabled(False)
                 self.varComboBox.setEnabled(False)
             ranges = self.Boron.ranges(
                 self.thresholdSpinBox.value(),
                 str(self.converterComboBox.currentText()))
             sigmalist = np.arange(0.0011, 20, 0.1)
             sigmaeq = []
             sigma = self.Boron.full_sigma_calculation(
                 [self.lambdaSpinBox.value()], self.angleSpinBox.value())
             eff = efftools.mg_same_thick(sigma, ranges,
                                          self.BSpinBox.value(),
                                          self.bladeSpinBox.value())[0]
             for sigma in sigmalist:
                 sigmaeq.append(
                     self.Boron.full_sigma_calculation(
                         [sigma], self.angleSpinBox.value()))
             y = efftools.metadata_samethick_vs_wave(
                 sigmaeq, self.BSpinBox.value(), ranges,
                 self.bladeSpinBox.value())
             metadata = [sigmalist, y]
             newplot = {
                 str(len(self.plotlist)): {
                     'thickness': self.BSpinBox.value(),
                     'nb': self.bladeSpinBox.value(),
                     'wavelength': self.lambdaSpinBox.value(),
                     'angle': self.angleSpinBox.value(),
                     'threshold': self.thresholdSpinBox.value(),
                     'eff': eff,
                     'meta': metadata
                 }
             }
             self.add_new_plot(newplot)
             # id = newplot.keys()[0]
             self.plotlist.update(newplot)
             self.plot_list('Wavelength', 'Efficiency')