Giter Site home page Giter Site logo

Comments (7)

julian-zeidler avatar julian-zeidler commented on June 26, 2024

function absolute also does not work and results in "expression=absolute()" which fails in grass backend

from openeo-grassgis-driver.

metzm avatar metzm commented on June 26, 2024

The syntax of the example seems to be wrong. In

"arguments": {
  "x": {
    "from_parameter": "x"
  },
  "y": 2
}

the value to be used as "x" refers to itself. It should either refer to a different parameter or in this example to the data provided to the apply process:

"arguments": {
  "x": {
    "from_argument": "data"
  },
  "y": 2
}

The openeo absolute() function is now mapped to the GRASS abs() function.

from openeo-grassgis-driver.

julian-zeidler avatar julian-zeidler commented on June 26, 2024

The example is directly created by the current (0.9) python client using
absoluteDC=datacube.apply(process="absolute"), so i would expect it to result in a valid Graph.
which results in:
{
"process_graph": {
"loadcollection1": {
"process_id": "load_collection",
"arguments": {
"id": "nc_spm_08.modis_lst.strds.LST_Day_monthly",
"spatial_extent": null,
"temporal_extent": [
"2015-01-01",
"2015-03-01"
]
}
},
"apply1": {
"process_id": "apply",
"arguments": {
"data": {
"from_node": "loadcollection1"
},
"process": {
"process_graph": {
"absolute1": {
"process_id": "absolute",
"arguments": {
"x": {
"from_parameter": "x"
}
},
"result": true
}
}
}
}
},
"saveresult1": {
"process_id": "save_result",
"arguments": {
"data": {
"from_node": "apply1"
},
"format": "GTIFF",
"options": {}
},
"result": true
}
}
}

from openeo-grassgis-driver.

julian-zeidler avatar julian-zeidler commented on June 26, 2024

Creating the same Process using the openEO Webeditor results in a similar Graph:
{
"process_graph": {
"1": {
"process_id": "load_collection",
"arguments": {
"id": "nc_spm_08.modis_lst.strds.LST_Day_monthly",
"spatial_extent": {
"west": -180,
"east": 180,
"south": -90,
"north": 90
},
"temporal_extent": [
"1900-01-01T00:00:00",
"2100-01-01T00:00:00"
],
"bands": null
}
},
"2": {
"process_id": "apply",
"arguments": {
"data": {
"from_node": "1"
},
"process": {
"process_graph": {
"1": {
"process_id": "absolute",
"arguments": {
"x": {
"from_parameter": "x"
}
},
"result": true
}
}
}
},
"result": true
}
},
"parameters": []
}

from openeo-grassgis-driver.

metzm avatar metzm commented on June 26, 2024

Strange. I don't understand how the value for a parameter can come from itself? We can of course adjust the backend such that in this case (self-reference) the "data" parameter of the "apply" process is used, but that feels like a hack.

from openeo-grassgis-driver.

julian-zeidler avatar julian-zeidler commented on June 26, 2024

Hi Markus.
The way i understand it. The mapping is via the process description for the process which is called with a child "callback"
E.G https://openeo.org/documentation/1.0/processes.html#apply defines a child process parameter x via which the array is passed. Unfortunatly what makes it a bit confusing (for apply) is that the internal parameter is also called x, resulting in the seeming self-reference.

in comparison for function reduce_dimension (or apply_dimension) the callback variable is data (https://openeo.org/documentation/1.0/processes.html#reduce_dimension) and any auxilary settings can be passed via context variable

from openeo-grassgis-driver.

metzm avatar metzm commented on June 26, 2024

You're right, I confused the name of the child process parameter with parameter of the "add" process. Thus

"process": {
  "process_graph": {
    "add1": {
      "process_id": "add",
      "arguments": {
        "x": {
          "from_parameter": "x"
        },
        "y": 2
      },
      "result": true
    }
  }
}

and

"process": {
  "process_graph": {
    "add1": {
      "process_id": "add",
      "arguments": {
        "x": 2
        "y": {
          "from_parameter": "x"
        },
      },
      "result": true
    }
  }
}

are both correct and should give the same result.

We need to adjust our "apply", "reduce_dimension" process implementations, I will prepare a PR.

from openeo-grassgis-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.