Skip to main content

Python library for computing the number of absorption features of the 21 cm forest in a semianalytic formalism.

Project description

HAYASHI

(Halo-level AnalYsis of the Absorption Signal in HI)

arXiv DOI Python License: MIT

(hayashi means forest in japanese)

Python library for computing the number of absorption features of the 21 cm forest in a semianalytic formalism. Includes the enhancement of the signal due to the presence of substructures within minihalos, as studied in arXiv:2209.01305. It supports non-standard cosmologies with impact in the large scale structure, such as warm dark matter and primordial black holes. See the papers arXiv:2209.01305, arXiv:2104.10695 for more details.

Read the documentation here.

Installation

The code is written in Python3, and makes use of the package for cosmological computations Colossus, as well as several standard Python libraries(numpy,scipy,tqdm), which are automatically installed when hayashi is installed.

For installing the Python package from PyPI:

pip install hayashi

Usage

The basis of the code is the 21 cm Forest class. Given a redshift and the temperature of the intergalactic medium at that epoch, we can define an instance of the state of the 21 cm forest.

from hayashi.forest import Forest
from hayashi.cosmo import Tk_ad

# Define the redshift of interest
z = 10
# Get the adiabatic temperature of the intergalactic medium at z
Tk = Tk_ad(z)

21cmforest = Forest(z, Tk)

This allows to call different observables such as the optical depth or the number of absorbers.

# Get a the optical depth, as a matrix in mass and impact parameter
tau = 21cmforest.tau_tot

# Get the number of absorption features and its (logarithmic) derivative with respect to tau
Nabs, dNabsdtau = 21cmforest.num_absorbers()

It is straightforward to include non-standard cosmologies by replacing the halo mass function, either using those included in the code or defined by the user. This is an example with primordial black holes, which modify the halo mass function due to a shot noise isocurvature mode (see arXiv:2104.10695):

from hayashi.nlcdm import dndlnM_PBH

# Define a cosmology where 10 % of dark matter is composed by primordial black holes of 1 solar mass
21cmforest_PBH = Forest(z, Tk, dndlnM = lambda M, z: dndlnM_PBH(M, z, fpbh = 0.1, Mpbh = 1.))

See the source code at hayashi for more details, and the sample notebooks for examples of usage.

Notebook examples

In order to illustrate the usage of the library, we include several example notebooks:

  • absorbers_example.ipynb: computes all the relevant outputs for the 21 cm forest, such as the optical depth, the maximum impact parameter and the number of absorbers, comparing the cases with and without the subhalo contribution.

  • nlcdm_example.ipynb: compares the standard CDM 21 cm forest with different non-standard cosmologies: warm dark matter and primordial black holes.

  • density_profiles.ipynb: compares the 21 cm forest outputs for different density profiles: NFW and uniform.

  • tidal_disruption.ipynb: compares the 21 cm forest observables when tidal disruption is considered in subhalos.

Citation

If you use the code, please link this repository, and cite arXiv:2209.01305 and the DOI 10.5281/zenodo.7044255.

Contact

For comments, questions etc. you can contact me at pablo.villanueva.domingo@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hayashi-1.1.4.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hayashi-1.1.4-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file hayashi-1.1.4.tar.gz.

File metadata

  • Download URL: hayashi-1.1.4.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.0

File hashes

Hashes for hayashi-1.1.4.tar.gz
Algorithm Hash digest
SHA256 4021528096f6c319c45b13332f820168e613b05d6e3ced2ba91ed9b56017c9ab
MD5 c673b4ce34936c8075e537fb7007b24c
BLAKE2b-256 8f2ab479515476296491ef574a60c862548b6bc181d4370a910ef2c1edb209c3

See more details on using hashes here.

File details

Details for the file hayashi-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: hayashi-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.0

File hashes

Hashes for hayashi-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2016dfc33a8d0e48b1bde06dd4028e4f38faa638fae97e9609b9576c5805ec38
MD5 d9150f039880d1f0b21557cbe6f91e7a
BLAKE2b-256 6e20c4cc00a317765f2621251d2d8a7ef95939f1b3747ebd96b0468877e18dea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page