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

Add lambda functions to create ProcessGraph #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danlooo
Copy link
Collaborator

@danlooo danlooo commented Sep 12, 2024

This PR adds support to create a ProcessGraph using lambda like syntax.
This is a generic to the functions defined for a DataCube.
We use ProcessGraph(42 * log(value,3)) instead of x -> 42 * log(x, 3), because most Julia fucntions are not supported by openEO.

using OpenEOClient
using ArchGDAL
using YAXArrays
using GLMakie

con = connect("openeo.dataspace.copernicus.eu/openeo", "", OpenEOClient.oidc_auth)
s1 = con.load_collection(
    "SENTINEL1_GRD",
    BoundingBox(west=11.293602, south=46.460163, east=11.382866, north=46.514768),
    ["2021-01-01", "2021-01-08"];
    bands = ["VV", "VH"],
    properties = Dict("sat:orbit_state" => ProcessGraph(value == :ASCENDING))
)
s2 = con.sar_backscatter(s1; coefficient="sigma0-ellipsoid", elevation_model="COPERNICUS_30")
s3 = con.apply(s2, ProcessGraph(10 * log(value, 10)))
s4 = con.save_result(s3, "GTiff")
path = con.compute_result(s3)
ds = open_dataset(path) 
plot(ds.Gray)

Example taken from python client

@danlooo danlooo changed the title Add lambda function Add lambda functions Sep 12, 2024
@danlooo danlooo changed the title Add lambda functions Add lambda functions to create ProcessGraph Sep 12, 2024
@danlooo
Copy link
Collaborator Author

danlooo commented Sep 12, 2024

Issue: Can't implement conditionals in Julia (e.g. overload ternary operator). Thepython client just defines a new function if_

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

Successfully merging this pull request may close these issues.

1 participant