Skip to content

Contributing

Contributing to the catalogue is straightforward. You can propose an index through a GitHub issue or add it directly in a code contribution.

Before proposing a new index, read the AI and Scientific Validation Policy.

The easiest way

Open a new spectral index issue with the following information:

  • short_name: Short name of the index, such as "NDWI".
  • long_name: Long name of the index, such as "Normalized Difference Water Index".
  • formula: Expression for the index, such as "(N - G)/(N + G)".
  • reference: Link to the index reference, paper, or DOI.
  • application_domain: One of vegetation, burn, water, snow, urban, soil, clouds, kernel, or radar.
  • date_of_addition: Date of addition in YYYY-MM-DD format.
  • contributor: GitHub profile URL or email address.

The formula must use the standard variables supported by the catalogue. Common variables include:

DescriptionStandard
AerosolsA
BlueB
Green 1G1
GreenG
YellowY
RedR
Red Edge 1RE1
Red Edge 2RE2
Red Edge 3RE3
NIRN
NIR 2N2
Water vapourWV
SWIR 1S1
SWIR 2S2
ThermalT
Thermal 1T1
Thermal 2T2
Gain factorg
Canopy background adjustmentL
Coefficient 1 for the aerosol resistance termC1
Coefficient 2 for the aerosol resistance termC2
Exponent used for OCVIcexp
Exponent used for GDVInexp
Weighting coefficient used for WDRVIalpha
Weighting coefficient used for ARVIgamma
Weighting coefficient used for MBWIomega
Soil line slopesla
Soil line interceptslb
Photosynthetically Active RadiationPAR
Slope parameter by soil used for NIRvH2k
NIR central wavelengthlambdaN
Red central wavelengthlambdaR
Green central wavelengthlambdaG
Kernel of variables A and BkAB

The complete, authoritative list is defined by the Bands enum in src/utils.py.

Contributing through code

  1. Fork and clone the repository.

  2. Create and activate an isolated Python environment. For example, with Conda:

    bash
    conda create --name asi-dev python=3.10
    conda activate asi-dev
    python -m pip install -r requirements-test.txt

    Alternatively, using Python's built-in venv:

    bash
    python -m venv .venv
    source .venv/bin/activate
    python -m pip install --upgrade pip
    python -m pip install -r requirements-test.txt

    On Windows, activate the virtual environment with .venv\Scripts\activate.

  3. Create a development branch:

    bash
    git switch -c name-of-development-branch
  4. Add the index to the SpectralIndices catalogue in src/indices.py:

    python
    SeLI = SpectralIndex(
        short_name="SeLI",
        long_name="Sentinel-2 LAI Green Index",
        formula="(N2 - RE1) / (N2 + RE1)",
        reference="https://doi.org/10.3390/s19040904",
        application_domain="vegetation",
        date_of_addition="2021-04-08",
        contributor="https://github.com/davemlz",
    )

    SpectralIndex is a Pydantic model that validates the submitted metadata and formula. The formula must use supported bands and parameters.

  5. Run the tests:

    bash
    pytest test
  6. Commit and push the changes:

    bash
    git add src/indices.py
    git commit -m "Add short-name-of-the-index"
    git push origin name-of-development-branch
  7. Submit a pull request with the test results and scientific reference.

Released under the MIT License.