Skip to content
LOWTRAN atmospheric absorption extinction, scatter and irradiance model--in Python and Matlab
Branch: master
Clone or download
Latest commit d371339 Jun 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Jun 11, 2019
archive init matlab' Aug 22, 2018
build new mingw32 method Jun 11, 2019
cmake metadata and Matlab CI Jun 11, 2019
gfx add user horiz test coverage, increase plain Fortran test coverage Mar 21, 2018
lowtran doc Nov 21, 2018
matlab CI template Nov 21, 2018
out pythonic Mar 5, 2017
src metadata and Matlab CI Jun 11, 2019
tests metadata and Matlab CI Jun 11, 2019
.appveyor.yml wrapup build system update Jun 11, 2019
.coveragerc metadata and Matlab CI Jun 11, 2019
.flake8 metadata and Matlab CI Jun 11, 2019
.gitattributes init matlab' Aug 22, 2018
.gitignore CI template Nov 21, 2018
.travis.yml wrapup build system update Jun 11, 2019
CMakeLists.txt metadata and Matlab CI Jun 11, 2019
HorizontalTransmittance.py Squashed commit of the following: Aug 13, 2018
LICENSE.txt metadata and Matlab CI Jun 11, 2019
README.md new mingw32 method Jun 11, 2019
ScatterRadiance.py Squashed commit of the following: Aug 13, 2018
SolarIrradiance.py Squashed commit of the following: Aug 13, 2018
ThermalRadiance.py Squashed commit of the following: Aug 13, 2018
TransmittanceGround2Space.py Squashed commit of the following: Aug 13, 2018
UserDataHorizontalRadiance.py Squashed commit of the following: Aug 13, 2018
UserHorizontalTransmittance.py Squashed commit of the following: Aug 13, 2018
Wavelength2LowtranWavenumber.py Squashed commit of the following: Aug 13, 2018
meson.build metadata and Matlab CI Jun 11, 2019
mypy.ini metadata and Matlab CI Jun 11, 2019
pyproject.toml cleanup, modernize Jul 12, 2018
setup.cfg meta Jun 24, 2019
setup.py new mingw32 method Jun 11, 2019

README.md

Zenodo DOI Build Status Coverage Build status Maintainability PyPi version PyPi Download stats

Lowtran in Python

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.

Gallery

See below for how to make these examples.

Lowtran7 absorption

Install

You will need a Fortran compiler. gfortran is one suitable compiler. We use f2py (part of numpy) to seamlessly use Fortran libraries from Python by special compilation of the Fortran library with auto-generated shim code.

  1. If a Fortran compiler is not already installed, install Gfortran:

    • Linux: apt install gfortran
    • Mac: brew install gcc
    • Windows
  2. Install Python Lowtran code

    pip install -e .

Examples

In these examples, you can write to HDF5 with the -o option.

We present examples of:

Matlab

Matlab users can seamlessly access Python modules, as demonstrated in RunLowtran.m and lowtran_transmission.m.

Here's what's you'll need:

  1. Setup Python ↔ Matlab interface.

  2. Install Lowtran in Python as at the top of this Readme.

  3. From Matlab, verify everything is working by from the lowtran/ directory:

    runtests('tests')

Notes

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.

Reference

  • Original 1994 Lowtran7 Code
  • LOWFIL program in reference/lowtran7.10.f was not connected as we had previously implemented a filter function directly in Python.
  • LOWSCAN spectral sampling (scanning) program in reference/lowtran7.13.f was not connected as we had no need for coarser spectral resolution.

Fortran (optional)

This is not necessary for normal users:

cd bin
cmake ..

cmake --build .
ctest -V

should generate this text output.

You can’t perform that action at this time.