Axioms

SpectralIndices.SpectralIndexType
SpectralIndex(index::Dict{String, Any})

This object allows interaction with specific Spectral Indices in the Awesome Spectral Indices list. Attributes of the Spectral Index can be accessed and the index itself can be computed.

Arguments

  • index::Dict{String, Any}: A dictionary with the following keys:

    • "short_name": Short name of the spectral index.
    • "long_name": Long name or description of the spectral index.
    • "bands": List of bands or wavelengths used in the index calculation.
    • "application_domain": Application domain or use case of the spectral index.
    • "reference": Reference or source of the spectral index formula.
    • "formula": Mathematical formula of the spectral index.
    • "date_of_addition": Date when the spectral index was added (in "yyyy-mm-dd" format).
    • "contributor": Contributor or source of the spectral index information.
    • "platforms": Platforms or sensors for which the index is applicable.

Returns

A SpectralIndex object containing the specified index information.

Examples

julia> indices["NIRv"]

Or, accessing directly the provided Dict of spectral indices:

NIRv
SpectralIndices.computeFunction
compute(si::SpectralIndex, params::Dict=Dict(); kwargs...) -> Any

Computes a Spectral Index based on the provided SpectralIndex instance, parameters, and optional keyword arguments.

Parameters

  • si: An instance of SpectralIndex which includes the name and details of the spectral index to be computed.
  • params: (Optional) Dictionary of parameters used as inputs for the computation. If not provided, parameters can be passed using keyword arguments.
  • kwargs: Additional parameters used as inputs for the computation, provided as keyword pairs. These are used if params is empty.

Returns

  • The computed Spectral Index, the type of return value depends on the input parameters and the specific spectral index being computed.

Examples

julia> compute(NDVI; N=0.643, R=0.175)
julia> compute(NDVI; N=fill(0.643, (5, 5)), R=fill(0.175, (5, 5)))
SpectralIndices.PlatformBandType
PlatformBand(platform_band::Dict{String, Any})

This struct provides information about a specific band for a specific sensor or platform.

Arguments

  • platform_band::Dict{String, Any}: A dictionary with the following keys:

    • "platform": Name of the platform or sensor.
    • "band": Band number or name for the specific platform.
    • "name": Description or name of the band for the specific platform.
    • "wavelength": Center wavelength of the band (in nm) for the specific platform.
    • "bandwidth": Bandwidth of the band (in nm) for the specific platform.

Returns

A PlatformBand object containing the specified band information.

Examples

platform_band_dict = Dict(
    "platform" => "Sentinel-2A",
    "band" => "B2",
    "name" => "Blue",
    "wavelength" => 492.4,
    "bandwidth" => 66.0,
)

platform_band = PlatformBand(platform_band_dict)

Or, accessing directly the provided Dict of platforms:

julia> bands["B"].platforms["sentinel2a"]
julia> bands["B"].platforms["sentinel2a"].wavelength
SpectralIndices.BandType
Band(band::Dict{String, Any})

Constructs a Band object to interact with specific bands in the list of required bands for Spectral Indices in the Awesome Spectral Indices list.

Arguments

  • band::Dict{String, Any}: A dictionary containing band information with the following keys:

    • "short_name": Short name of the band.
    • "long_name": Description or name of the band.
    • "common_name": Common name of the band according to the Electro-Optical Extension Specification for STAC.
    • "min_wavelength": Minimum wavelength of the spectral range of the band (in nm).
    • "max_wavelength": Maximum wavelength of the spectral range of the band (in nm).
    • "platforms": A dictionary of platform information associated with this band.

Returns

A Band object representing the specified band.

Examples

julia> bands["B"]
band_dict = Dict{String, Any}(
    "short_name" => "B",
    "long_name" => "Blue",
    "common_name" => "Blue",
    "min_wavelength" => 450.0,
    "max_wavelength" => 495.0,
    "platforms" => Dict{String, Any}(
        "sentinel2a" => PlatformBand(...),  # PlatformBand constructor details here
        "sentinel2b" => PlatformBand(...),  # PlatformBand constructor details here
        # Add other platforms as needed
    )
)

band = Band(band_dict)

Or, using the provided bands

julia> bands["B"].long_name
SpectralIndices.ConstantType
Constant(constant::Dict{String, Any}) -> Constant

Create a Constant object from a dictionary.

Arguments

  • constant::Dict{String, Any}: A dictionary containing the following keys:

    • "description": Description of the constant.
    • "short_name": Short name of the constant.
    • "default": Default value of the constant.

Returns

  • Constant: An instance of the Constant struct with fields populated based on the provided dictionary.

Example

constant_dict = Dict(
    "description" => "Speed of light in vacuum", "short_name" => "c", "default" => 299792458
)
constant = Constant(constant_dict)