Installation
Conda-Forge (Recommended)
Recommended approach!
New environment:
mamba create -n isofit_env -c conda-forge isofit
mamba activate isofit_env
or
conda create -n isofit_env -c conda-forge isofit
conda activate isofit_env
Within an existing environment:
mamba install -c conda-forge isofit
or
conda install -c conda-forge isofit
PyPI (pip)
Note
The commands below use $ pip, however $ python -m pip is often a
safer choice. It is possible for the $ pip executable to point to a
different version of Python than the $ python executable. Using
$ python -m pip at least ensures that the package is installed against
the Python interpreter in use. The issue is further compounded on systems
that also have $ python3 and $ pip3 executables, or executables for
specific versions of Python like $ python3.11 and $ pip3.11.
ISOFIT can be installed from the Python Package Index with:
$ pip install isofit
In order to support a wide variety of environments, ISOFIT does not overly
constrain its dependencies, however this means that in some cases pip can
take a very long time to resolve ISOFIT’s dependency tree. Some users may need
to provide constraints for specific packages, or install ISOFIT last.
pip also supports installing from a remote git repository – this installs
against the main branch:
$ pip install "git+https://github.com/isofit/isofit.git@main"
Manual (GitHub)
We recommend using Mamba to create a virtual environment:
$ git clone https://github.com/isofit/isofit
$ mamba env create -f isofit/recipe/isofit.yml
$ mamba activate isofit_env
$ pip install -e ./isofit
Developers may need to install additional packages provided by alternative YAML files in the recipe directory:
$ micromamba install --name isofit_env --file ISOFIT/recipe/docker.yml
Alternatively, you may also use uv for installing ISOFIT from source:
$ uv sync
The above command will install the default python version and pinned packages that are confirmed to be working with ISOFIT. Once installed, the CLI can be accessed via uv run:
$ uv run isofit --help
Alternatively, activate the virtual environment to skip the uv run command:
$ source .venv/bin/activate
$ isofit --help
For additional packages, such as those required for development:
$ uv sync --extra dev
Advanced users may switch python versions via:
$ uv python pin 3.13
$ uv sync
Downloading Extra Files
Once ISOFIT is installed, the CLI provides an easy way to download additional files that may be useful.
These can be acquired via the isofit download command, and the current list of downloads we support is available via isofit download --help.
See data for more information.
> _NOTE:_ The default location for downloading extra files is ~/.isofit/. First time invoking the ISOFIT CLI will instantiate this directory and an isofit.ini file for storing the paths to downloaded products.
Setting Environment Variables
Depending on the selected RTM, specific environment variables pointing to the RTM’s base directory have to be set prior to running ISOFIT. In the following, general instructions on how to set these variables on MacOS, Linux and Windows are provided.
MacOS
Most MacOS systems load environment variables from the user’s .bash_profile configuration file. Open this file with your preferred text editor, such as vim:
vim ~/.bash_profile
Add this line to your .bash_profile:
export VARIABLE_NAME=DIRECTORY (use your actual path)
Save your changes and run:
source ~/.bash_profile
Linux
Most Linux profiles use either bash or csh/tcsh shells. These shells load environment variables from the user’s .bashrc or .cshrc configuration files.
(BASH) Add this parameter to the .bashrc (see MacOS description):
export VARIABLE_NAME=DIRECTORY (use your actual path)
(T/CSH) Add this parameter to the .cshrc (see MacOS description):
setenv VARIABLE_NAME=DIRECTORY (use your actual path)
Windows
Using a command prompt, type one of the following:
setx /M VARIABLE_NAME "DIRECTORY" (use your actual path)
setx VARIABLE_NAME "DIRECTORY" (use your actual path)
ISOFIT variables
The following environment variables are actively used within ISOFIT:
Variable |
Purpose |
|---|---|
|
These control the threading of various packages within ISOFIT. It is important to set these to |
|
This will disable automatically setting the MKL and OMP environment variables. Only recommended for advanced users that know what they are doing and can mitigate the consequences. |
|
Disables the |
Quick Start with sRTMnet (Recommended for new users)
sRTMnet is an emulator for MODTRAN 6, that works by coupling a neural network with a surrogate RTM (6S v2.1).
Automatic (Recommended)
ISOFIT can automatically install 6S and sRTMnet with the latest versions:
$ isofit download sixs
$ isofit download srtmnet
The above commands will ensure these models are built and available for ISOFIT.
Note
A commonly useful option -b [path], --base [path] will set the download location for all products:
$ isofit -b extra-downloads/ download all
This will change the download directory from the default ~ to ./extra-downloads/
See data for more information.
Manual (Advanced)
The following procedure walks through the steps required to install sRTMnet manually:
Download 6S v2.1, and compile. If you use a modern system, it is likely you will need to specify a legacy compiling configuration by changing line 3 of the Makefile to:
EXTRA = -O -ffixed-line-length-132 -std=legacy
Configure your environment by pointing the SIXS_DIR variable to point to your installation directory.
Download the pre-trained sRTMnet neural network, as well as some auxiliary data. This will give you an hdf5 and an aux file. It is important that you store both in the same directory.
You will likely need to set the path to 6S and sRTMnet for the ISOFIT ini file as well as rebuild the examples. To do this, execute:
$ isofit --path sixs /path/to/sixs/ --path srtmnet /path/to/sRTMnet/ build
Run one of the following examples:
# Small example pixel-by-pixel
$ cd $(isofit path examples)/image_cube/small/
$ ./default.sh
# Medium example with empirical line solution
$ cd $(isofit path examples)/image_cube/medium/
$ ./empirical.sh
# Medium example with analytical line solution
$ cd $(isofit path examples)/image_cube/medium/
$ ./analytical.sh
Quick Start using MODTRAN 6.0
This quick start presumes that you have an installation of the MODTRAN 6.0 radiative transfer model. This is the preferred radiative transfer option if available, though we have also included interfaces to the open source LibRadTran RT code as well as to neural network emulators.
Create an environment variable MODTRAN_DIR pointing to the base MODTRAN 6.0 directory.
Run the following code:
$ cd $(isofit path examples)/20171108_Pasadena $ ./modtran.sh
This will build a surface model and run the retrieval. The default example uses a lookup table approximation, and the code should recognize that the tables do not currently exist. It will call MODTRAN to rebuild them, which will take a few minutes.
Look for output data in
$(isofit path examples)/20171108_Pasadena/output/.
Known Incompatibilities
Ray may have compatibility issues with older machines with glibc < 2.14.
Additional Installation Info for Developers
Be sure to read the Contributing page as additional installation steps must be performed.