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.4.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? (2015-2024)

July 2024 (v3.4, wheel-file)
Refine attribute names
  Module art.radInt:
Attribute renamed zenith ---> obsAngle (in accordance with dod2ri second argument)
Attribute N = vertical column density added
Further attribute obsAngle (should be defined always)
Sequence of "main" attributes changed in accordance to odArray: x, z, p, t, N
Attributes srf and tBack removed from 'main' attributes
New attribute moreAttr: dictionary collecting "optional" arguments of dod2ri (e.g. surface and space temperature, surface reflectivity, srf, ....)
  Module art.oDepth:
odInfo expanded for list of optical depths (i.e. add info for sum)
New function sum_column (used by expanded odInfo and dod2tod)
Spring/Summer 2024 (v3.3, wheel-file)
Line-wing cut-off enabled by default
  Module lbl2xs
Line-wing cut-off added and enabled by default - causes slightly different molecular cross!
Cut-off improves modeled spectra, particularly in areas with significant differences in neighboring line strengths, e.g., around 2400 cm-1.
For a more detailed discussion see Gharib-Nezhad et al.
  Module art/cia.py
New function add_cia working with acArray or odArray (to replace add_cia2absCo)
  Module art/mtckd.py
NEW module for Hitran H2O continuum
  Module art/oDepth.py
New function get_airColumn; odArray methods __add__, __sub__ adjusted because of attribute N=columns instead of airColumn
December 2023 (v3.2, wheel-file)
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 (v3.1, wheel-file)
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
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 Jun 28, 2024; 14:12
Imprint
Privacy Policy
Terms of Use
Accessibility