Py4CAtS --- Python for Computational ATmospheric Spectroscopy

What's new? (2015-2024)

Fall 24 --- July 24 --- Spring 24 --- Winter 23 --- Summer 23 --- Winter 22/23 --- Summer 22 --- Winter 21/22 --- Summer 21 --- March 21 --- July 20 --- Sept-Jan 19-20 --- May-July 19 --- May 19 --- April 19 --- March 19 --- February 19 --- December 18 --- October 18 --- Summer 18 --- June 18 --- March 18 --- Jan 18 --- Nov 17 --- May 17 --- Dec 16 --- Nov 16 --- Oct 16 --- Sept 16 --- July 16 --- March 16 --- Oct 15 --- July 15

Fall 2024

  Module inv.sveeeeties:
Singular Vector Expansion to Estimate Exoplanet Earth-like Temperatures from Infrared Emission Spectra
  Module inv.chahine:
Chahine relaxation method for atmospheric temperature estimation from thermal infrared spectra
  Module inv.tools:
Linear least squares fitting and further utility routines
  Module inv.lidar:
Differential absorption optical depth computation for lidar
  Module inv.varpro:
Variable Projection for solving separable nonlinear least squares problems
  Module inv.birra:
Beer InfraRed Retrieval Algorithm for SWIR radiative transfer
  Module art.lbl2ac, art.xs2od:
Function call inconsistencies removed

July 2024

  Module art.radInt:
Old riArray files can still be read
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 var.aeiou
New function minmax
  Modul art.atmos1D
Function art.atmos1D.atmInfo support for dictionary and scale height added
  Module art.wgtFct.wfArray
Attribute renamed angle ---> obsAngle (in accordance with riArray)
Class method wfInfo rewritten
wfRead, wfSave adjusted to new attribute naming
wfArray.info(): expanded
  Module art.ac2wf
ac2wf, dod2wf argument 'angle' ---> 'obsAngle'
  Module art.od2ri:
Call to / setup of riArray changed / adjusted to new attributes (see radInt)
set_ToA_radiation: new arguments radiusStar, planet2star with defaults radiusSun, earth2sun

Spring/Summer 2024

  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
  Module art/ac2od.py - odArray
Attribute columns (incl. individual gases) instead of airColumn
  Module art/absCo.py - acArray
Class method returns string instead of print
  Module art/aerosol.py
Adjusted because of new odArray attribute columns (old airColumn)
  New function isAtmosArray ( art/atmos1D) and isLineData (lbl/lines) for argument checks in lbl2ac and lbl2od
  New methods: mean, delta (aux/pairTypes) and sort (aux/PairOfInts, PairOfFloats)

December 2023

  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
  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

Spring/Summer 2022

  Module art/oDepth.py
new function odSum: alternative implementation of dod2tod
WARNING: slightly different total optical depth (see source file for discussion)
  Module aux/convolution.py
convolveBox, convolveTriangle with new option wGrid
convolveGauss with arguments rearranged
  Module aux/srf.py
new response function gaussBox
  Module aux/euGrid.py
new function gridStep
  Module aux/misc.py
new function dict_items2groups
  html documentation updated
subdirectories art, aux, lbl corresponding to the package structure

Winter 2021/22

  Module art/atmos1D.py
The function atmPlot can plot all molecular profiles simultaneously with a call atmPlot(atmosData, what='*')
Function _atmosData2cgs: mass density is now removed from atmospheric data.
  Module art/oDepth.py
new class method dict for odArray
function _odSave_pickled: redundant code cleaned up by call of odArray.dict class method
function odInfo: now also accepting dictionary of odArrays
  Module art/radInt.py
new class methods dict and append for riArray
function _riSave_pickled: redundant code cleaned up by call of riArray.dict class method
function _riRead_pickled: redundant code cleaned up using call to new function dict2riArray
function riConvolve and class method convolve: new wavenumber grid can be set
new function riConcatenate (calling class method riArray.append repeatedly)
  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
  Module aux/misc.py
new function dict_items2groups
  Module aux/struc_array.py
new function strucArrayDef
  Module aux/pairTypes.py
new class method dict for the three pair classes
Interval initialization more flexible: now also accepts lists, dictionaries (with two elements), and pairs
  Numerous modules:
raise SystemExit replaced by more specific raise ValueError etc.
  html documentation updated

Fall 2021

  Modules art/absCo.py and art/xs2ac.py
acArray attribute molec now saves a dictionary of molecules vs. number densities (old: only (absorbing) molecule names);
this dictionary is set by the xs2ac function and the densities are required by the cia(.py) module/function.
  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)
  Module art/cia.py
new module for collision-induced absorption

Summer 2021
  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 art/ac2od.py:
column density now saved as an additional entry in the odArray instance
  Module aux/aerosol.py
new module for aerosol optical depth using simple power law (Angstrom coefficient)
  Module lbl/higstract.py
improved/extended support of "beyond Voigt" line parameters in SEOM database
  Module aux/ir.ry
added radiusEarth, radiusSun, radiusJupiter, massEarth, massSun, massJupiter
  Module lbl/lbl.py
functions lbl_2grids, lbl_3grids: defaults changed to gridRatio=8, lagrange=2;
function lbl_brute: handling/selection of "beyond Voigt" line shapes changed;
function lbl2xs: initial check of `lineshape` modified;
new function init_xSection: setup wavenumber grid (old,original function wavenumber2xs) and zero xs array
  Module lbl/lines.py
lineArray class info with better support of "beyond Voigt" parameters;
function xVoigt_parameters with support for "beyond Voigt" parameters (extended version of old `voigt_parameters`);
new function llInfo
  Module lbl/lineshapes.py
function argument `S` replaced by `strength`;
function Voigt: call hum1wei32 for tiny y (otherwise hum1wei24);
function Rautian: call hum1wei32 (original hum1wei24);
speed-dependent profiles: now calling sdv and sdr functions (in new module sdr)
  Module art/limb.py:
new module for limb (occultation) transmission and effective height
  Module lbl/molecules.py
new molecules (hitran20, geisa19/20) added
  Module art/oDepth.py
class odArray with new attribute column density;
convolve method with default Gauss;
new function odConvolve (calls class method for a list/dictionary of optical depths);
function odSave with new flag transmission to optionally save exp(-od);
functions oDepth_altitudes, oDepth_pressures can return data in non-cgs units (e.g. km or mb)
  Module art/od2ri.py
completely rewritten with added support for surface reflection etc
  Module aux/racef.py
new function hum1wei24w;
NOTE: all function except for zpf16p use two real arguments (x,y); zpf16p(z) is used by the sdr module/functions only!
  Module art/rayleigh.py
new module for Rayleigh extinction
  Module art/radInt.py
class riArray with new method noise;
convolve method with default Gauss;
new function riConvolve (calls class method for a list/dictionary of radiances);
function riRead now returns a dictionary of riArray's if all entries of the pickle file have a `key`;
function riSave: if called with a dictionary of riArray's, save each as dictionary with an extra `key`
  Module lbl/sdr.py
new module for speed-dependent Voigt and Rautian functions
  Module aux/srf.py
function HyperGauss: bug fix of sqrtLn2**3 ---> sqrtLn2**(1/3);
function UltraGauss added
  Module aux/struc_array.py
new functions strucArrayChangeName and strucArrayUpdate
  Module art/wgtFct.py
function wfPeakHeight now returns altitudes in cm

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;
  • aux: 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 modules is now organized by the __init__.py files, in the (I)Python shell simply say
from py4cats import *

July 2020
Module convolution.py: functions convolveBox, convolveTriangle, convolveGauss: the number of grid points for the new wGrid is now evaluated as int()
Module myMatPlotLib.py: new module with some extra settings
Module py4cats.py: last section with matplotlib settings removed (now in new file myMatPlotLib.py)
September 2019 -- January 2020
Module aeiou.py: function loadxyy with new optional argument xLimits
Module cgsUnits: lengthsUnits: ly, pc added; functions lambda2nu, nu2lambda: first argument (wavelengths or wavenumbers) are variable list arguments
Module lineshapes.py: function Rautian now calling hum2wei32 (old: hum1wei24)
Module misc.py: function show_lambda with new arguments frmt, yShift, nanometer
Module py4cats.py: import show_lambda added;
Module oDepth.py: functions oDepth_altitudes, oDepth_pressures optionally return altitudes or pressures in km, mb, ....
Module xSection.py: function xsSave: third and fourth arguments swapped (interpolate <--> commentChar)
function xsRead: now can be called recursively
May-July 2019
Modules absCo.py, oDepth.py, xSection: old regrid methods removed
Module ac2wf.py: FoV loop in function ac2wf corrected to wfArray
Module atmos1D.py: function cmr with new (second) optional argument what; misc changes in functions atmRead, atmPlot
Module lbl2xs.py: function lbl2xs terminates with non-positive pressure or temperature
Module misc.py: function show_lambda more wavenumbers in NIR added
Module pairTypes.py: class Interval division corrected Python 2 __(r)div__ to Python 3 __(r)truediv__
Module radInt.py: new special method kelvin in class riArray to return equ. brightness temperature
Module wgtFct.py: function wfPlot: contour levels can be set explicitly, axis labels can be suppressed
Cosmetic changes in module ac2wf.py, aeiou.py, srf.py
May 2019
Py4CAtS paper published in Atmosphere 10(5), pp. 262, 2019

April 2019
Broken/incorrect links from bin directory to ../src directory repaired (incorrectly to ../src3)
Module srf.py: function Triangle corrected
Demo file corrected: mls=atmos1D(...) ---> mls=atmRead(...)
March 2019
Module radInt.py: inconsistencies of header comment lines between riSave and riRead removed
Python 2 sources (in directory src2) removed from tarball
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
December 2018
radInt.py --- new module defining a subclassed array riArray for radiation-intensity, including functions for read, save, and plot
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

Summer 2018
Code ported to Python 3 (the Python 2 code is frozen now!)

June 2018
lines.py --- function atlas: recoded to ensure common wavenumber axis for splitted plots
atmos1D.py: functions merge_atmos1D and regrid updated
March 2018
py4cats.py:
Identification / location of path to source files reorganized
wgtFct.py:
(Unix/Linux/...) shell interface adjusted to acArray implementation
lbl2xs.py (and extract.py, hitran.py, geisa.py):
Pressure-induced line shift implemented
January 2018
atmos1D.py:
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, ...
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
May 2017
Function atmPlot now can plot volume mixing ratios (instead of densities), too.
radiance2radiance clean-up
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
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
October 2016
xs2ac corrected to allow single level atmosphere and cross sections
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)
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)
March 2016
A new function cgs in module cgsUnits.py for easier conversions of physical quantities
Improved ac2wf.py and od2ri functions/modules.
October 2015
Sources thoroughly checked with Pep8, PyFlakes, and PyChecker
Script od2ri with function dod2ri added to compute radiation intensity
July 2015
The 'main' scripts (e.g. lbl2od) can now be used as functions inside the (I)Python interpreter.