Ejemplo n.º 1
0
def test_linear_field_shape():
    """ Testing just the shape of the sampled linear field
  """
    klin = np.loadtxt('flowpm/data/Planck15_a1p00.txt').T[0]
    plin = np.loadtxt('flowpm/data/Planck15_a1p00.txt').T[1]
    ipklin = iuspline(klin, plin)

    tfread = tfpm.linear_field(nc, bs, ipklin, batch_size=5).numpy()
    assert tfread.shape == (5, 16, 16, 16)
Ejemplo n.º 2
0
def test_linear_field_shape():
  bs = 50
  nc = 16

  klin = np.loadtxt('flowpm/data/Planck15_a1p00.txt').T[0]
  plin = np.loadtxt('flowpm/data/Planck15_a1p00.txt').T[1]
  ipklin = iuspline(klin, plin)

  with tf.Session() as sess:
    field = linear_field(nc, bs, ipklin, batch_size=5)
    sess.run(tf.global_variables_initializer())
    tfread = sess.run(field)

  assert tfread.shape == (5, 16, 16, 16)