In [1]:
import pandas as pd
import numpy as np
import os
%matplotlib inline
import matplotlib.pyplot as plt
from haloPropertyAnalysis.comparisons import Sim, CompareSims
In [28]:
from lsscosmo import halomassfunction as hmf
from lsscosmo import psutils as psu
from lsscosmo import hacc
from utils import plotutils as pu
In [73]:
example_data = '/Users/rbiswas/data/datastar'
datadir = os.path.join(example_data,'simulations/')
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000indatfile = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/indat.params")
M000n1indatfile = "/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/L2100/HACC000/run/indat.params"
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000n1Simtransfer='/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/CAMB/cmbM001n.tf'
M000 = hacc.haccsim(M000indatfile, name = "M000")
M000n1 = hacc.haccsim(M000n1indatfile, name = "M000n1")
M011indatfile = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/indat.params")
M011Simtransfer = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/cmbM011.tf")
M011Simtransfer = '/Users/rbiswas/data/datastar/simulations/MiraU/Grid/MiraU/Grid/M011/L2100/HACC000/run/cmbM011.tf'
In [ ]:
In [74]:
M011 = hacc.haccsim(M011indatfile, name='M011')
In [4]:
M000ps = psu.powerspectrum(koverh=None,
pstype="matter",
sigma8type="matter",
asciifile=M000simtransfer,
cosmo=M000.cosmo)
M000n1cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
In [5]:
datastar = '/Users/rbiswas/data/datastar'
M000n1dir = os.path.join(datastar, 'clustering')
M000dir = os.path.join(datastar, 'Testing_z2')
M000n1D
In [7]:
LCDM = Sim(simulationDir=M000dir, name='M000')
nLCDM = Sim(simulationDir=M000n1dir, name='M000n1')
# EnuLCDM = Sim(simulationDir=M011dir, name='M011')
In [86]:
cmpLCDMnLCDM = CompareSims(LCDM, nLCDM)
df = cmpLCDMnLCDM.comparisons
df.to_csv('M000M000n1comparisons.csv', index=None)
fig = cmpLCDMnLCDM.plotSuppression()
In [75]:
M000ps = psu.powerspectrum(koverh=None,
pstype="matter",
sigma8type="matter",
asciifile=M000simtransfer,
cosmo=M000.cosmo)
M000n1cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M011cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M011Simtransfer,
cosmo=M011.cosmo)
In [80]:
M011cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M011Simtransfer,
cosmo=M011.cosmo)
In [79]:
from lsscosmo import psutils as psu
In [91]:
massininvh = np.logspace(12, 15)
M000h = M000.cosmo.h
M000n1h = M000n1.cosmo.h
M011h = M011.cosmo.h
step=499
MF_M000_0 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
MF_M000n1_0 = hmf.dndlnM0(massininvh/M000n1h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ M000n1h**3
MF_M011_0 = hmf.dndlnM0(massininvh/M011h, ps=M000n1cbmps, cosmo=M011.cosmo,
z=M011.steptoredshift(step))/ M011h**3
step=247
MF_M000_1 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
MF_M000n1_1 = hmf.dndlnM0(massininvh/M000n1h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ M000n1h**3
MF_M011_1 = hmf.dndlnM0(massininvh/h, ps=M000n1cbmps, cosmo=M011.cosmo,
z=M011.steptoredshift(step))/ M011h**3
step=163
MF_M000_2 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
MF_M000n1_2 = hmf.dndlnM0(massininvh/M000n1h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ M000n1h**3
MF_M011_2 = hmf.dndlnM0(massininvh/M011h, ps=M000n1cbmps, cosmo=M011.cosmo,
z=M011.steptoredshift(step))/ M011h**3
In [20]:
plt.loglog(massininvh/M000h , MF_M000_0, '-k', label='LCDM')
plt.loglog(massininvh/M000h , MF_M000_1, '-k')
plt.loglog(massininvh/M000h , MF_M000_2, '-k')
plt.loglog(massininvh/M000n1h , MF_M000n1_0, '-r', label='nLCDM')
plt.loglog(massininvh/M000n1h , MF_M000n1_1, '-r')
plt.loglog(massininvh/M000n1h , MF_M000n1_2, '-r')
plt.grid(True)
plt.legend(loc='best')
Out[20]:
In [87]:
fig
Out[87]:
In [88]:
fig.axes[1].set_ylabel('ratio of mass function for neutrino to mass funciton for LCDM')
Out[88]:
In [89]:
example_data = '/Users/rbiswas/data/datastar'
datadir = os.path.join(example_data,'simulations/')
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000indatfile = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/indat.params")
M000n1indatfile = "/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/L2100/HACC000/run/indat.params"
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000n1Simtransfer='/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/CAMB/cmbM001n.tf'
M000 = hacc.haccsim(M000indatfile, name = "M000")
M000n1 = hacc.haccsim(M000n1indatfile, name = "M000n1")
In [92]:
fig.axes[0].plot(massininvh, MF_M000n1_0 / MF_M000_0, 'k')
fig.axes[1].plot(massininvh, MF_M000n1_1 / MF_M000_1, 'k')
fig.axes[2].plot(massininvh, MF_M000n1_2 / MF_M000_2, 'k')
fig.axes[0].plot(massininvh, MF_M011_0 / MF_M000_0, 'r')
fig.axes[1].plot(massininvh, MF_M011_1 / MF_M000_1, 'r')
fig.axes[2].plot(massininvh, MF_M011_2 / MF_M000_2, 'r')
Out[92]:
In [93]:
fig
Out[93]:
In [58]:
fig.savefig('suppression_M000n1.pdf')
In [38]:
from interfacecosmology import psutils as psu
In [54]:
M000n1cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M000n1cbps = psu.powerspectrum(koverh=M000n1cbmps[0],
pstype="cb",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M000n1ps = psu.powerspectrum(koverh=M000n1cbmps[0],
pstype="matter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M000n1cbmps_1 = psu.powerspectrum(koverh=None,
z=1.0,
pstype="cbmatter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M000n1cbps_1 = psu.powerspectrum(koverh=M000n1cbmps[0],
pstype="cb",
meth
z=1.0,
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
M000n1ps_1 = psu.powerspectrum(koverh=M000n1cbmps[0],
pstype="matter",
z=1.0,
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
In [51]:
fig, ax0, ax1 = pu.settwopanel(setdifflimits=[0.4, 1.4])
ax0.plot(M000n1cbmps[0], M000n1cbmps[1], 'k')
ax0.plot(M000n1cbmps[0], M000n1cbps[1], 'r')
ax1.plot(M000n1cbmps[0], M000n1cbmps[1]/M000n1cbps[1], '-k')
ax1.plot(M000n1cbmps[0], M000n1cbmps[1]/M000n1ps[1], '-r')
ax0.set_xscale('log')
ax0.set_yscale('log')
ax1.set_xscale('log')
In [57]:
plt.plot(M000n1cbmps[0], M000n1cbmps_1[1]/M000n1cbmps[1], '-k')
plt.ylim(0.5, 1.5)
Out[57]:
In [46]:
delta_omegam = M000n1.cosmo.Om0 - (M000n1.cosmo.Ob0 + M000n1.cosmo.Oc0)
In [47]:
delta_omegam /
Out[47]:
In [17]:
plt.errorbar(LCDM.mf_results(247).FOF_Mass,
LCDM.mf_results(247).dndlnM,
yerr=LCDM.mf_results(247).frac_Err * LCDM.mf_results(499).dndlnM,
fmt='o')
plt.xscale('log')
plt.yscale('log')
In [18]:
LCDM.mf_results(499)
Out[18]:
In [19]:
xx = LCDM.mf_results(499).copy(deep=True)
In [20]:
xx['recalc'] = xx.numClusters**(-0.5)
xx[['recalc', 'frac_Err']]
Out[20]:
In [21]:
df.M000_MF * df.numClusters1**(-0.5) / df.ApproxErrorHigh
Out[21]:
In [22]:
df.M000_MF * df.numClusters1**(-0.5) / df.ApproxErrorLow
Out[22]:
In [23]:
from astropy.cosmology import Planck13 as cosmo
In [24]:
M000indatfile = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/indat.params")
In [33]:
from lsscosmo import halomassfunction as hmf
from lsscosmo import psutils as psu
from lsscosmo import hacc
example_data = '/Users/rbiswas/data/datastar'
datadir = os.path.join(example_data,'simulations/')
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000indatfile = os.path.join(datadir, "MiraU/Grid/M000/L2100/HACC001/run/indat.params")
M000n1indatfile = "/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/L2100/HACC000/run/indat.params"
M000simtransfer = os.path.join(datadir, "MiraU/Grid/M000/CAMB/cmbM000.tf")
M000n1Simtransfer='/Users/rbiswas/data/datastar/simulations/Neutrinos/M000n1/CAMB/cmbM001n.tf'
M000 = hacc.haccsim(M000indatfile, name = "M000")
M000n1 = hacc.haccsim(M000n1indatfile, name = "M000n1")
In [42]:
M000ps = psu.powerspectrum(koverh=None,
pstype="matter",
sigma8type="matter",
asciifile=M000simtransfer,
cosmo=M000.cosmo)
M000n1cbmps = psu.powerspectrum(koverh=None,
pstype="cbmatter",
sigma8type="matter",
asciifile=M000n1Simtransfer,
cosmo=M000n1.cosmo)
In [52]:
massininvh = np.logspace(12, 15)
M000h = M000.cosmo.h
step=499
MF_M000_0 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
h = M000n1.cosmo.h
MF_M000n1_0 = hmf.dndlnM0(massininvh/h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ h**3
step=247
MF_M000_1 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
h = M000n1.cosmo.h
MF_M000n1_1 = hmf.dndlnM0(massininvh/h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ h**3
step=163
MF_M000_2 = hmf.dndlnM0(massininvh/M000h, ps=M000ps, cosmo=M000.cosmo,
z=M000.steptoredshift(step))/ M000h**3
h = M000n1.cosmo.h
MF_M000n1_2 = hmf.dndlnM0(massininvh/h, ps=M000n1cbmps, cosmo=M000n1.cosmo,
z=M000n1.steptoredshift(step))/ h**3
plt.plot(massininvh, MF_M000n1 / MF_M000)
Out[52]:
In [31]:
dir(LCDM)
Out[31]:
In [ ]:
In [44]:
massininvh = np.logspace(12,15)
In [45]:
massininvh
Out[45]:
In [ ]: