minval/maxval for plotting. Only generate velocities if it is required

This commit is contained in:
Guilhem Lavaux 2014-06-24 11:23:00 +02:00
parent 6eebe9a9cb
commit f2b81d863f
3 changed files with 6 additions and 4 deletions

View file

@ -53,7 +53,7 @@ def compute_ref_power(L, N, cosmo, bins=10, range=(0,1), func='HU_WIGGLES'):
return bin_power(p.compute(k)*cosmo['h']**3, L, bins=bins, range=range)
def run_generation(input_borg, a_borg, a_ic, cosmo, supersample=1, do_lpt2=True, shiftPixel=False):
def run_generation(input_borg, a_borg, a_ic, cosmo, supersample=1, do_lpt2=True, shiftPixel=False, needvel=True):
""" Generate particles and velocities from a BORG snapshot. Returns a tuple of
(positions,velocities,N,BoxSize,scale_factor)."""
@ -90,7 +90,8 @@ def run_generation(input_borg, a_borg, a_ic, cosmo, supersample=1, do_lpt2=True,
# Generate posx
posx.append(((posq[j] + psi)%L).astype(np.float32))
# Generate vel
vel.append((psi*velmul).astype(np.float32))
if needvel:
vel.append((psi*velmul).astype(np.float32))
print("velmul=%lg" % (cosmo['h']*velmul))