Skip to content

Commit f12ff9a

Browse files
committed
ra dec qso
Signed-off-by: Anto Idicherian Lonappan <[email protected]>
1 parent c5749bb commit f12ff9a

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

marcia/database.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,25 @@ def get_SNE(self):
193193
@load_data_once
194194
def get_QSO_data(self):
195195
data = loadtxt(os.path.join(__datapath__, 'Quasars','table3.dat'), usecols=(3,4,5,6,7,9,10, 11, 12))
196+
position = loadtxt(os.path.join(__datapath__, 'Quasars','table3.dat'), usecols=(1,2))
197+
ra = position[:,0]
198+
dec = position[:,1]
196199
z, lnFUV, lnFUV_err, lnFX, lnFX_err = data[:,0], data[:,1], data[:,2], data[:,3], data[:,4]
197200
DM, dDM = data[:,7], data[:,8]
198-
return z, lnFUV, lnFUV_err, lnFX, lnFX_err, DM, dDM
201+
return z, lnFUV, lnFUV_err, lnFX, lnFX_err, DM, dDM, ra, dec
199202

200203
def get_QSO_full(self):
201-
z, lnFUV, lnFUV_err, lnFX, lnFX_err, _, _ = self.get_QSO_data()
204+
z, lnFUV, lnFUV_err, lnFX, lnFX_err, _, _ ,_,_= self.get_QSO_data()
202205
return z, lnFUV, lnFUV_err, lnFX, lnFX_err
203206

204207
def get_QSO(self):
205-
x,_,_,_,_,y,sigma = self.get_QSO_data()
208+
x,_,_,_,_,y,sigma,_,_ = self.get_QSO_data()
206209
covar = np.diag(sigma**2)
207210
return x,y,covar
211+
212+
def get_QSO_position(self):
213+
_,_,_,_,_,_,_,ra,dec = self.get_QSO_data()
214+
return ra,dec
208215

209216
def get_CMB_planck_TT(self):
210217
# This is the Planck 2018 data special case where we want

marcia/sampler.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,23 @@ def get_burnin(self):
8989
print(f'Burn-in: {burnin} and thin: {thin}')
9090
except:
9191
print('Autocorrelation time could not be calculated, increase the number of iterations')
92-
burnin = 0
93-
thin = 1
92+
burnin = 100
93+
thin = 10
9494
print(f'Burn-in: {burnin} and thin: {thin}[DEFAULT VALUES]')
9595
return burnin, thin
9696

97-
def get_chain(self, getdist=False):
97+
def get_chain(self, getdist=False,burnin=None,thin=None):
9898
sampler = self.HDFBackend
9999
if sampler.iteration < self.max_n:
100100
print(f'Only {sampler.iteration} iterations completed')
101101
print(f'You should run the sampler to finsih the sampling of {self.max_n} iterations')
102-
burnin, thin = self.get_burnin()
102+
if (burnin is None) and (thin is None):
103+
burnin, thin = self.get_burnin()
104+
elif burnin is None:
105+
burnin,_ = self.get_burnin()
106+
elif thin is None:
107+
_,thin = self.get_burning()
108+
103109
samples = sampler.get_chain(discard=burnin, thin=thin, flat=True)
104110
if getdist:
105111
lnprob = sampler.get_log_prob(discard=burnin, thin=thin, flat=True)
@@ -109,8 +115,8 @@ def get_chain(self, getdist=False):
109115
samples = np.concatenate((lnprob[:, None], lnprior[:, None], samples), axis=1)
110116
return samples
111117

112-
def corner_plot(self, getdist=False):
113-
chains = self.get_chain()
118+
def corner_plot(self, getdist=False,burnin=None,thin=None):
119+
chains = self.get_chain(getdist,burnin,thin)
114120
names = self.likelihood.theory.param.parameters
115121
labels = [p.replace('$', '') for p in self.likelihood.theory.labels]
116122
if getdist:

0 commit comments

Comments
 (0)