Py4CAtS --- Python for Computational ATmospheric Spectroscopy
Main Scripts/Functions: From Hitran/Geisa to cross sections to optical depths and radiance (intensity)
- HItran-GeiSa extract (select) lines of a certain molecule (and isotope) and/or wavenumber range from line parameter database
- line-by-line (lbl) cross sections for some molecule(s) and some p, T
- computation of line-by-line optical depth due to molecular absorption (combines lbl2xs, xs2ac, ac2od)
- Given the (layer, delta) line-by-line optical depth solve Schwarzschild equation to radiation intensity
Installation: Getting started with Py4CAtS
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 five subdirectories bin, data, doc, src2, and src3.
(For a transition period there will be two directories with source files for Python 2 and Python 3;
however, note that the Python 2 version is essentially frozen since summer 2018)
Prerequisites: Python and numpy (scipy sometimes and matplotlib for plotting)
And you need some line data (HITRAN and/or GEISA).
For the beginning, here is a thermal infrared excerpt of Hitran 86.
Py4CAtS can be used in two ways, from the Unix/Linux (or Windows/Mac?) console/terminal or
(much better, more flexible, ..... See the demo or the poster for the ASA-HITRAN 2016 congress) inside the (I)Python interpreter or notebook.
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?
F. Schreier and S. Gimeno Garcia.
Py4CAtS Python Tools for Line-by-Line Modelling of Atmospheric Radiative Transfer.
In Robert F. Cahalan and Jürgen Fischer (editors),
Radiation Processes in the Atmosphere and Ocean (IRS 2012): Proceedings of the International Radiation Symposium (IRC/IAMAS)
Volume 1531 of AIP Conference Proceedings, pages 123 - 126.
American Institute of Physics, 2013.
See also GARLIC (Py4CAtS' big brother)
(download BiBTeX entries)
- July 2015
- The 'main' scripts (e.g. lbl2od) can now be used as functions inside the (I)Python interpreter.
- October 2015
- Sources thoroughly checked with
Script od2ri with function dod2ri added to compute radiation intensity
- March 2016
- A new function cgs in module cgsUnits.py for easier conversions of physical quantities
Improved ac2wf.py and od2ri functions/modules.
- July 2016
- Further source code checks with Pylint
- Absorption coefficients and optical depths are now stored in subclassed numpy arrays acArray and odArray (similar to xsArray before)
- September 2016
- Atmospheric data: corrected "CH3CL" -> "CH3Cl"
- Functions atlas (in module lines.py), acPlot (in module absCo.py), and odPlot (in module oDepth.py) rewritten (to exploit recursive calls)
- October 2016
- xs2ac corrected to allow single level atmosphere and cross sections
- November 2016
- od2ri corrected to allow atmospheric data starting at ToA
- Some further checks of 'important' function arguments implemented
- srf.py: wavenumber shift implemented in fts function
- Atmospheric data sets: trace gas profiles saved in separate file
- December 2016
- Setup script py4cats.py 'generalized' for Windows (pathname construction!)
- Line mixing added (first order, Voigt and Lorentz, "brute force" only)
- read_line_file in the lines.py script now works recursively
- atlas now also allows to plot voigtLines
- misc.py: new function triSpec for convolution with triangular
- moreFun.py: new function erfcx for exponentially scaled complementary error function
- May 2017
- Function atmPlot now can plot volume mixing ratios (instead of densities), too.
- November 2017
- New subclassed numpy array for radiance/intensity (i.e. the radiance array along with its attributes): single return variable of function dod2ri.
New function riPlot and updated/adjusted function riSave to plot and save radiance.
New function truncate in module misc.py
- January 2018
New function readVMR to read (trace) gas concentration data (i.e. without pressure and temperature);
Function merge_atmos1D can use pure VMR data as second input.
Atmospheric data sets clean-up, reorganized, ...
- March 2018
Identification / location of path to source files reorganized
(Unix/Linux/...) shell interface adjusted to acArray implementation
- lbl2xs.py (and extract.py, hitran.py, geisa.py):
Pressure-induced line shift implemented
- June 2018
- lines.py --- function atlas: recoded to ensure common wavenumber axis for splitted plots
- atmos1D.py: functions merge_atmos1D and regrid updated
- Summer 2018
- Code ported to Python 3 (the Python 2 code is frozen now!)
- October 2018
- lbl2xs.py --- a new option cpT to specify the pressure and temperature columns in the pT file
xs2ac.py, ac2od.py, xs2od.py --- new executable scripts to do these steps from the command line (i.e. "wrappers" for the corresponding functions to be called from the command line / (unix) terminal)
extract.py renamed to higstract.py consistent with the main function of this module
- December 2018
- radInt.py --- new module defining a subclassed array riArray for radiation-intensity, including functions for read, save, and plot
- February 2019
- Failed matplotlib imports: raise SystemExit errors replaced by print warnings
- Module planck.py: new function dPlanck_Wavenumber_dT
- Module higstract.py: new method strong for subclassed numpy array lineArray
- Module radInt.py: info on spectral response added to legend produced by riPlot
- Module wgtFct.py: new method convolve for subclassed numpy array wfArray
- March 2019
- Module radInt.py: inconsistencies of header comment lines between riSave and riRead removed
- Python 2 sources (in directory src2) removed from tarball
- April 2019
- broken/incorrect links from bin directory to ../src directory repaired (incorrectly to ../src3)
© fgs (+49-8153-28-1234)
Fri Mar 5, 2019; 12:34