-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_tomographic_demo.py
56 lines (37 loc) · 1.37 KB
/
run_tomographic_demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#__________________________________#
# GLaSS #
# Peter Taylor #
# Mullard Space Laboratory #
# University College London #
# 2018 #
#__________________________________#
import sys
import os
import GLaSS
import numpy as np
#__________________________________#
# setup and run cosmosis pipeline #
#__________________________________#
cosmosis_path = os.environ['COSMOSIS_SRC_DIR']
sys.path.append(cosmosis_path)
#you can also hard code the path to cosmosis
#in manually if above doesn't work
#sys.path.append('/Users/peter/codes/cosmosis/')
from cosmosis.runtime.config import Inifile
from cosmosis.runtime.pipeline import LikelihoodPipeline
cwd = os.getcwd()
file = cwd + '/demo-tomographic.ini'
ini = Inifile(file)
pipeline = LikelihoodPipeline(ini)
pipeline.quiet = True
pipeline.debug = False
pipeline.timing = True
data = pipeline.run_parameters([])
#__________________________________#
# get back the data #
#__________________________________#
c_l_storage_array = data["3d_weak_lensing_output", "c_l_storage_array"]
shot_noise_storage_array = data["3d_weak_lensing_output", "shot_noise_storage_array"]
k_samps = data["3d_weak_lensing_output", "k_samps"]
z_samps = data["3d_weak_lensing_output", "z_samps"]
l_input_array = data["3d_weak_lensing_output", "l_input_array"]