ChristopherMayes / openPMD-beamphysics

Tools for analyzing and viewing particle data in the openPMD standard, extension beamphysics.
https://christophermayes.github.io/openPMD-beamphysics/
Apache License 2.0
16 stars 15 forks source link

Update species for H2+ #64

Closed ColwynGulliford closed 2 months ago

ColwynGulliford commented 2 months ago

This PR adds the molecular hydrogen ion to the species list(s) for ParticleGroup. The ion consists of two protons and one electron:

mH2pc2 = 2*mpc2 + mec2 # Molecular Hydrogen Ion H2+

e_charge = scipy.constants.e
c_light = scipy.constants.c

CHARGE_OF = {'electron': -e_charge,
            'positron': e_charge,
            'proton': e_charge,
            'H-': -e_charge,
            'H2+': e_charge,
            }

CHARGE_STATE = {
    'electron': -1,
    'positron': 1,
    'proton': 1,
    'H-': -1,
    'H2+': +1,
    }

MASS_OF = {'electron': mec2,
           'positron': mec2,
           'proton': mpc2,
           'H-': mhmc2,
           'H2+': mH2pc2,
           }

This seems to respect the standard:

Screenshot 2024-06-29 at 9 56 46 PM

https://github.com/openPMD/openPMD-standard/blob/upcoming-2.0.0/EXT_SpeciesType.md