Skip to main content

Titan aerosols models

Project description

Titan aerosols models

Python package for Titan's aerosols models

Install

With pip:

$ pip install titan-aerosols

If you need to contribute this project you can installed it directly from the source files:

$ git clone https://github.com/seignovert/python-titan-aerosols.git
$ cd python-titan-aerosols
$ python -m pip install -e . -r tests/requirements.txt

Python usage

>>> from aerosols import index_tholins

>>> nr, ni = index_tholins(338e-9)
(1.6489699384541059, 0.2392676321412895)


>>> from aerosols import mie_tholins

>>> wvln = 338e-9  # Wavelength (m)
>>> rm = 50e-9     # Monomer radius (m)

>>> qsct, qext, qabs, gg, theta, P = mie_tholins(wvln, rm)
(2.150748326506086e-15,
6.519732093912762e-15,
4.368983767406676e-15,
0.19301947916187234,
array([0., 0.01745329, ..., 3.14159265]),
array([2.23653193, ..., 0.88785229]))


>>> from aerosols import fractals_tholins

>>> Df = 2.0
>>> N = 266

>>> qsct, qext, qabs, gg, theta, P = fractals_tholins(wvln, rm, Df, N)
(1.5986535423863113e-12,
2.5652821769307767e-12,
9.666286345444654e-13,
None,
array([0, ..., 3.14159265]),
array([135.83547352468324, ..., 0.16033083012643]))

>>> N = 3000

>>> qsct, qext, qabs, gg, theta, P = fractals_tholins(wvln, rm, Df, N)
ValueError: Model tested only for N = 2 - 1024 (received N=3000)

>>> qsct, qext, qabs, gg, theta, P = fractals_tholins(wvln, rm, Df, N, force=True)
(1.877008401099561e-11,
2.829777018602765e-11,
9.527686175032043e-12,
None,
array([0, ..., 3.14159265]),
array([1.20358413e+03, ..., 1.27914327e-01]))

>>> from aerosols import mie

>>> qsct, qext, qabs, gg, theta, P = mie(wvln, nr, ni, rm)
(...)

>>> from aerosols import fractals

>>> qsct, qext, qabs, gg, theta, P = fractals(wvln, nr, ni, rm, Df, N)
(...)

A static notebook is also available here.

CLI usage

$ fractal_tholins --help
usage: fractal_tholins [-h] [--phase-function] [--nang NANG]
                [--fractal-dimension FRACTAL_DIMENSION] [--force]
                wvln rm N
Fractals cross-sections and phase function for tholin aggregate. Use default
tholins indexes (CVD) and Tomasko et al. 2008.

positional arguments:
wvln                  Wavelength (m)
rm                    Monomer radius (m)
N                     Number of monomers

optional arguments:
-h, --help            show this help message and exit
--phase-function, -p  Display the phase function
--nang NANG           Number of angles for the phase function (0 -> pi/2)
--fractal-dimension FRACTAL_DIMENSION, -df FRACTAL_DIMENSION
                        Fractal dimension
--force, -f           Bypass validity checks


$ fractal_tholins 338e-9 60e-9 266
# Cross sections:
Scattering: 2.715e-12 m^-2
Absorption: 1.558e-12 m^-2
Extinction: 4.273e-12 m^-2


$ fractal_tholins -p 338e-9 60e-9 266
# Phase function
0.0     1.86e+02
1.0     1.78e+02
...
179.0   1.15e-01
180.0   1.15e-01


$ fractal_tholins -p --nang 10 338e-9 60e-9 266
# Phase function
0.0     2.52e+02
10.0    2.37e+01
...
170.0   1.55e-01
180.0   1.56e-01


$ fractal_tholins 338e-9 60e-9 266 -df 2.3
Model tested only for Df = 2 (received Df=2.30)


$ fractal_tholins 338e-9 60e-9 266 -df 2.3 --force
# Cross sections:
Scattering: 2.657e-12 m^-2
Absorption: 1.351e-12 m^-2
Extinction: 4.008e-12 m^-2

Note

This package is an early attempt to model Titan's aerosols scattering based on Tomasko et al. 2008 paper (doi:10.1016/j.pss.2007.11.019)

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

titan-aerosols-0.4.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

titan_aerosols-0.4.0-py2.py3-none-any.whl (24.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file titan-aerosols-0.4.0.tar.gz.

File metadata

  • Download URL: titan-aerosols-0.4.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for titan-aerosols-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7758ca072297187d18cc5827244aaf18d443b87d21a166ba46b75a0cfdb8b03d
MD5 0d1ac65f0fb0b9057bd2dbdab2b2e48a
BLAKE2b-256 cb2cd9a8e720986bb7ce45b8a7883ec104cfb07f903516e1b3562d75a686763d

See more details on using hashes here.

File details

Details for the file titan_aerosols-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for titan_aerosols-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01e03f609cb7b7532f891e6e151e114a9a26dc77d8e6177f9bfa9ae2b6414abe
MD5 78a4fb5f4c52531343014428e030897f
BLAKE2b-256 5bc691b15d013229b16e88418c3e8511d9394445b2c3fc47af9ac68b2fd9ec01

See more details on using hashes here.

Supported by

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