Skip to main content

Cosmological functions for astrophysics calculations

Project description

Cosfunc - Cosmological Functions

A Python package providing essential cosmological functions for astrophysics calculations.

Features

  • Hubble parameter calculations
  • Cosmological distance functions
  • Hydrogen number density
  • Time-redshift derivatives
  • Configurable cosmological parameters

Installation

pip install cosfunc

Usage

from cosfunc import Set_Cosmology, H, n_H, dtdz

# Set cosmological parameters (optional, uses default if not set)
Set_Cosmology(h0=0.674, om_0=0.315)

# Calculate Hubble parameter at redshift z=7
hubble = H(7.0)
print(f"H(z=7) = {hubble}")

# Calculate hydrogen number density
density = n_H(0.5)  # overdensity delta = 0.5
print(f"n_H = {density}")

# Time derivative with respect to redshift
dt = dtdz(7.0)
print(f"dt/dz = {dt}")

Functions

  • Set_Cosmology(h0, om_0): Set cosmological parameters
  • E(z): Dimensionless Hubble parameter
  • H(z): Hubble parameter at redshift z
  • n_H(delta): Hydrogen number density
  • dtdz(z): Time derivative with respect to redshift

Default Parameters

  • h = 0.674 (Hubble parameter)
  • Ω_m = 0.315 (Matter density)
  • Ω_b = 0.0224 / h² (Baryon density)

License

MIT License

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

cosfunc-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

cosfunc-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file cosfunc-0.1.1.tar.gz.

File metadata

  • Download URL: cosfunc-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cosfunc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0fed23cf1ab03985305454dc10f5e5e27ece933259551bd1601b3f23eb036f72
MD5 4926a3d4f55cb0dabd44762b13d65afa
BLAKE2b-256 f97baa9dd00b2df918b1f605cc77cc76582135a7a395ed26f3c434aa426456c6

See more details on using hashes here.

File details

Details for the file cosfunc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cosfunc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for cosfunc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 068802b1640ca6d788285ca5f7b0efeab929da5b9b1508eb2d0fd0d0f9394744
MD5 1deb597f765a9a8f1184ba984c543bba
BLAKE2b-256 53a6545a4c680dc21d4e90d25e3c70de67ca17cd28b0ecb615f0a50af2b9d475

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