A general, fast, flexible, and including spectral unmixing package. Oriented towards VSWIR imaging spectroscopy data but applicable for different sensor types. Includes options for different treatments of endmember library assemblages, including MESMA and bootstrapping (aka monte carlo) strategies.
This package is registered and can be added using the Julia package manager.
-
Install Julia
-
Install the package from the Julia Pkg REPL:
$ julia julia> ] pkg> add SpectralUnmixingor equivalently from the command line,
$ julia 'using Pkg; Pkg.add("SpectralUnmixing")'Remember to activate the appropriate environment via the Pkg REPL, or by using the
--projectflag or setting theJULIA_PROJECTenvironment variable. -
Install the CLI script to your Julia depot, typically
~/.julia/bin:julia> using SpectralUnmixing julia> CLI.install()This creates a symlink to the
unmix.jlCLI script in an easily accessible location.
If you would like to install a local version of the repository, first clone a local copy and navigate into the base SpectralUnmixing directory. Then run:
$ julia --project='.' -e 'using Pkg; Pkg.activate(".");'
$ export JULIA_PROJECT=${PWD}
The CLI script unmix.jl can be called directly from the SpectralUnmixing directory.
Currently the package supports reading and writing ENVI raster data. Replace unmix.jl below with the path to the script based on your installation method as necessary.
Basic:
julia unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma
Parallel implementation (with 10 cores):
julia -p 10 unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma
Bootstrapping uncertainty:
julia -p 10 unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma --n_mc 50
Normalization:
julia -p 10 unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma --n_mc 50 --normalization brightness
Preset maximum number of endmembers used for unmixing:
julia -p 10 unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma --n_mc 50 --normalization brightness --num_endmembers 10
Following Ochoa et al., to run SpectralUnmixing in the same manner as EMIT, use:
julia -p 64 unmix.jl REFLECTANCE_IMAGE ENDMEMBER_LIBRARY ENDMEMBER_COLUMN OUTPUT_BASE --mode sma-best --normalization brightness --num_endmember 30 --n_mc 20 --reflectance_uncertainty_file REFLECTANCE_UNCERTAINTY_IMAGE