Пример #1
0
 def __init__(self):
     Function.__init__(self)
     #physical distance for each model
     self.d = dDGP()
     self.dcdm = dsfq()
     self.dcdm.update(factor=0)
Пример #2
0
import numpy as np
from functions.sfq import dL as dsfq
import matplotlib.pyplot as plt
from functions.parent import Function
from functions.dL_PartIII import dL as dDGP

#create luminosity distance functions
d_DGP = dDGP()
d_CDM = dsfq()
#redshifts at which to calculate aggregate accuracy
z1 = 0.5
z2 = 1.32

#range of z values
rangz = np.arange(0., 2., 0.1)

#create figure and axes, set figure size
fig, ax = plt.subplots(figsize=(4, 3))

#create legend
#legend = ([])

#set x and y axis limits
ax.set_xlim(left=0.0, right=2.0)

plt.xlabel('Redshift z')  #label x axis
plt.ylabel('$\\Delta d_{L}/d_{L}$')  #label y axis


#create a function to calculate the aggregate accuracy
class agg_accuracy(Function):
Пример #3
0
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from functions.sfq import dsfq
from data.getdata import obtaindata
import math

cosmo_const = dsfq()

# results = obtaindata('data.csv')
# for datapoint in results:
#     z = datapoint[0]
#     d_z = datapoint[1]
cosmo_const.update(factor = 0)
fig, ax = plt.subplots()
cosmo_const.plot(ax, [0.2,1.7], 0.1)

cosmo_const.update(factor=1, at=0.50, tau=0.33, wp=0, wm=0, wf=-1)
cosmo_const.plot(ax, [0,1.7], 0.1)
cosmo_const.update(factor = 1, at=0.23, tau=0.33, wp=0, wm=0, wf=-1)
cosmo_const.plot(ax, [0, 1.7], 0.1)
ax.set_xlabel(r'$z$')
ax.set_ylabel(r'$d_L$') #to Alice: find out the units

fig.show()
input()
Пример #4
0
import numpy as np
from functions.sfq import dsfq
import matplotlib.pyplot as plt
from functions.parent import Function

#create luminosity distance functions
dsfq1 = dsfq()
dcdm = dsfq()
#redshifts at which to calculate aggregate accuracy
z1 = 0.5
z2 = 1.32

#range of z values
rangz = np.arange(0., 2., 0.1)

#create figure and axes, set figure size
fig, ax = plt.subplots(figsize=(4, 3))

#create legend
#dL_legend = ([])

#set x and y axis limits
ax.set_xlim(left=0.0, right=2.0)

plt.xlabel('Redshift z')  #label x axis
plt.ylabel('$\\Delta d_{L}/d_{L}$')  #label y axis


#create a function to calculate the aggregate accuracy
class agg_accuracy(Function):
    def __init__(self):
Пример #5
0
import numpy as np
from functions.sfq import dsfq
import matplotlib.pyplot as plt
from functions.parent import Function

#create luminosity distance functions
dsfq2 = dsfq()
dcdm = dsfq()
#redshifts at which to calculate aggregate accuracy
z1 = 0.5
z2 = 1.32

#range of z values
rangz = np.arange(0., 2., 0.1)

#create figure and axes, set figure size
fig, ax = plt.subplots(figsize=(4, 3))

#create legend
#dL_legend = ([])

#set x and y axis limits
ax.set_xlim(left=0.0, right=2.0)

plt.xlabel('Redshift z')  #label x axis
plt.ylabel('$\\Delta d_{L}/d_{L}$')  #label y axis


#create a function to calculate the aggregate accuracy
class agg_accuracy(Function):
    def __init__(self):
Пример #6
0
import math
from functions.sfq import dsfq

#create luminosity distance functions
dsfq1 = dsfq()
dsfq2 = dsfq()
dcdm = dsfq()

#redshifts at which to calculate aggregate accuracy
z1 = 0.5
z2 = 1.32

#assign appropriate values in luminosity distance functions for SFQ-I, SFQ-II and Lambda-CDM models
dsfq1.update(factor=1, at=0.50, tau=0.33, wp=0, wm=0, wf=-1)
dsfq2.update(factor=1, at=0.23, tau=0.33, wp=0, wm=0, wf=-1)
dcdm.update(factor=0)

#calculate d_L for each model at redshift z=0.5
d_L1 = dsfq1.cal(z1)
d_L2 = dsfq2.cal(z1)
d_lamcdm = dcdm.cal(z1)
#find aggregate accuracy for SFQ-I model
aggy1 = abs((d_L1 - d_lamcdm) / d_L1)
print('sfq1 (z = ' + str(z1) + '):' + str(aggy1))
#find aggregate accuracy for SFQ-I model
aggy2 = abs((d_L2 - d_lamcdm) / d_L2)
print('sfq2 (z = ' + str(z1) + '):' + str(aggy2))

#calculate d_L for each model at redshift z=1.32
d_L1 = dsfq1.cal(z2)
d_L2 = dsfq2.cal(z2)