Skip to main content

Atomic model for hydrogen recombination lines.

Project description

HyLight

HyLight (HYdrogen recombination LIne emission from ionized Gas in varying tHermal condiTions) calculates the level population of the excited states in atomic hydrogen and hence the typical recombination line emissivity. The results are accurate under typical photoionised nebular conditions.

Installation

The package can be installed via

pip install hylightpy

Example usage

To import the package, type

import hylightpy

Initialisation

Then initialise the class using

HI = hylightpy.HIAtom(nmax = 40, verbose=True, caseB=True, 
                      recom=True, coll=False, 
                      cache_path='./cache/')

where the user specify the number of levels in the hydrogen atom, the Case, and whether to include radiative processes and collisional processes. The user also have the freedom to specify the cache folder path, which will be storing cascade matrix elements.

Line emissivity calculation

We utilise unyt package to specify the gas density and temperature.

import unyt

We use the function get_emissivity to calculate the line emissivity at a given density and temperature.

HI.get_line_emissivity(ne=100. * unyt.cm**(-3), 
                       nHI=1e-5 * unyt.cm**(-3), 
                       nHII=100. * unyt.cm**(-3), 
                       temp=1e4 * unyt.K, 
                       nupper=3, nlower=2)

The above line calculates the H $\alpha$ line emissivity at a given gas density (electron density of 100 $\rm{cm}^{-3}$, proton density of 100 $\rm{cm}^{-3}$ and neutral hydrogen density of 1e-5 $\rm{cm}^{-3}$) and temperature (1e4 K).

Level population

The function compute_level_pop computes the level popualtion density. The following line calculates the 3 $p$ state population density at the same condition:

HI.compute_level_pop(nHII=100. * unyt.cm**(-3), 
                     ne=100. * unyt.cm**(-3), 
                     nHI=1e-5 * unyt.cm**(-3), 
                     temp=1e4 * unyt.K, 
                     n=3, l=1)

More examples can be found in the examples/ folder.

Documentation

The documentation is available here.

Method

The method is described in Liu et al. 2025.

License

This package is released under the permissive MIT license.

How to cite?

If you use this code in your work, we kindly ask you to cite Liu et al. 2025.

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

hylightpy-0.0.13.tar.gz (11.3 MB view details)

Uploaded Source

Built Distribution

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

hylightpy-0.0.13-py3-none-any.whl (11.5 MB view details)

Uploaded Python 3

File details

Details for the file hylightpy-0.0.13.tar.gz.

File metadata

  • Download URL: hylightpy-0.0.13.tar.gz
  • Upload date:
  • Size: 11.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for hylightpy-0.0.13.tar.gz
Algorithm Hash digest
SHA256 d53b51a7f6d7b464598c9428107a73f2f60de5df5de92d134b6e9fc0f513908d
MD5 6eff1e884a91779c012c1763c4520047
BLAKE2b-256 b5430b2001ab0a39560e6228fff210853158e0ac066da237cf7f45ed01653fb2

See more details on using hashes here.

File details

Details for the file hylightpy-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: hylightpy-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 11.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for hylightpy-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 0c580006b8a2c568af0602fbce372a5e87b7bf983580f4cb2eb2241549ce0fac
MD5 c652c0d51e0cc67b414f8aab4ce4aabe
BLAKE2b-256 1a18f37bf5e94664c64f4a1a5c6a1f4c953d8963738e6612af190ce70da5dd02

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