Exemplo n.º 1
0
 def get_ionic_mass_in_u(self):
     # note elbien is in eV must convert to MeV
     if self.tbl_zz <= 100:
         return self.get_atomic_mass_in_u() + AMEData.to_u(
             (AMEData.get_elbien(self.tbl_zz, 0) - AMEData.get_elbien(self.tbl_zz,
                                                                      self.qq)) / 1.0e6 - self.qq * AMEData.ME)
     else:
         return self.get_atomic_mass_in_u()
     pass
Exemplo n.º 2
0
    def calculate_from_energy(self):
        s = "Given:\n------\n"
        s += "{} {} {}+\n".format(self.tbl_aa, self.tbl_name, self.qq)
        s += "z= {}, ".format(self.tbl_zz)
        s += "n= {}\n".format(self.tbl_nn)
        s += 'Source: {source} \n'.format(source='** EXP **' if self.exp else '** SYS **')
        s += "Kin. Energy:\t\t{}\t\t[MeV/u]\n".format(self.ke_u)
        s += "Beam current:\t{}\t\t[µA]\n".format(self.i_beam_uA)
        s += "Path length:\t\t{}\t\t[m]\n".format(self.path_length_m)
        s += "Analysis freq.:\t{}\t\t[MHz]\n".format(self.f_analysis_mhz)

        s += "\n"
        s += "Calculated:\n-----------\n"
        s += "Total charge per ion:\t\t{}\t[C]\n".format(self.get_total_charge())

        s += "Atom. Mass.:\t\t{}\t\t[u]\n".format(self.get_atomic_mass_in_u())

        s += "Ion. Mass.:\t\t{}\t[u]\n".format(self.get_ionic_mass_in_u())

        s += "m/Q (ionic):\t\t{}\n".format(self.get_ionic_moq())

        s += "Neutron excess parameter:\t{}\t[1/u]\n".format(self.get_neutron_excess_parameter())

        s += "Tot. Kin. Energy:\t{}\t\t[MeV]\n".format(self.get_total_energy_mev())
        s += "gamma:\t\t{}\n".format(self.get_gamma())
        s += "beta:\t\t{}\n".format(self.get_beta())
        s += "beta * gamma:\t{}\n".format(self.get_beta_gamma())
        s += "Velocity:\t\t{}\t[m/s]\n".format(self.get_velocity())
        s += "\t\t{}\t[km/h]\n".format(AMEData.get_kmh(self.get_velocity()))

        s += "eta:\t\t{}\n".format(self.get_eta())

        s += "Relativistic mass:\t{}\t[MeV/c^2]\n".format(self.get_relativistic_mass())
        s += "\t\t{}\t[u]\n".format(AMEData.to_u(self.get_relativistic_mass()))

        s += "Rel. momentum:\t{}\t[MeV/c]\n".format(self.get_relativistic_momentum())
        s += "Rel. mom. per Nuc.:\t{}\t[MeV/c/u]\n".format(self.get_relativistic_momentum_per_u())

        s += "pc:\t\t{}\t[MeV]\n".format(self.get_pc())

        s += "Brho:\t\t{}\t[T/m]\n".format(self.get_magnetic_rigidity())
        s += "Erho:\t\t{}\t[kV]\n".format(self.get_electric_rigidity())

        s += "f_rev:\t\t{}\t[MHz]\n".format(self.calculate_revolution_frequency())
        s += "No. of ions:\t\t{}\n".format(self.get_number_of_ions())

        s += "Prev. Harmonic:\t{}\n".format(self.get_prev_revolution_harmonic())
        s += "Expected peak freq.:\t{}\t[MHz]\n".format(self.get_prev_peak_frequency())
        s += "Next Harmonic:\t{}\n".format(self.get_next_revolution_harmonic())
        s += "Expected peak freq.:\t{}\t[MHz]\n".format(self.get_next_peak_frequency())

        return s
Exemplo n.º 3
0
    def __init__(self):
        """
        The constructor and initiator.
        :return:
        """
        # initial setup
        super(mainWindow, self).__init__()
        self.setupUi(self)

        # create an instance of the table data and give yourself as UI Interface
        self.ame_data = AMEData(self)

        # take care about ring combo
        self.ring_dict = Ring.get_ring_dict()
        keys = list(self.ring_dict.keys())
        keys.sort()
        self.comboBox_ring.addItems(keys)
        self.current_ring_name = ''

        self.comboBox_ring.setCurrentIndex(4)
        self.on_comboBox_ring_changed(4)

        # fill combo box with names
        self.comboBox_name.addItems(self.ame_data.names_list)

        # UI related stuff
        self.setup_table_view()
        self.connect_signals()

        # A particle to begin with
        self.particle = None
        self.comboBox_name.setCurrentIndex(6)
        self.reinit_particle()
Exemplo n.º 4
0
    def calculate_from_energy_list(self):

        s = [['Nuclide:', "{} {} {}+".format(self.tbl_aa, self.tbl_name, self.qq), ''],
             ["Z:", str(self.tbl_zz), ''],
             ['N:', str(self.tbl_nn), ''],
             ['Source:', '{source}'.format(source='** EXP **' if self.exp else '** SYS **'), ''],
             ['Kinetic energy:', str(self.ke_u), '[MeV/u]'],
             ['Beam current:', str(self.i_beam_uA), '[µA]'],
             ['Path length:', str(self.path_length_m), '[m]'],
             ['Analysis freq.:', str(self.f_analysis_mhz), '[MHz]'],
             ['Total charge per ion:', str(self.get_total_charge()), '[C]'],
             ['Atomic mass:', str(self.get_atomic_mass_in_u()), '[u]'],
             ['Ionic mass:', str(self.get_ionic_mass_in_u()), '[u]'],
             ['Ionic mass:', str(AMEData.to_kg(self.get_ionic_mass_in_u())), '[kg]'],
             ['Ionic m/Q:', str(self.get_ionic_moq()), '[u]'],
             ['Neutron Excess Parameter:', str(self.get_neutron_excess_parameter()), '[1/u]'],
             ['Tot. kin. Energy:', str(self.get_total_energy_mev()), '[MeV]'],
             ['gamma:', str(self.get_gamma()), ''],
             ['beta:', str(self.get_beta()), ''], ['beta * gamma:', str(self.get_beta_gamma()), ''],
             ['Velocity:', str(self.get_velocity()), '[m/s]'],
             ['eta:', str(self.get_eta()), ''],
             ['', str(AMEData.get_kmh(self.get_velocity())), '[km/h]'],
             ['Rel. mass:', str(self.get_relativistic_mass()), '[MeV/c^2]'],
             ['', str(AMEData.to_u(self.get_relativistic_mass())), '[u]'],
             ['', str(AMEData.to_kg(self.get_relativistic_mass())), '[kg]'],
             ['Rel. Momentum:', str(self.get_relativistic_momentum()), '[MeV/c]'],
             ['Rel. Mom. per Nucl.:', str(self.get_relativistic_momentum_per_u()), '[MeV/c/u]'],
             ['pc:', str(self.get_pc()), '[MeV]'], ['Brho:', str(self.get_magnetic_rigidity()), '[T/m]'],
             ['Erho:', str(self.get_electric_rigidity()), '[kV]'],
             ['f_rev:', str(self.calculate_revolution_frequency()), '[MHz]'],
             ['No. of ions:', str(self.get_number_of_ions()), ''],
             ['Prev. harmonic:', str(self.get_prev_revolution_harmonic()), ''],
             ['Expected peak:', str(self.get_prev_peak_frequency()), '[MHz]'],
             ['Next harmonic:', str(self.get_next_revolution_harmonic()), ''],
             ['Expected peak:', str(self.get_next_peak_frequency()), '[MHz]']]

        return s
Exemplo n.º 5
0
 def get_relativistic_momentum(self):
     return AMEData.to_mev(self.get_ionic_mass_in_u()) * self.get_gamma() * self.get_beta()
Exemplo n.º 6
0
 def get_gamma(self):
     return self.get_total_energy_mev() / AMEData.to_mev(self.get_ionic_mass_in_u()) + 1.0