Skip to main content

Lowtran in Python

Zenodo DOI Actions Status PyPi Download stats

LOWTRAN7 atmospheric absorption extinction model. Updated to be platform independent and easily accessible from Python and Matlab.

The main LOWTRAN program is 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

Lowtran requires a Fortran compiler and CMake. 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.

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

  • Linux: apt install gfortran
  • Mac: brew install gcc
  • Windows: Windows Subsystem for Linux

Install Python Lowtran code

pip install -e .

Examples

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

We present Python examples of:

  • ground-to-space transmittance: TransmittanceGround2Space.py

    Lowtran Transmission

  • sun-to-observer scattered radiance (why the sky is blue): ScatterRadiance.py

    Lowtran Scatter Radiance

  • sun-to-observer irradiance: SolarIrradiance.py

    Lowtran Solar Irradiance

  • observer-to-observer solar single-scattering solar radiance (up-going) with custom Pressure, Temperature and partial pressure for 12 species: UserDataHorizontalRadiance.py Lowtran Solar Irradiance

  • observer-to-observer transmittance with custom Pressure, Temperature and partial pressure for 12 species: UserDataHorizontalTransmittance.py

  • observer-to-observer transmittance: HorizontalTransmittance.py

    Lowtran Horizontal Path transmittance

Matlab

Matlab users can seamlessly access Python modules, as demonstrated in RunLowtran.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:

    runtests('lowtran')
    

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.

Release files for lowtran 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lowtran 3.1.0
File Size Uploaded
lowtran-3.1.0.tar.gz 276.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lowtran 3.1.0
File Interpreter ABI Platform
lowtran-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 554.9 kB

Release files / lowtran-3.1.0.tar.gz

Download URL lowtran-3.1.0.tar.gz
Size 276.2 kB
Tags Source
SHA-256 checksum
How to use checksums
51cfc2d882423e32933ef6be765d7aad97c3432300247d04164a0f76613579f5
BLAKE2b-256 checksum
How to use checksums
cde01064292eebde44c35719e76b0f8fa2a4cba0ec6b05fccfe20625433f75a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / lowtran-3.1.0-py3-none-any.whl

Download URL lowtran-3.1.0-py3-none-any.whl
Size 278.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9efd6208a074fac488c71b04775ce6964079c2846e6ce5b7c4d6e728c708fca
BLAKE2b-256 checksum
How to use checksums
c79a55797d22168f65b61be2e43279d7fb50f557fdd2e484c6f3a19c5db17da8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

2.4.1

1 release file

2.4.0

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.0

1 release file

0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page