Model of Earth atmosphere absorption and transmission vs. wavelength and location.
Lowtran in Python
LOWTRAN7 atmospheric absorption extinction model. Updated by Michael Hirsch to be platform independent and easily accessible from Python.
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.
A Fortran compiler such as
gfortranis needed. We use
numpy) to seamlessly use the Fortran Lowtran library from Python. If you don't have one, here is how to install Gfortran:
apt install gfortran
brew install gcc
Install Python Lowtran code
python -m pip install -e .
See this page if you have errors on Fortran compilation.
In these examples, you can write to HDF5 with the
We present examples of:
sun-to-observer scattered radiance (why the sky is blue):
observer-to-observer solar single-scattering solar radiance (up-going) with custom Pressure, Temperature and partial pressure for 12 species:
observer-to-observer transmittance with custom Pressure, Temperature and partial pressure for 12 species:
LOWTRAN7 User manual -- you may refer to this to understand what parameters are set to default. Currently I don't have any aerosols enabled for example, though it's straightforward to add them.
Right now a lot of configuration features aren't implemented, please request those you want.
- Original 1994 Lowtran7 Code
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.
This is not necessary for normal users:
cd bin cmake .. cmake --build . ctest -V
should generate this text output.
(this is handled automatically by
setup.py, noted here for debugging)
Yes, even though you're using a 64-bit compiler:
f2py --compiler=mingw32 -m lowtran7 -c lowtran7.f
Tested on Windows with MinGW.
Windows Fortran compile
Normal users don't need to do this. I suggest that you instead use Cygwin or Windows Subsystem for Linux:
cd bin cmake -G "MinGW Makefiles" .. cmake --build . ctest -V