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

NDVI computation fails #17

Open
m-mohr opened this issue Apr 11, 2023 · 3 comments
Open

NDVI computation fails #17

m-mohr opened this issue Apr 11, 2023 · 3 comments
Assignees

Comments

@m-mohr
Copy link
Member

m-mohr commented Apr 11, 2023

I'm trying to run a very simple max NDVI, but it errors:

Server error: unsupported operand type(s) for *: 'float' and 'NoneType'

Server: https://openeo-dev.sinergise.com/testing
Batch Job ID: 378bba68-b05f-465f-8000-daa67bd525c5

{
  "process_graph": {
    "loadco1": {
      "process_id": "load_collection",
      "arguments": {
        "id": "SENTINEL2_L2A",
        "spatial_extent": {
          "west": 7.6092989782618545,
          "east": 7.623309270052491,
          "south": 51.95464035469027,
          "north": 51.95925713083062
        },
        "temporal_extent": [
          "2017-07-01",
          "2017-08-01"
        ],
        "bands": [
          "B08",
          "B04"
        ]
      },
      "description": "Load the data, including the bands:\r\n- N = B08\r\n- R = B04"
    },
    "reduce1": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "loadco1"
        },
        "reducer": {
          "process_graph": {
            "max1": {
              "process_id": "max",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                }
              },
              "result": true
            }
          }
        },
        "dimension": "t"
      },
      "description": "Compute the max over the temporal dimension"
    },
    "reduce2": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "reduce1"
        },
        "reducer": {
          "process_graph": {
            "arraye1": {
              "process_id": "array_element",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                },
                "index": 0
              }
            },
            "arraye2": {
              "process_id": "array_element",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                },
                "index": 1
              }
            },
            "subtra1": {
              "process_id": "subtract",
              "arguments": {
                "x": {
                  "from_node": "arraye1"
                },
                "y": {
                  "from_node": "arraye2"
                }
              }
            },
            "add1": {
              "process_id": "add",
              "arguments": {
                "x": {
                  "from_node": "arraye1"
                },
                "y": {
                  "from_node": "arraye2"
                }
              }
            },
            "divide1": {
              "process_id": "divide",
              "arguments": {
                "x": {
                  "from_node": "subtra1"
                },
                "y": {
                  "from_node": "add1"
                }
              },
              "result": true
            }
          }
        },
        "dimension": "bands"
      },
      "description": "Compute the NDVI (Normalized Difference Vegetation Index) for the bands dimension\r\nFormula: (N - R)/(N + R)"
    },
    "savere1": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "reduce2"
        },
        "format": "GTIFF"
      },
      "description": "Store as GTIFF",
      "result": true
    }
  }
}
@dthiex
Copy link
Contributor

dthiex commented Apr 14, 2023

Is there any specific reason why you calculate the NDVI using openEO processes instead of using the NDVI process directly? There is a not so trivial bug with this, but using the NDVI process directly should work.

@m-mohr
Copy link
Member Author

m-mohr commented Apr 14, 2023

It's just an example. I could have chosen any other spectral indice from the Wizard in the Web Editor.

@dthiex
Copy link
Contributor

dthiex commented Apr 14, 2023

Yes, the same bug unfortunately applies to all such indice constructs... Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants