Skip to content

Commit

Permalink
fastpm bug resolved now
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhand committed Jun 10, 2017
1 parent ec11419 commit c4a7ad6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions nbodykit/core/datasource/FastPM.py
Expand Up @@ -36,20 +36,16 @@ def __init__(self, path, BoxSize=None, bunchsize=4*1024*1024, rsd=None, lightcon
f = bigfile.BigFileMPI(self.comm, self.path)
try:
header = f['header']
self.headerblock = 'header'
except:
try:
header = f['Header']
self.headerblock = 'Header'
except:
header = f['.']
self.headerblock = '.'

try:
f = f['1/']
self.datablock = '1/'
except:
self.datablock = '.'
pass

BoxSize[:] = header.attrs['BoxSize'][0]
OmegaM = header.attrs['OmegaM'][0]
Expand Down Expand Up @@ -88,14 +84,23 @@ def fill_schema(cls):

def parallel_read(self, columns, full=False):
f = bigfile.BigFileMPI(self.comm, self.path)
header = f[self.headerblock]
try:
header = f['header']
except:
try:
header = f['Header']
except:
header = f['.']

boxsize = header.attrs['BoxSize'][0]
RSD = header.attrs['RSDFactor'][0]
if boxsize != self.BoxSize[0]:
raise ValueError("Box size mismatch, expecting %g" % boxsize)

f= f[self.datablock]
try:
f = f['1/']
except:
pass

readcolumns = set(columns)
if self.rsd is not None:
Expand Down

0 comments on commit c4a7ad6

Please sign in to comment.