Code Monkey home page Code Monkey logo

pysz_gal's Introduction

pysz_gal

This is the python code for the calculation of the thermal SZ power spectrum and its cross correlation with galaxies. The part of tSZ power spectrum calculation is based on the fortran code szfast devoloped by Eiichiro Komatsu, but there are several important updates e.g., treatment of neutrino mass in the calculation of mass function, mass-concentration relation, etc. Please see Makiya et al. 2018 and Makiya et al. 2020 for the details of the updates and calculation of tSZ-galaxy cross-power spectra.

Another tSZ power spectrum code, class_sz, is also based on the fastsz. I have confirmed that the outputs of pysz and class_sz within the numerical uncertainties.

NOTICE The code is under developement. Please ask me if you want to use the code in your research project.

INSTALL

  1. Move to source directory
cd pysz_gal/pysz_gal/source
  1. Compile fortran codes
make clean && make

if you can not make it, modify Makefile in this directory

  1. then go back to top directory of pysz_gal and install python modules
cd PYSZDIRECTORY
python setup.py install
  1. sample code
import pysz_gal.pysz_gal as szgal
calc_cls = szgal.tsz_gal_cl() # init class
## Set params ##
ell = np.logspace(1,np.log10(1500),10)
dndz = np.loadtxt('./dndz_example.txt')
h0 = 0.67
ombh2 = 0.02225
omch2 = 0.1198
lnAs = 3.065
ns = 0.9645
mnu = 0.06
bias = 1.55
Mcut = 10**11.8
M1 = 10**11.73
kappa = 1.0
sigma_Ncen = 0.15
alp_Nsat = 0.77
rmax = 4.39
rgs = 1.17
pars = {'h0':h0, 'obh2':ombh2,'och2':omch2,\
        'As':np.exp(lnAs)*1e-10,'ns':ns,'mnu':mnu,\
        'mass_bias':bias,\
        'Mcut':Mcut,'M1':M1,'kappa':kappa,'sigma_Ncen':sigma_Ncen,'alp_Nsat':alp_Nsat,\
        'rmax':rmax,'rgs':rgs,\
        'flag_nu':True,'flag_tll':False}
## get Cls ##
gg, gy, tll = szgal_cl.get_tsz_cl(ell,pars,dndz,1e-5,1.0)

pysz_gal's People

Contributors

ryumakiya avatar damonge avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.