Py4CAtS --- Python for Computational ATmospheric Spectroscopy

lbl2od scheme
[Image: DLR]

Main Scripts/Functions: From Hitran/Geisa to cross sections to optical depths and radiance (intensity)

higstract
HItran-GeiSa extract (select) lines of (a) certain molecule(s) (and isotope) and/or wavenumber range from line parameter database
lbl2xs
line-by-line (lbl) cross sections for some molecule(s) and some p, T
lbl2od
computation of line-by-line optical depth due to molecular absorption (combines lbl2xs, xs2ac, ac2od)
(d)od2ri
Given the (layer, delta) line-by-line optical depth solve Schwarzschild equation to radiation intensity

Installation: Getting started with Py4CAtS

Download the wheel file and execute the following command:
pip install py4cats-3.2.0-py3-none-any.whl

The command installs Py4CAtS in your current Python environment.

Prerequisites: Python (>=3.10) and numpy (sometimes scipy and matplotlib for plotting) but the pip installer should take care of dependencies.

OLD: Download a tarball of Python sources, some data files, and the documentation and unpack it at some convenient place:
tar xfvz py4cats.tgz

The top-level directory py4cats includes a 1.ReadMe file with basic instructions, and six subdirectories bin, data, doc, art, var, and lbl.


Usage

Py4CAtS can be used in two ways, from inside the (I)Python interpreter or Jupyter Qt Console or Notebook (see the demo!NEW! or the poster for the ASA-HITRAN 2016 congress) or from the Unix/Linux (or Windows/Mac?) console/terminal.

In an (I)Python shell the package becomes available for the Python interpreter after one of the following import statements:
import py4cats
from py4cats import *

If you also want to use Py4CAtS from the console/terminal you need to create a ./bin directory beside the ./lbl, ./art, ./var directories.
Next execute the following (t)csh command in the current directory to create links for all executable scripts/modules:

foreach file ( `grep -l '/usr/bin/env python' {art,var,lbl}/*.py` )
if ( -x $file ) ln -s ../$file bin/$file:r:t
end

Data and Documentation

To play around, download the tarball which contains data files and the documentation.
Unpack it with the command tar xfvz data_and_doc.tgz at some convenient place.

And you need some line data (HITRAN and/or GEISA). For the beginning, here is a thermal infrared excerpt of Hitran 86.

For a detailed review of line-by-line modeling for infrared radiative transfer see the manual py4cats.pdf in the doc directory.
Sections 5 and 6 describe Py4CAtS' usage from the Unix/Linux shell and the (i)python shell, respectively.

How to cite Py4CAtS?

(download BiBTeX entries)


What's new?

December 2023 (v3.2.0)
Spherical geometry
  Modules art/od2ri.py, art/wgtFct.py, art/cia.py lbl/lbl2od.py
Spherical geometry if radius is provided (default plane-parallel radiative transfer)
New function wfConcatenate, new class method append
New function ciaInfo
New option to save absorption coefficients (new import acSave, new argument acFile, ....)
  Obsolete module aux/convolution.py replace by convolve_function.py
  Exception handling enhancements
  Minor code refactoring for readability (and performance)
Summer 2023
Source code now delivered as a Python .whl file
Details see Installation instructions above
  Rename directory aux to var to resolve issues on Windows
  Remove deprecated numpy aliases
  Module convolve_function.py
Add option wUniform to concolveFunction
  Modules radInt.py, oDepth.py, wgtFct.py
Update convolve methods
Winter 2022/23
  Module art/oDepth.py
new function odSum: alternative implementation of dod2tod
WARNING: slightly different total optical depth (see source file for discussion)
  Module var/convolution.py
convolveBox, convolveTriangle with new option wGrid
convolveGauss with arguments rearranged
  Module var/srf.py
new response function gaussBox
  Module var/euGrid.py
new function gridStep
  Module var/misc.py
new function dict_items2groups
  Module var/srf.py
new response function gaussBox
html documentation updated
subdirectories art, var, lbl corresponding to the package structure

What's new? (2015-2022)

March 2021
Source code now reorganized as a package
Source files are now distributed over three subdirectories
  • lbl: modules related to lbl computations incl. Hitran/Geisa database access, Voigt routines etc.;
  • art: modules related to atmospheric radiative transfer;
  • var: auxiliary modules that should/could be useful in any context, e.g. input/output routines.
The setup module py4cats.py is not required anymore, import of the Py4CAtS module is now organized by the __init__.py files.

Spring - Summer 2021 (see What's new? for a full listing)

  Plot functions
atmPlot, acPlot, odPlot, riPlot, xsPlot functions have an additional argument **kwArgs (passed thru to MatPlotLib's functions)
acPlot, odPlot, xsPlot with an additional argument xUnit (instead of flag mue or nm)
  Module var/aerosol.py
new module for aerosol optical depth using simple power law (Angstrom coefficient)
  Modules lbl/lbl.py, lbl/lines.py, and lbl/lineshapes.py
"beyond Voigt" line shapes and parameters
  Module art/limb.py:
new module for limb (occultation) transmission and effective height
  Module art/od2ri.py
completely rewritten with added support for surface reflection etc
  Module art/rayleigh.py
new module for Rayleigh extinction
  Module lbl/sdr.py
new module for speed-dependent Voigt and Rautian functions

Fall 2021 (see What's new? for a full listing)
  Module lbl/lbl2od.py
three new options for function lbl2od to add cia, Rayleigh, and aerosol extinction to absorption coefficient(s) and optical depth(s)

Winter 2021/22 (see What's new? for a full listing)
  Module art/atmos1D.py
The function atmPlot can plot all molecular profiles simultaneously with a call atmPlot(atmosData, what='*')
  Module art/radInt.py
new class methods dict and append for riArray
  Modules lbl/lbl2ac.py and lbl/lbl2od.py
In the corresponding functions a consistency test of atmospheric vs line data has been implemented: stop if line data are given, but no corresponding concentrations

Spring/Summer 2022 (see What's new? for a full listing)
  Module art/oDepth.py
new function odSum: alternative implementation of dod2tod
  Module var/srf.py
new response function gaussBox

© fgs   (+49-8153-28-1234)
© plh   (+49-8153-28-3056)
Fri Jan 26, 2024; 16:10
Imprint
Privacy Policy
Terms of Use
Accessibility