plt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title plt.rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels l_max = 100000 mmins = ['1e7', '1e8', '1e9', '1e10', '1e11', '1e12', '1e13', '1e14', '1e15'] clean = False if len(sys.argv) == 2: clean = (sys.argv[1] == 'clean') CFHT_data = True thetasCFHT = get.thetas() xipCFHT = get.xip() ximCFHT = get.xim() sigmCFHT = get.sigm() sigpCFHT = get.sigp() begin_color = Color("blue") colors = list(begin_color.range_to(Color("green"), len(mmins))) create.xi_CFHT_mmin(mmins, l_max, clean=clean) os.system('mkdir -p figures/correlation/') plt.figure(1).set_size_inches((8, 8), forward=False) plt.figure(3).set_size_inches((8, 8), forward=False) # Get x_axis x_axis = dat.get_x_axis_mmin()
mmin_st = 7.0 x = dataCFHT.thetas() # Data from CFHTLenS survey xip = dataCFHT.xip() xim = dataCFHT.xim() y = xip.copy() y = np.append(y, xim) # Considering the real covariance matrix and all kind of errors yerr = dataCFHT.cov_mat() yerrinv = np.linalg.inv(yerr) det = np.linalg.det(yerr) errp = dataCFHT.sigp() errm = dataCFHT.sigm() chain = np.load('mcmc/results/{1}/ihm={2}/mmin_chain{0}.npy'.format( *[icosmo, usedData, ihm])) otherchain = chain.reshape((nwalkers, steps, ndim)) # removing first steps samples = chain[:, firsts:, :].reshape((-1, ndim)) # plot model with results os.system("mkdir -p mcmc/figures/{0}/ihm={1}/".format(*[usedData, ihm])) if usedData == 'CFHT': model = correlation.xi_mminCFHT(mmin_ml, icosmo, ihm, True)
# Length of CFHT thetas data N = 21 x = data.thetas() # Data from CFHTLenS survey xip = data.xip() xim = data.xim() y = xip.copy() y = np.append(y, xim) # Considering the real covariance matrix and all kind of errors yerr = data.cov_mat() yerrinv = np.linalg.inv(yerr) det = np.linalg.det(yerr) errp = data.sigp() errm = data.sigm() def lnlike(param, y, invcov, verbose=False): alpha = param[0] if not (0.5 <= alpha <= 1.5): return -np.inf model = correlation.xi_ampCFHT(alpha, icosmo, ihm, verbose=verbose) if model[0] == -np.pi: return -np.inf return -0.5 * np.matmul(np.transpose(y - model), np.matmul(invcov, (y - model))) os.system("mkdir -p mcmc/figures/CFHT/likehood/ihm={0}".format(ihm)) os.system("mkdir -p mcmc/data/ihm={0}".format(ihm))
# Length of CFHT thetas data N = 21 x = dat.thetas() # Data from CFHTLenS survey xip = dat.xip() xim = dat.xim() y = xip.copy() y = np.append(y, xim) # Considering the real covariance matrix and all kind of errors yerr = dat.cov_mat() yerrinv = np.linalg.inv(yerr) det = np.linalg.det(yerr) errp = dat.sigp() errm = dat.sigm() def lnlike(param, y, invcov, verbose=False): alpha = param[0] if not (0.5 < alpha < 1.5): return -np.inf model = correlation.xi_ampCFHT(alpha, icosmo, ihm, verbose=verbose) if model[0] == -np.pi: return -np.inf return -0.5 * np.matmul(np.transpose(y - model), np.matmul(invcov, (y - model))) if not MCMC: print("Fitting model only mode")