Skip to content

Commit

Permalink
2nd attempt to fix the bug with cosmology and interpolation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matej committed Oct 19, 2016
1 parent 506215b commit a4de350
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nbodykit/core/datasource/FastPM.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ def fill_schema(cls):
s.add_argument("potentialRSD", type=bool, help="potential included in file")

def parallel_read(self, columns, full=False):

self.H_interp = interpMake(self.cosmo.engine.H, 0, 20, 8000)

f = bigfile.BigFileMPI(self.comm, self.path)
try:
header = f['.']
Expand Down Expand Up @@ -134,15 +131,18 @@ def parallel_read(self, columns, full=False):
data = dataset[column][bunchstart:bunchend]
P[column] = data


if 'Velocity' in P:
if not self.lightcone:
P['Velocity'] *= RSD
else:
redshift = 1/(P['Aemit']) - 1
#H = self.cosmo.engine.H(redshift) / self.cosmo.engine.h
H = self.H_interp(redshift)/self.cosmo.engine.h

H_interp = interpMake(self.cosmo.engine.H, 0, 20, 8192) # bounds from 0 to 20 with 8000 steps

redshift = 1/(P['Aemit']) - 1
H = H_interp(redshift)/self.cosmo.engine.h
factor = 1./(P['Aemit']*H)

P['Velocity'] *= factor[:, None]

if self.potentialRSD:
Expand Down

0 comments on commit a4de350

Please sign in to comment.