diff --git a/postpic/_const.py b/postpic/_const.py index 7a4a009b..5d367003 100644 --- a/postpic/_const.py +++ b/postpic/_const.py @@ -28,7 +28,9 @@ 'PY': 4, 'Py': 4, 'py': 4, 4: 4, 'PZ': 5, 'Pz': 5, 'pz': 5, 9: 9, 'weight': 9, 'w': 9, 10: 10, - 'id': 10, 'ID': 10}) + 'id': 10, 'ID': 10, + 'mass': 11, 'm': 11, 'Mass': 11, + 'charge': 12, 'c': 12, 'Charge': 12, 'q': 12}) # Some static functions diff --git a/postpic/analyzer/particles.py b/postpic/analyzer/particles.py index 4c36a1bd..1fcc7621 100644 --- a/postpic/analyzer/particles.py +++ b/postpic/analyzer/particles.py @@ -37,9 +37,12 @@ class _SingleSpeciesAnalyzer(object): def __init__(self, dumpreader, species): self.species = species self._dumpreader = dumpreader - self._idfy = identifyspecies(species) - self._mass = self._idfy['mass'] # SI - self._charge = self._idfy['charge'] # SI + self._mass = dumpreader.getSpecies(species, 'mass') + self._charge = dumpreader.getSpecies(species, 'charge') + if self._mass is None or self._charge is None: + self._idfy = identifyspecies(species) + self._mass = self._idfy['mass'] # SI + self._charge = self._idfy['charge'] # SI self.compresslog = [] self._compressboollist = None self._cache = {}