Reading from a C version RunPB (TPM) snapshot file.

We will

  • create a parameter file, a simple power spectrum in units of Mpc/h,
  • run FastPM to obtain a TPM snapshot at z=0
  • load the result with nbodykit

In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from nbodykit.source.catalog import TPMBinaryCatalog
from nbodykit.source.mesh import BigFileMesh

In [3]:
from nbodykit.cosmology import Planck15
from nbodykit.cosmology import EHPower

In [4]:
k = numpy.logspace(-4, 2, 1000)
p = EHPower(Planck15, redshift=0.0)(k)
numpy.savetxt('powerspec.txt', numpy.array((k, p)).T)

In [7]:
%%file nbodykit.lua

nc = 128
boxsize = 384.0

time_step = linspace(0.1, 1, 10)

output_redshifts= {0.0}  -- redshifts of output

omega_m = 0.307494
h       = 0.6774

read_powerspectrum= "powerspec.txt"
random_seed= 100

pm_nc_factor = 2

np_alloc_factor= 4.0      -- Amount of memory allocated for particle

write_runpb_snapshot= "tpm" 
write_nonlineark= "fastpm" 

-- 1d power spectrum (raw), without shotnoise correction
write_powerspectrum = "powerspec-debug"


Overwriting nbodykit.lua

In [8]:
%%bash
export OMP_NUM_THREADS=1
mpirun -n 4 ../src/fastpm nbodykit.lua


[ 0000000.0000 ]: This is FastPM, with libfastpm version 1.0.bc02796005-dirty.
[ 0000000.0030 ]: Configuration {
	boxsize = 384.0,
	compute_potential = false,
	dealiasing_type = "none",
	dh_factor = 1.0,
	enforce_broadband_kmax = 4,
	f_nl_type = "none",
	force_mode = "fastpm",
	h = 0.677400000000000002,
	inverted_ic = false,
	kernel_type = "3_4",
	kmax_primordial_over_knyquist = 0.25,
	nc = 128,
	np_alloc_factor = 4.0,
	omega_m = 0.30749399999999999,
	painter_support = 2,
	painter_type = "cic",
	pm_nc_factor = 2,
	random_seed = 100,
	read_powerspectrum = "powerspec.txt",
	remove_cosmic_variance = false,
	set_mode_method = "override",
	shift = false,
	sigma8 = 0,
	write_nonlineark = "fastpm",
	write_powerspectrum = "powerspec-debug",
	write_runpb_snapshot = "tpm",
	za = false,
	aout = {
		1.0,
	},
	output_redshifts = {
		0.0,
	},
	time_step = {
		0.100000000000000006,
		0.190000000000000002,
		0.280000000000000027,
		0.369999999999999996,
		0.459999999999999964,
		0.550000000000000044,
		0.640000000000000013,
		0.729999999999999982,
		0.819999999999999951,
		0.90999999999999992,
		1,
	},
}
[ 0000000.0032 ]: np_alloc_factor = 4
[ 0000000.0035 ]: mass of a particle is 230.353 1e10 Msun/h
[ 0000000.0197 ]: BaseProcMesh : 2 x 2
[ 0000000.0202 ]: Powerspecectrum file: powerspec.txt
[ 0000000.0222 ]: Found 1000 pairs of values in input spectrum table
[ 0000000.0249 ]: Input power spectrum sigma8 0.815898
[ 0000000.2405 ]: Inducing correlation to the white noise.
[ 0000000.4494 ]: writing linear power spectrum to powerspec-debug_linear.txt
[ 0000001.9808 ]: dx1  : 5.13658 5.5179 6.16024 5.60491
[ 0000001.9860 ]: dx2  : 0.853765 0.841076 0.847693 0.847511
[ 0000002.0041 ]: ==== -> 001 [000 000 000] a_i = 0.1000 a_f = 0.1000 a_r = 0.1000 Action = FORCE(0) ====
[ 0000003.8528 ]: Force Calculation Nmesh = 256 ====
[ 0000003.8529 ]: Load imbalance is - 0.99091 / + 1.00439
[ 0000003.8530 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000003.9913 ]: D^2(0.1, 1.0) P(k<0.0654167) = 13929.2 Sigma8 = 6.4495
[ 0000003.9914 ]: writing power spectrum to powerspec-debug_0.1000.txt
[ 0000004.0156 ]: Checking Snapshots (0.1000 0.1000) with K(0.1000 0.1000 0.1000) D(0.1000 0.1000 0.1000)
[ 0000004.0157 ]: ==== -> 002 [000 001 000] a_i = 0.1000 a_f = 0.1378 a_r = 0.1000 Action = KICK(1) ====
[ 0000004.0422 ]: ==== -> 003 [001 001 000] a_i = 0.1000 a_f = 0.1378 a_r = 0.1378 Action = DRIFT(2) ====
[ 0000004.0659 ]: Checking Snapshots (0.1000 0.1378) with K(0.1000 0.1378 0.1000) D(0.1378 0.1000 0.1378)
[ 0000004.0793 ]: ==== -> 004 [002 001 000] a_i = 0.1378 a_f = 0.1900 a_r = 0.1378 Action = DRIFT(2) ====
[ 0000004.1036 ]: ==== -> 005 [002 001 002] a_i = 0.1000 a_f = 0.1900 a_r = 0.1900 Action = FORCE(0) ====
[ 0000006.0630 ]: Force Calculation Nmesh = 256 ====
[ 0000006.0632 ]: Load imbalance is - 0.989521 / + 1.00418
[ 0000006.0633 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000006.2025 ]: D^2(0.19, 1.0) P(k<0.0654167) = 13919 Sigma8 = 3.41523
[ 0000006.2026 ]: writing power spectrum to powerspec-debug_0.1900.txt
[ 0000006.2048 ]: ==== -> 006 [002 002 002] a_i = 0.1378 a_f = 0.1900 a_r = 0.1900 Action = KICK(1) ====
[ 0000006.2273 ]: Checking Snapshots (0.1378 0.1900) with K(0.1900 0.1378 0.1900) D(0.1378 0.1900 0.1378)
[ 0000006.2419 ]: ==== -> 007 [002 003 002] a_i = 0.1900 a_f = 0.2307 a_r = 0.1900 Action = KICK(1) ====
[ 0000006.2680 ]: ==== -> 008 [003 003 002] a_i = 0.1900 a_f = 0.2307 a_r = 0.2307 Action = DRIFT(2) ====
[ 0000006.2943 ]: Checking Snapshots (0.1900 0.2307) with K(0.1900 0.2307 0.1900) D(0.2307 0.1900 0.2307)
[ 0000006.3084 ]: ==== -> 009 [004 003 002] a_i = 0.2307 a_f = 0.2800 a_r = 0.2307 Action = DRIFT(2) ====
[ 0000006.3326 ]: ==== -> 010 [004 003 004] a_i = 0.1900 a_f = 0.2800 a_r = 0.2800 Action = FORCE(0) ====
[ 0000008.1623 ]: Force Calculation Nmesh = 256 ====
[ 0000008.1624 ]: Load imbalance is - 0.986502 / + 1.0053
[ 0000008.1624 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000008.3234 ]: D^2(0.28, 1.0) P(k<0.0654167) = 13905 Sigma8 = 2.35069
[ 0000008.3236 ]: writing power spectrum to powerspec-debug_0.2800.txt
[ 0000008.3258 ]: ==== -> 011 [004 004 004] a_i = 0.2307 a_f = 0.2800 a_r = 0.2800 Action = KICK(1) ====
[ 0000008.3482 ]: Checking Snapshots (0.2307 0.2800) with K(0.2800 0.2307 0.2800) D(0.2307 0.2800 0.2307)
[ 0000008.3972 ]: ==== -> 012 [004 005 004] a_i = 0.2800 a_f = 0.3219 a_r = 0.2800 Action = KICK(1) ====
[ 0000008.4273 ]: ==== -> 013 [005 005 004] a_i = 0.2800 a_f = 0.3219 a_r = 0.3219 Action = DRIFT(2) ====
[ 0000008.4604 ]: Checking Snapshots (0.2800 0.3219) with K(0.2800 0.3219 0.2800) D(0.3219 0.2800 0.3219)
[ 0000008.4736 ]: ==== -> 014 [006 005 004] a_i = 0.3219 a_f = 0.3700 a_r = 0.3219 Action = DRIFT(2) ====
[ 0000008.4977 ]: ==== -> 015 [006 005 006] a_i = 0.2800 a_f = 0.3700 a_r = 0.3700 Action = FORCE(0) ====
[ 0000010.4454 ]: Force Calculation Nmesh = 256 ====
[ 0000010.4454 ]: Load imbalance is - 0.982624 / + 1.00655
[ 0000010.4456 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000010.5855 ]: D^2(0.37, 1.0) P(k<0.0654167) = 13884.5 Sigma8 = 1.81628
[ 0000010.5856 ]: writing power spectrum to powerspec-debug_0.3700.txt
[ 0000010.5878 ]: ==== -> 016 [006 006 006] a_i = 0.3219 a_f = 0.3700 a_r = 0.3700 Action = KICK(1) ====
[ 0000010.6101 ]: Checking Snapshots (0.3219 0.3700) with K(0.3700 0.3219 0.3700) D(0.3219 0.3700 0.3219)
[ 0000010.6249 ]: ==== -> 017 [006 007 006] a_i = 0.3700 a_f = 0.4126 a_r = 0.3700 Action = KICK(1) ====
[ 0000010.6513 ]: ==== -> 018 [007 007 006] a_i = 0.3700 a_f = 0.4126 a_r = 0.4126 Action = DRIFT(2) ====
[ 0000010.6738 ]: Checking Snapshots (0.3700 0.4126) with K(0.3700 0.4126 0.3700) D(0.4126 0.3700 0.4126)
[ 0000010.6870 ]: ==== -> 019 [008 007 006] a_i = 0.4126 a_f = 0.4600 a_r = 0.4126 Action = DRIFT(2) ====
[ 0000010.7111 ]: ==== -> 020 [008 007 008] a_i = 0.3700 a_f = 0.4600 a_r = 0.4600 Action = FORCE(0) ====
[ 0000012.6102 ]: Force Calculation Nmesh = 256 ====
[ 0000012.6108 ]: Load imbalance is - 0.978743 / + 1.00771
[ 0000012.6204 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000012.8580 ]: D^2(0.46, 1.0) P(k<0.0654167) = 13858.1 Sigma8 = 1.50035
[ 0000012.8581 ]: writing power spectrum to powerspec-debug_0.4600.txt
[ 0000012.8604 ]: ==== -> 021 [008 008 008] a_i = 0.4126 a_f = 0.4600 a_r = 0.4600 Action = KICK(1) ====
[ 0000012.8908 ]: Checking Snapshots (0.4126 0.4600) with K(0.4600 0.4126 0.4600) D(0.4126 0.4600 0.4126)
[ 0000012.9093 ]: ==== -> 022 [008 009 008] a_i = 0.4600 a_f = 0.5030 a_r = 0.4600 Action = KICK(1) ====
[ 0000012.9377 ]: ==== -> 023 [009 009 008] a_i = 0.4600 a_f = 0.5030 a_r = 0.5030 Action = DRIFT(2) ====
[ 0000012.9603 ]: Checking Snapshots (0.4600 0.5030) with K(0.4600 0.5030 0.4600) D(0.5030 0.4600 0.5030)
[ 0000012.9735 ]: ==== -> 024 [010 009 008] a_i = 0.5030 a_f = 0.5500 a_r = 0.5030 Action = DRIFT(2) ====
[ 0000012.9977 ]: ==== -> 025 [010 009 010] a_i = 0.4600 a_f = 0.5500 a_r = 0.5500 Action = FORCE(0) ====
[ 0000014.8816 ]: Force Calculation Nmesh = 256 ====
[ 0000014.8817 ]: Load imbalance is - 0.975693 / + 1.00892
[ 0000014.8818 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000015.0216 ]: D^2(0.55, 1.0) P(k<0.0654167) = 13828.3 Sigma8 = 1.29591
[ 0000015.0217 ]: writing power spectrum to powerspec-debug_0.5500.txt
[ 0000015.0239 ]: ==== -> 026 [010 010 010] a_i = 0.5030 a_f = 0.5500 a_r = 0.5500 Action = KICK(1) ====
[ 0000015.0464 ]: Checking Snapshots (0.5030 0.5500) with K(0.5500 0.5030 0.5500) D(0.5030 0.5500 0.5030)
[ 0000015.0611 ]: ==== -> 027 [010 011 010] a_i = 0.5500 a_f = 0.5933 a_r = 0.5500 Action = KICK(1) ====
[ 0000015.0898 ]: ==== -> 028 [011 011 010] a_i = 0.5500 a_f = 0.5933 a_r = 0.5933 Action = DRIFT(2) ====
[ 0000015.1124 ]: Checking Snapshots (0.5500 0.5933) with K(0.5500 0.5933 0.5500) D(0.5933 0.5500 0.5933)
[ 0000015.1257 ]: ==== -> 029 [012 011 010] a_i = 0.5933 a_f = 0.6400 a_r = 0.5933 Action = DRIFT(2) ====
[ 0000015.1511 ]: ==== -> 030 [012 011 012] a_i = 0.5500 a_f = 0.6400 a_r = 0.6400 Action = FORCE(0) ====
[ 0000017.0261 ]: Force Calculation Nmesh = 256 ====
[ 0000017.0263 ]: Load imbalance is - 0.972651 / + 1.01064
[ 0000017.0263 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000017.1652 ]: D^2(0.64, 1.0) P(k<0.0654167) = 13797.2 Sigma8 = 1.15603
[ 0000017.1653 ]: writing power spectrum to powerspec-debug_0.6400.txt
[ 0000017.1675 ]: ==== -> 031 [012 012 012] a_i = 0.5933 a_f = 0.6400 a_r = 0.6400 Action = KICK(1) ====
[ 0000017.1903 ]: Checking Snapshots (0.5933 0.6400) with K(0.6400 0.5933 0.6400) D(0.5933 0.6400 0.5933)
[ 0000017.2052 ]: ==== -> 032 [012 013 012] a_i = 0.6400 a_f = 0.6835 a_r = 0.6400 Action = KICK(1) ====
[ 0000017.2328 ]: ==== -> 033 [013 013 012] a_i = 0.6400 a_f = 0.6835 a_r = 0.6835 Action = DRIFT(2) ====
[ 0000017.2554 ]: Checking Snapshots (0.6400 0.6835) with K(0.6400 0.6835 0.6400) D(0.6835 0.6400 0.6835)
[ 0000017.2688 ]: ==== -> 034 [014 013 012] a_i = 0.6835 a_f = 0.7300 a_r = 0.6835 Action = DRIFT(2) ====
[ 0000017.2938 ]: ==== -> 035 [014 013 014] a_i = 0.6400 a_f = 0.7300 a_r = 0.7300 Action = FORCE(0) ====
[ 0000019.1788 ]: Force Calculation Nmesh = 256 ====
[ 0000019.1790 ]: Load imbalance is - 0.969954 / + 1.01201
[ 0000019.1790 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000019.3179 ]: D^2(0.73, 1.0) P(k<0.0654167) = 13766.4 Sigma8 = 1.05672
[ 0000019.3180 ]: writing power spectrum to powerspec-debug_0.7300.txt
[ 0000019.3202 ]: ==== -> 036 [014 014 014] a_i = 0.6835 a_f = 0.7300 a_r = 0.7300 Action = KICK(1) ====
[ 0000019.3428 ]: Checking Snapshots (0.6835 0.7300) with K(0.7300 0.6835 0.7300) D(0.6835 0.7300 0.6835)
[ 0000019.3575 ]: ==== -> 037 [014 015 014] a_i = 0.7300 a_f = 0.7737 a_r = 0.7300 Action = KICK(1) ====
[ 0000019.3839 ]: ==== -> 038 [015 015 014] a_i = 0.7300 a_f = 0.7737 a_r = 0.7737 Action = DRIFT(2) ====
[ 0000019.4066 ]: Checking Snapshots (0.7300 0.7737) with K(0.7300 0.7737 0.7300) D(0.7737 0.7300 0.7737)
[ 0000019.4198 ]: ==== -> 039 [016 015 014] a_i = 0.7737 a_f = 0.8200 a_r = 0.7737 Action = DRIFT(2) ====
[ 0000019.4440 ]: ==== -> 040 [016 015 016] a_i = 0.7300 a_f = 0.8200 a_r = 0.8200 Action = FORCE(0) ====
[ 0000021.4030 ]: Force Calculation Nmesh = 256 ====
[ 0000021.4031 ]: Load imbalance is - 0.967896 / + 1.01337
[ 0000021.4032 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000021.5433 ]: D^2(0.82, 1.0) P(k<0.0654167) = 13737.4 Sigma8 = 0.984016
[ 0000021.5435 ]: writing power spectrum to powerspec-debug_0.8200.txt
[ 0000021.5457 ]: ==== -> 041 [016 016 016] a_i = 0.7737 a_f = 0.8200 a_r = 0.8200 Action = KICK(1) ====
[ 0000021.5683 ]: Checking Snapshots (0.7737 0.8200) with K(0.8200 0.7737 0.8200) D(0.7737 0.8200 0.7737)
[ 0000021.5830 ]: ==== -> 042 [016 017 016] a_i = 0.8200 a_f = 0.8638 a_r = 0.8200 Action = KICK(1) ====
[ 0000021.6095 ]: ==== -> 043 [017 017 016] a_i = 0.8200 a_f = 0.8638 a_r = 0.8638 Action = DRIFT(2) ====
[ 0000021.6328 ]: Checking Snapshots (0.8200 0.8638) with K(0.8200 0.8638 0.8200) D(0.8638 0.8200 0.8638)
[ 0000021.6461 ]: ==== -> 044 [018 017 016] a_i = 0.8638 a_f = 0.9100 a_r = 0.8638 Action = DRIFT(2) ====
[ 0000021.6703 ]: ==== -> 045 [018 017 018] a_i = 0.8200 a_f = 0.9100 a_r = 0.9100 Action = FORCE(0) ====
[ 0000023.5625 ]: Force Calculation Nmesh = 256 ====
[ 0000023.5626 ]: Load imbalance is - 0.966106 / + 1.01439
[ 0000023.5627 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000023.7012 ]: D^2(0.91, 1.0) P(k<0.0654167) = 13710.8 Sigma8 = 0.929605
[ 0000023.7013 ]: writing power spectrum to powerspec-debug_0.9100.txt
[ 0000023.7035 ]: ==== -> 046 [018 018 018] a_i = 0.8638 a_f = 0.9100 a_r = 0.9100 Action = KICK(1) ====
[ 0000023.7261 ]: Checking Snapshots (0.8638 0.9100) with K(0.9100 0.8638 0.9100) D(0.8638 0.9100 0.8638)
[ 0000023.7409 ]: ==== -> 047 [018 019 018] a_i = 0.9100 a_f = 0.9539 a_r = 0.9100 Action = KICK(1) ====
[ 0000023.7674 ]: ==== -> 048 [019 019 018] a_i = 0.9100 a_f = 0.9539 a_r = 0.9539 Action = DRIFT(2) ====
[ 0000023.7900 ]: Checking Snapshots (0.9100 0.9539) with K(0.9100 0.9539 0.9100) D(0.9539 0.9100 0.9539)
[ 0000023.8039 ]: ==== -> 049 [020 019 018] a_i = 0.9539 a_f = 1.0000 a_r = 0.9539 Action = DRIFT(2) ====
[ 0000023.8282 ]: ==== -> 050 [020 019 020] a_i = 0.9100 a_f = 1.0000 a_r = 1.0000 Action = FORCE(0) ====
[ 0000025.9182 ]: Force Calculation Nmesh = 256 ====
[ 0000025.9183 ]: Load imbalance is - 0.964375 / + 1.0153
[ 0000025.9183 ]: Peak memory usage on rank 0: 225.141 MB
[ 0000026.0805 ]: D^2(1, 1.0) P(k<0.0654167) = 13687 Sigma8 = 0.88807
[ 0000026.0808 ]: writing power spectrum to powerspec-debug_1.0000.txt
[ 0000026.0831 ]: ==== -> 051 [020 020 020] a_i = 0.9539 a_f = 1.0000 a_r = 1.0000 Action = KICK(1) ====
[ 0000026.1057 ]: Checking Snapshots (0.9539 1.0000) with K(1.0000 0.9539 1.0000) D(0.9539 1.0000 0.9539)
[ 0000026.1109 ]: Setting up snapshot at a = 1.0000 (z=0.0000)
[ 0000026.1110 ]: Growth factor of snapshot 1.0000 (a=1.0000)
[ 0000026.2014 ]: Writing to 2097152 paritlces to  1 files
[ 0000026.2377 ]: snapshot tpm_1.0000.bin written z = 0.0000 a = 1.0000
[ 0000026.9430 ]: Peak memory usage on rank 0: 257.656 MB
[ 0000026.9431 ]:      min      max     mean 
[ 0000026.9431 ]: --------------------------------------------------------------------------
[ 0000026.9432 ]:    24.95    24.95    24.95        evolve : run_fastpm : fastpm.c 
[ 0000026.9432 ]:     1.97     1.97     1.97            ic : run_fastpm : fastpm.c 
[ 0000026.9432 ]:     0.02     0.02     0.02          init : run_fastpm : fastpm.c 
[ 0000026.9433 ]: --------------------------------------------------------------------------
[ 0000026.9433 ]:     0.04     0.04     0.04            io : take_a_snapshot : fastpm.c 
[ 0000026.9433 ]:     0.00     0.00     0.00          meta : take_a_snapshot : fastpm.c 
[ 0000026.9434 ]: --------------------------------------------------------------------------
[ 0000026.9434 ]:     1.67     1.68     1.67       compute : write_powerspectrum : fastpm.c 
[ 0000026.9434 ]:     0.00     0.00     0.00            io : write_powerspectrum : fastpm.c 
[ 0000026.9435 ]: --------------------------------------------------------------------------
[ 0000026.9435 ]:     6.39     6.58     6.50           c2r : fastpm_gravity_calculate : gravity.c 
[ 0000026.9435 ]:     2.26     2.27     2.27        ghosts : fastpm_gravity_calculate : gravity.c 
[ 0000026.9435 ]:     1.26     1.44     1.32         paint : fastpm_gravity_calculate : gravity.c 
[ 0000026.9436 ]:     2.52     2.69     2.61           r2c : fastpm_gravity_calculate : gravity.c 
[ 0000026.9436 ]:     2.66     2.80     2.72       readout : fastpm_gravity_calculate : gravity.c 
[ 0000026.9436 ]:     0.22     0.37     0.31        reduce : fastpm_gravity_calculate : gravity.c 
[ 0000026.9437 ]:     4.44     4.60     4.51      transfer : fastpm_gravity_calculate : gravity.c 
[ 0000026.9437 ]: --------------------------------------------------------------------------
[ 0000026.9437 ]:     0.26     0.27     0.27         drift : fastpm_do_drift : solver.c 
[ 0000026.9437 ]: --------------------------------------------------------------------------
[ 0000026.9438 ]:     1.69     1.69     1.69    afterforce : fastpm_do_force : solver.c 
[ 0000026.9438 ]:     0.79     0.79     0.79     decompose : fastpm_do_force : solver.c 
[ 0000026.9438 ]:    20.26    20.26    20.26         force : fastpm_do_force : solver.c 
[ 0000026.9439 ]: --------------------------------------------------------------------------
[ 0000026.9439 ]:     0.82     0.84     0.83  interpolation : fastpm_do_interpolation : solver.c 
[ 0000026.9439 ]: --------------------------------------------------------------------------
[ 0000026.9440 ]:     0.29     0.33     0.30          kick : fastpm_do_kick : solver.c 
[ 0000026.9440 ]: --------------------------------------------------------------------------
[ 0000026.9440 ]:     0.02     0.02     0.02        warmup : fastpm_do_warmup : solver.c 
[ 0000026.9440 ]: --------------------------------------------------------------------------
[ 0000026.9441 ]:     0.00     0.00     0.00  aftertransit : fastpm_solver_evolve : solver.c 
[ 0000026.9441 ]:     0.02     0.08     0.06  beforetransit : fastpm_solver_evolve : solver.c 

In [9]:
!ls -l tpm_1.0000*


-rw-rw-r--. 1 yfeng1 yfeng1 67108892 Apr 14 13:39 tpm_1.0000.bin.00

In [17]:
part = TPMBinaryCatalog('tpm_1.0000.bin.*', attrs=dict(BoxSize=384.0))
part['Position'] *= part.attrs['BoxSize']
part['Velocity'] *= part.attrs['BoxSize']

In [8]:
mesh = BigFileMesh('fastpm_1.0000/', 'DensityK')

In [9]:
field = mesh.to_field(mode='complex')

In [10]:
image = mesh.preview(axes=(0, 1))

In [11]:
imshow(image)


Out[11]:
<matplotlib.image.AxesImage at 0x7f16563c8780>

In [18]:
image = part.to_mesh(Nmesh=128).preview(axes=(0, 1))

In [19]:
imshow(image)


Out[19]:
<matplotlib.image.AxesImage at 0x7f1654aa8198>

In [ ]: