GithubHelp home page GithubHelp logo

misharash / hipster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oliverphilcox/hipster

0.0 0.0 0.0 19.97 MB

HIPSTER: HIgh-k Power SpecTrum and bispectrum EstimatoR

Shell 3.74% C++ 13.49% Python 3.10% C 2.76% Makefile 0.06% Jupyter Notebook 76.85%

hipster's Introduction

HIPSTER

HIgh-k Power Spectrum EstimatoR

Code to compute small-scale power spectra and isotropic bispectra for cosmological simulations and galaxy surveys of arbitrary shape, based on the configuration space estimators of Philcox & Eisenstein (2019, MNRAS, arXiv) and Philcox (2020, submitted, arXiv). This computes the Legendre multipoles of the power spectrum, P_l(k) or bispectrum, B_l(k1,k2) by computing weighted pair counts over the simulation box or survey, truncated at some maximum radius R_0. This fully accounts for window function effects, does not include shot-noise or aliasing, and is optimized for small-scale spectrum computation in real- or redshift-space. Both the power spectrum and bispectrum estimators have efficiency O(N^2) for N particles, and become faster at large k. We additionally include a Lyman-alpha power spectrum estimator based on de Belsunce et al. (2024, arXiv), which performs an efficient real-space computation of the spectrum, summing over different observational skewers. In this case, the estimator does not remove the window function effects (which can be large, since the geometry is highly non-spherical), but instead computes it at high-resolution, from the pair-count.

The code can be run either in 'aperiodic' or 'periodic' mode, for galaxy surveys or cosmological simulations respectively. The 'periodic' mode contains various optimizations relating to the periodic geometry, as detailed in the second paper. HIPSTER also supports weighted spectra, for example when tracer particles are weighted by their mass in a multi-species simulation. Generalization to anisotropic bispectra is straightforward (and requires no additional computing time) and can be added on request.

Full documentation of HIPSTER is available on ReadTheDocs, and we provide a Jupyter Notebook discussing the applicaition to Lyman-alpha.

Basic Usage

To compute a power spectrum from particles in a periodic simulation box (data.dat) up to l=L with pair-counts truncated at radius R_0 using k-space binning file binning.csv and 4 CPU cores, run:

./hipster_wrapper_periodic.sh --dat data.dat --l_max L -R0 R0 -k_bin binning.csv --nthreads 4

To compute a power spectrum from galaxies in a non-periodic survey (data.dat), defined by a set of randoms (randoms.dat), up to l=L, truncating pair-counts at R_0 and using k-space binning file binning.csv, with 4 CPU-cores, run:

./hipster_wrapper.sh --dat galaxies.dat --ran_DR randoms.dat --ran_RR randoms.dat -l_max L -R0 R0 -k_bin binning.csv --nthreads 4

To compute an isotropic bispectrum from particles in a periodic simulation box (data.dat) up to l=L with pair-counts truncated at radius R_0 using k-space binning file binning.csv and 4 CPU cores, using 3 times as many random points as data points, run:

./hipster_wrapper_bispectrum.sh --dat data.dat --l_max L -R0 R0 -k_bin binning.csv --nthreads 4 --f_rand 3

To compute a 3D Lyman-alpha power spectrum from Lya pixels in a non-periodic survey (lya-data.dat, including the x, y, z positions, (weighted) fractional overdensity fields and skewer IDs), up to l=L, truncating pair-counts at R_0 and using k-space binning file binning.csv, with 4 CPU-cores, run:

./hipster_wrapper_lya.sh --dat lya-data.dat --ran_RR lya-pixels.dat -l_max L -R0 R0 -k_bin binning.csv --nthreads 4

For Lyman-alpha, one must convolve the desired theory models with an appropriate window function, which is also computed by HIPSTER. This is discussed in the Jupyter notebook. We also provide a sample submission script for using the Lyman-alpha code on a cluster.

For any queries regarding the code please contact Oliver Philcox.

New for version 2: Optimizations for periodic N-body simulations

New for version 3: A new pair-count estimator for the periodic bispectrum

New for version 4: A new pair-count estimator for Lyman-alpha power spectra

hipster's People

Contributors

texify[bot] avatar oliverphilcox 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.