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

Examples

Example usage can be found on Google Colab,

or see the examples/ folder.

Example usage

To import the package, type

import hylightpy

Initialisation

Then initialise the class using

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

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. By default, the code will use the currect working directory as to store the cache.

Line emissivity calculation

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

import unyt

In the following code block, we specify typical nebular conditions:

ne=unyt.array.unyt_array([1e2], 'cm**(-3)')
nHI=unyt.array.unyt_array([1e-5], 'cm**(-3)')
nHII=unyt.array.unyt_array([1e2], 'cm**(-3)')
temp=unyt.array.unyt_array([1e4], 'K')

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

eps = HI.get_line_emissivity(ne=ne, 
                             nHI=nHI, 
                             nHII=nHII, 
                             temp=temp, 
                             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=nHII, 
                     ne=ne, 
                     nHI=nHI, 
                     temp=temp, 
                     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.21.tar.gz (11.5 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.21-py3-none-any.whl (11.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hylightpy-0.0.21.tar.gz
  • Upload date:
  • Size: 11.5 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.21.tar.gz
Algorithm Hash digest
SHA256 986274e506855ceb9473e5ebd8fa85ae85ba1346dcdcca03144c60b032f44424
MD5 63a77e14a0704abb533e6f9e870b909d
BLAKE2b-256 9dd6c0e59a44d98615e515057cbd64a568eec778b9f1c8a396e4a5e14db44244

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hylightpy-0.0.21-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.21-py3-none-any.whl
Algorithm Hash digest
SHA256 50969727836328a1987b413e629f75bcbe6bf4a453a9ac1b1c6ca5106932f0dc
MD5 c5f27ab055fe6a4dfcc659e11841dfcf
BLAKE2b-256 30afd13330bb70b93cf388196b3a5439f343d28356785758df77bd999f1a4818

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