Normalized difference chlorophyll index, PlanetScope

//VERSION=3
//PlanetScope NDRE

function setup() {
  return {
    input: [
      {
        bands: ["red", "rededge", "dataMask"],
      },
    ],
    output: { id: "default", bands: 4 },
  };
}

function evaluatePixel(sample) {
  let ndci = index(sample.rededge, sample.red);

  let ndci_colored = colorBlend(
    ndci,
    [0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
    [
      [0, 0, 1], // Blue
      [0, 0, 1], // Blue
      [0, 1, 0], // Green
      [0, 0.8, 0], // Yellow-green
      [0, 0.6, 0], // Darker green
      [0, 0.4, 0], // Even darker green
    ]
  );

  return [...ndci_colored, sample.dataMask];
}
//VERSION=3
//PlanetScope NDCI EO Browser

function setup() {
    return {
        input: [
            {
                bands: ["red", "rededge", "green", "blue", "dataMask", "clear"],
            },
        ],
        output: [
            { id: "default", bands: 4 },
            { id: "index", bands: 1, sampleType: "FLOAT32" },
            { id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" },
            { id: "dataMask", bands: 1 },
        ],
    };
}

function evaluatePixel(sample) {
    let ndci = index(sample.rededge, sample.red);
    const clear = sample.dataMask && sample.clear;

    let ndci_colored = colorBlend(
        ndci,
        [0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
        [
            [0, 0, 1], // Blue
            [0, 0, 1], // Blue
            [0, 1, 0], // Green
            [0, 0.8, 0], // Yellow-green
            [0, 0.6, 0], // Darker green
            [0, 0.4, 0], // Even darker green
        ]
    );

    // Normalize true color bands
    let true_color = [
        sample.red / 3000,
        sample.green / 3000,
        sample.blue / 3000,
    ];

    // Threshold value for switching between true color and ndci_map
    let threshold = 0.3;

    // Conditional logic to select either true_color or ndci_map
    let ndci_colored_masked = ndci < threshold ? true_color : ndci_colored;

    return {
        default: [...ndci_colored_masked, clear],
        index: [ndci],
        eobrowserStats: [ndci, !clear],
        dataMask: [sample.dataMask],
    };
}

Evaluate and Visualize

The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see here on how to get access.

General description

The normalized difference chlorophyll index, abbreviated NDCI, is defined as

\[NDCI := \mathtt{Index}(rededge,red) = \frac{rededge-red}{rededge+red}\]

This is an example script which can be used with EO Browser and is configured to return statistics in a format which can be used with the statistical info chart. For more information, see How Can I Configure My Layers For Statistical Information In EO Browser?

Representative image

NDCI over Lake Elsinore in California.

References

Sachidananda Mishra, Deepak R. Mishra (2012) Normalized difference chlorophyll index: A novel model for remote estimation of chlorophyll-a concentration in turbid productive waters, Remote Sensing of Environment, 117:394-406, DOI: 10.1016/j.rse.2011.10.016