Skip to content

Commit

Permalink
add EPOCH reader support for subsets
Browse files Browse the repository at this point in the history
This commit also fixes that species will be recognized even if Px is not dumped.
fix #8
  • Loading branch information
skuschel committed Dec 25, 2014
1 parent bd7c244 commit 0fb9903
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion postpic/analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def identifyspecies(cls, species):
ejected_c6b, tracer_proton, protonb
"""
ret = {'tracer': False, 'ejected': False, 'name': species}
s = species.replace('/', '')
s = species.replace('/', '_')

# Regex for parsing ion species name.
# See docsting for valid examples
Expand Down
7 changes: 4 additions & 3 deletions postpic/datareader/epochsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ def grid(self, axis):
return self['Grid/Grid/' + axsuffix]

def listSpecies(self):
ret = []
ret = set()
for key in self.keys():
match = re.match('Particles/Px/(\w+)', key)
match = re.match('Particles/\w+/(\w+(/\w+)?)', key)
if match:
ret = np.append(ret, match.group(1))
ret.add(match.group(1))
ret = list(ret)
ret.sort()
return ret

Expand Down

0 comments on commit 0fb9903

Please sign in to comment.