Snapshots

Snapshots object stores the information how a lightcone is build from snapshots

snapshots = Snapshots()

snapshot.insert(filename_fof, filename_halo_mass, [a_snp, a_min, a_max])

Argument Explaination
filename_fof Filename of the halo catalogue at a_snp
filename_halo_mass Filename for the nfof - halo_mass calibration
a_min, a_max Range of scale factor used for a lightcone
Method Result
len(snapshots) Number of snapshots inserted
snapshot[i] A tuple (filename_fof, a_snp, a_min, a_max) for i the snapshot

In [1]:
import json
import mockgallib as mock

# Snapshot data are written in ../data/param.json file
with open('../data/param.json', 'r') as f:
    param = json.load(f)

print('snapshot data in param.json')
param['snapshots']


snapshot data in param.json
Out[1]:
[{'a': [0.45, 0.452, 0.475], 'abc': 'a'},
 {'a': [0.5, 0.475, 0.525], 'abc': 'b'},
 {'a': [0.55, 0.525, 0.575], 'abc': 'c'},
 {'a': [0.6, 0.575, 0.625], 'abc': 'd'},
 {'a': [0.65, 0.625, 0.675], 'abc': 'e'},
 {'a': [0.7, 0.675, 0.72], 'abc': 'f'}]

In [3]:
snapshots = mock.Snapshots()

for snp in param['snapshots']:
    abc = snp['abc']
    filename_fof = '../data/fof/%s/fof06100%s' % (abc, abc)
    filename_halo_mass = '../data/halo_mass/halomass_%s.txt' % abc

    snapshots.insert(filename_fof, filename_halo_mass, snp['a'])

    
print(len(snapshots))
    
for snp in snapshots:
    print(snp)


6
('../data/fof/a/fof06100a', 0.45, 0.452, 0.475)
('../data/fof/b/fof06100b', 0.5, 0.475, 0.525)
('../data/fof/c/fof06100c', 0.55, 0.525, 0.575)
('../data/fof/d/fof06100d', 0.6, 0.575, 0.625)
('../data/fof/e/fof06100e', 0.65, 0.625, 0.675)
('../data/fof/f/fof06100f', 0.7, 0.675, 0.72)

In [4]:
%%html
<style>table {float:left}</style>