def test_conversion_functions(self): """Verify that the functions correctly convert back and forth""" for id, name in self.pid_name: self.assertEqual(particles.name(id), name) self.assertEqual(particles.particle_id(name), id) for id, name in self.massless_atoms: self.assertEqual(particles.particle_id(name), id) for id, name in self.atoms: self.assertEqual(particles.name(id), name) self.assertEqual(particles.particle_id(name), id)
def __init__(self, energy=16, particle='proton', zenith=22.5, azimuth=180, queue='generic', corsika='corsika74000Linux_QGSII_gheisha'): # Energy is stored as log10(E[GeV]) for CORSIKA if modf(energy)[0] == 0.: self.energy_pre = 1. self.energy_pow = int(energy - 9) elif modf(energy)[0] == 0.5: self.energy_pre = 3.16228 self.energy_pow = int(modf(energy)[1] - 9) else: raise ValueError('Energy must either be an integer or end in .5.') self.particle = particles.particle_id( particle) # Stored as particle id self.theta = zenith self.phi = (azimuth + 90) % 360 # Stored as Phi defined by CORSIKA self.queue = queue self.corsika = corsika self.seed1 = None self.seed2 = None self.rundir = None
def __init__(self, energy=16, particle='proton', zenith=22.5, azimuth=180, queue='generic', corsika='corsika74000Linux_QGSII_gheisha'): # Energy is stored as log10(E[GeV]) for CORSIKA if modf(energy)[0] == 0.: self.energy_pre = 1. self.energy_pow = int(energy - 9) elif modf(energy)[0] == 0.5: self.energy_pre = 3.16228 self.energy_pow = int(modf(energy)[1] - 9) else: raise ValueError('Energy must either be an integer or end in .5.') self.particle = particles.particle_id(particle) # Stored as particle id self.theta = zenith self.phi = (azimuth + 90) % 360 # Stored as Phi defined by CORSIKA self.queue = queue self.corsika = corsika self.seed1 = None self.seed2 = None self.rundir = None