Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expression to generate Index bands #77

Closed
raphaelrpl opened this issue Jul 15, 2020 · 0 comments
Closed

Use expression to generate Index bands #77

raphaelrpl opened this issue Jul 15, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@raphaelrpl
Copy link
Contributor

raphaelrpl commented Jul 15, 2020

We should support a way to generate custom index band using expression to represent those values. For example, the code below is a example how to generate Normalized Difference Vegetation Index ((nir - red) / (nir + red)). To create a new data cube, which must have NDVI, the curl request should looks like:

{
    "datacube": "LC8",
    "grs": "BDC_GRID",
    "resolution": 30,
    "temporal_schema": "A16day",
    "composite_function": "STK",
    "bands_quicklook": [
        "band6",
        "band5",
        "band4"
    ],
    "bands": [
        { "name": "band1", "common_name": "coastal", "data_type": "int16" },
        { "name": "band2", "common_name": "blue", "data_type": "int16" },
        { "name": "band3", "common_name": "green", "data_type": "int16" },
        { "name": "band4", "common_name": "red", "data_type": "int16" },
        { "name": "band5", "common_name": "nir", "data_type": "int16" },
        { "name": "band6", "common_name": "swir1", "data_type": "int16" },
        { "name": "band7", "common_name": "swir2", "data_type": "int16" },
        { "name": "Fmask4", "common_name": "quality", "data_type": "uint8" }
    ],
    "indexes": [
        { "name": "NDVI", "common_name": "ndvi", "data_type": "int16", "value": "(nir - red) / (nir + red)" },
        { "name": "EVI", "common_name": "evi", "data_type": "int16", "value": "2.5 * ((band5 – band4) / (band5 + 6 * band4 – 7.5 * band2 + 1))" }
    ],
    "quality_band": "Fmask4",
    "description": "Data cube Landsat-8 with period 16 day in year.",
    "license": "MIT"
}

(The user can set any formula as wish, according to bands name defined)

The top-level member indexes act as post-processing to generate data cube indexes. To do that, we must store the value in database and it depends from bdc-db.

Right now, in the commit e137790 we already added a indexes key, but it is hardcoded way and does not support dynamic expression like that.

@raphaelrpl raphaelrpl added enhancement New feature or request help wanted Extra attention is needed labels Jul 15, 2020
@raphaelrpl raphaelrpl added this to the Version 0.4.0 milestone Jul 15, 2020
raphaelrpl added a commit to raphaelrpl/cube-builder that referenced this issue Nov 26, 2020
@betonr betonr closed this as completed in 87b4a78 Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants