LOWTRAN7 atmospheric absorption extinction model. Updated by Michael Hirsch to be platform independent and easily accessible from Python ≥ 3.6 and Matlab.
The main LOWTRAN program has been made accessible from Python by using direct memory transfers instead of the cumbersome and error-prone process of writing/reading text files.
xarray.Dataset high-performance, simple N-D array data is passed out, with appropriate metadata.
See below for how to make these examples.
You will need a Fortran compiler.
gfortran is one suitable compiler.
f2py (part of
numpy) to seamlessly use Fortran libraries from Python by special compilation of the Fortran library with auto-generated shim code.
If a Fortran compiler is not already installed, install Gfortran:
apt install gfortran
brew install gcc
echo "[build]`ncompiler=mingw32" | Out-File -Encoding ASCII ~/pydistutils.cfg
Note: Cygwin is essentially obsolete due to Windows Subsystem for Linux. Cygwin is broken for Numpy and Gfortran and general.
Install Python Lowtran code
pip install -e .
In these examples, you can write to HDF5 with the
We present examples of:
ground-to-space transmittance: TransmittanceGround2Space.py
sun-to-observer scattered radiance (why the sky is blue): ScatterRadiance.py
sun-to-observer irradiance: SolarIrradiance.py
observer-to-observer solar single-scattering solar radiance (up-going) with custom Pressure, Temperature and partial pressure for 12 species: UserDataHorizontalRadiance.py
observer-to-observer transmittance with custom Pressure, Temperature and partial pressure for 12 species: UserDataHorizontalTransmittance.py
observer-to-observer transmittance: HorizontalTransmittance.py
Here's what's you'll need:
Install Lowtran in Python as at the top of this Readme.
From Matlab, verify everything is working by from the
LOWTRAN7 User manual Refer to this to understand what parameters are set to default. Currently I don't have any aerosols enabled for example, though it's possible to add them into the code.
Right now a lot of configuration features aren't implemented, please request those you want.
LOWFILprogram in reference/lowtran7.10.f was not connected as we had previously implemented a filter function directly in Python.
LOWSCANspectral sampling (scanning) program in
reference/lowtran7.13.fwas not connected as we had no need for coarser spectral resolution.