API: openeo.processes
¶
The openeo.processes
module contains building blocks and helpers
to construct so called “child callbacks” for openEO processes like
openeo.rest.datacube.DataCube.apply()
and
openeo.rest.datacube.DataCube.reduce_dimension()
,
as discussed at Callback as a callable.
Note
The contents of the openeo.processes
module is automatically compiled
from the official openEO process specifications.
Developers that want to fix bugs in, or add implementations to this
module should not touch the file directly, but instead address it in the
upstream openeo-processes repository
or in the internal tooling to generate this file.
Functions in openeo.processes
¶
The openeo.processes
module implements (at top-level)
a regular Python function for each openEO process
(not only the official stable ones, but also experimental ones in “proposal” state).
These functions can be used directly as child callback, for example as follows:
from openeo.processes import absolute, max
cube.apply(absolute)
cube.reduce_dimension(max, dimension="t")
Note how the signatures of the parent DataCube
methods
and the callback functions match up:
DataCube.apply()
expects a callback that receives a single numerical value, which corresponds to the parameter signature ofopeneo.processes.absolute()
DataCube.reduce_dimension()
expects a callback that receives an array of numerical values, which corresponds to the parameter signatureopeneo.processes.max()
- openeo.processes.absolute(x)[source]¶
Absolute value
- Parameters:
x – A number.
- Return type:
- Returns:
The computed absolute value.
See also
openeo.org documentation on process “absolute”.
- openeo.processes.add(x, y)[source]¶
Addition of two numbers
- Parameters:
x – The first summand.
y – The second summand.
- Return type:
- Returns:
The computed sum of the two numbers.
See also
openeo.org documentation on process “add”.
- openeo.processes.add_dimension(data, name, label, type=<object object>)[source]¶
Add a new dimension
- Parameters:
data – A data cube to add the dimension to.
name – Name for the dimension.
label – A dimension label.
type – The type of dimension, defaults to other.
- Return type:
- Returns:
The data cube with a newly added dimension. The new dimension has exactly one dimension label. All other dimensions remain unchanged.
See also
openeo.org documentation on process “add_dimension”.
- openeo.processes.aggregate_spatial(data, geometries, reducer, target_dimension=<object object>, context=<object object>)[source]¶
Zonal statistics for geometries
- Parameters:
data – A raster data cube with at least two spatial dimensions. The data cube implicitly gets restricted to the bounds of the geometries as if
filter_spatial()
would have been used with the same values for the corresponding parameters immediately before this process.geometries – Geometries for which the aggregation will be computed. Feature properties are preserved for vector data cubes and all GeoJSON Features. One value will be computed per label in the dimension of type geometries, GeoJSON Feature or Geometry. For a FeatureCollection multiple values will be computed, one value per contained Feature. No values will be computed for empty geometries. For example, a single value will be computed for a MultiPolygon, but two values will be computed for a FeatureCollection containing two polygons. - For polygons, the process considers all pixels for which the point at the pixel center intersects with the corresponding polygon (as defined in the Simple Features standard by the OGC). - For points, the process considers the closest pixel center. - For lines (line strings), the process considers all the pixels whose centers are closest to at least one point on the line. Thus, pixels may be part of multiple geometries and be part of multiple aggregations. No operation is applied to geometries that are outside of the bounds of the data.
reducer – A reducer to be applied on all values of each geometry. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes.target_dimension – By default (which is null), the process only computes the results and doesn’t add a new dimension. If this parameter contains a new dimension name, the computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see
is_valid()
) for each computed value. These values are added as a new dimension. The new dimension of type other has the dimension labels value, total_count and valid_count. Fails with a TargetDimensionExists exception if a dimension with the specified name exists.context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A vector data cube with the computed results. Empty geometries still exist but without any aggregated values (i.e. no-data). The spatial dimensions are replaced by a dimension of type ‘geometries’ and if target_dimension is not null, a new dimension is added.
See also
openeo.org documentation on process “aggregate_spatial”.
- openeo.processes.aggregate_spatial_window(data, reducer, size, boundary=<object object>, align=<object object>, context=<object object>)[source]¶
Zonal statistics for rectangular windows
- Parameters:
data – A raster data cube with exactly two horizontal spatial dimensions and an arbitrary number of additional dimensions. The process is applied to all additional dimensions individually.
reducer – A reducer to be applied on the list of values, which contain all pixels covered by the window. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes.size – Window size in pixels along the horizontal spatial dimensions. The first value corresponds to the x axis, the second value corresponds to the y axis.
boundary – Behavior to apply if the number of values for the axes x and y is not a multiple of the corresponding value in the size parameter. Options are: - pad (default): pad the data cube with the no-data value null to fit the required window size. - trim: trim the data cube to fit the required window size. Set the parameter align to specifies to which corner the data is aligned to.
align – If the data requires padding or trimming (see parameter boundary), specifies to which corner of the spatial extent the data is aligned to. For example, if the data is aligned to the upper left, the process pads/trims at the lower-right.
context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A raster data cube with the newly computed values and the same dimensions. The resolution will change depending on the chosen values for the size and boundary parameter. It usually decreases for the dimensions which have the corresponding parameter size set to values greater than 1. The dimension labels will be set to the coordinate at the center of the window. The other dimension properties (name, type and reference system) remain unchanged.
See also
openeo.org documentation on process “aggregate_spatial_window”.
- openeo.processes.aggregate_temporal(data, intervals, reducer, labels=<object object>, dimension=<object object>, context=<object object>)[source]¶
Temporal aggregations
- Parameters:
data – A data cube.
intervals – Left-closed temporal intervals, which are allowed to overlap. Each temporal interval in the array has exactly two elements: 1. The first element is the start of the temporal interval. The specified time instant is included in the interval. 2. The second element is the end of the temporal interval. The specified time instant is excluded from the interval. The second element must always be greater/later than the first element, except when using time without date. Otherwise, a TemporalExtentEmpty exception is thrown.
reducer – A reducer to be applied for the values contained in each interval. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes. Intervals may not contain any values, which for most reducers leads to no-data (null) values by default.labels – Distinct labels for the intervals, which can contain dates and/or times. Is only required to be specified if the values for the start of the temporal intervals are not distinct and thus the default labels would not be unique. The number of labels and the number of groups need to be equal.
dimension – The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to null, the data cube is expected to only have one temporal dimension. Fails with a TooManyDimensions exception if it has more dimensions. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension.
See also
openeo.org documentation on process “aggregate_temporal”.
- openeo.processes.aggregate_temporal_period(data, period, reducer, dimension=<object object>, context=<object object>)[source]¶
Temporal aggregations based on calendar hierarchies
- Parameters:
data – The source data cube.
period – The time intervals to aggregate. The following pre-defined values are available: * hour: Hour of the day * day: Day of the year * week: Week of the year * dekad: Ten day periods, counted per year with three periods per month (day 1 - 10, 11 - 20 and 21 - end of month). The third dekad of the month can range from 8 to 11 days. For example, the third dekad of a year spans from January 21 till January 31 (11 days), the fourth dekad spans from February 1 till February 10 (10 days) and the sixth dekad spans from February 21 till February 28 or February 29 in a leap year (8 or 9 days respectively). * month: Month of the year * season: Three month periods of the calendar seasons (December - February, March - May, June - August, September - November). * tropical-season: Six month periods of the tropical seasons (November - April, May - October). * year: Proleptic years * decade: Ten year periods ([0-to-9 decade](https://en.wikipedia.org/wiki/Decade#0-to-9_decade)), from a year ending in a 0 to the next year ending in a 9. * decade-ad: Ten year periods ([1-to-0 decade](https://en.wikipedia.org/wiki/Decade#1-to-0_decade)) better aligned with the anno Domini (AD) calendar era, from a year ending in a 1 to the next year ending in a 0.
reducer – A reducer to be applied for the values contained in each period. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes. Periods may not contain any values, which for most reducers leads to no-data (null) values by default.dimension – The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to null, the source data cube is expected to only have one temporal dimension. Fails with a TooManyDimensions exception if it has more dimensions. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension. The specified temporal dimension has the following dimension labels (YYYY = four- digit year, MM = two-digit month, DD two-digit day of month): * hour: YYYY-MM-DD-00 - YYYY-MM- DD-23 * day: YYYY-001 - YYYY-365 * week: YYYY-01 - YYYY-52 * dekad: YYYY-00 - YYYY-36 * month: YYYY-01 - YYYY-12 * season: YYYY-djf (December - February), YYYY-mam (March - May), YYYY-jja (June - August), YYYY-son (September - November). * tropical-season: YYYY-ndjfma (November - April), YYYY-mjjaso (May - October). * year: YYYY * decade: YYY0 * decade-ad: YYY1 The dimension labels in the new data cube are complete for the whole extent of the source data cube. For example, if period is set to day and the source data cube has two dimension labels at the beginning of the year (2020-01-01) and the end of a year (2020-12-31), the process returns a data cube with 365 dimension labels (2020-001, 2020-002, …, 2020-365). In contrast, if period is set to day and the source data cube has just one dimension label 2020-01-05, the process returns a data cube with just a single dimension label (2020-005).
See also
openeo.org documentation on process “aggregate_temporal_period”.
- openeo.processes.all(data, ignore_nodata=<object object>)[source]¶
Are all of the values true?
- Parameters:
data – A set of boolean values.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default.
- Return type:
- Returns:
Boolean result of the logical operation.
See also
openeo.org documentation on process “all”.
- openeo.processes.and_(x, y)[source]¶
Logical AND
- Parameters:
x – A boolean value.
y – A boolean value.
- Return type:
- Returns:
Boolean result of the logical AND.
See also
openeo.org documentation on process “and_”.
- openeo.processes.anomaly(data, normals, period)[source]¶
Compute anomalies
- Parameters:
data – A data cube with exactly one temporal dimension and the following dimension labels for the given period (YYYY = four-digit year, MM = two-digit month, DD two-digit day of month): * hour: YYYY-MM-DD-00 - YYYY-MM-DD-23 * day: YYYY-001 - YYYY-365 * week: YYYY-01 - YYYY-52 * dekad: YYYY-00 - YYYY-36 * month: YYYY-01 - YYYY-12 * season: YYYY-djf (December - February), YYYY-mam (March - May), YYYY-jja (June - August), YYYY-son (September - November). * tropical-season: YYYY-ndjfma (November - April), YYYY-mjjaso (May - October). * year: YYYY * decade: YYY0 * decade-ad: YYY1 * single-period / climatology-period: Any
aggregate_temporal_period()
can compute such a data cube.normals – A data cube with normals, e.g. daily, monthly or yearly values computed from a process such as
climatological_normal()
. Must contain exactly one temporal dimension with the following dimension labels for the given period: * hour: 00 - 23 * day: 001 - 365 * week: 01 - 52 * dekad: 00 - 36 * month: 01 - 12 * season: djf (December - February), mam (March - May), jja (June - August), son (September - November) * tropical-season: ndjfma (November - April), mjjaso (May - October) * year: Four-digit year numbers * decade: Four-digit year numbers, the last digit being a 0 * decade-ad: Four-digit year numbers, the last digit being a 1 * single-period / climatology- period: A single dimension label with any name is expected.period – Specifies the time intervals available in the normals data cube. The following options are available: * hour: Hour of the day * day: Day of the year * week: Week of the year * dekad: Ten day periods, counted per year with three periods per month (day 1 - 10, 11 - 20 and 21 - end of month). The third dekad of the month can range from 8 to 11 days. For example, the fourth dekad is Feb, 1 - Feb, 10 each year. * month: Month of the year * season: Three month periods of the calendar seasons (December - February, March - May, June - August, September - November). * tropical-season: Six month periods of the tropical seasons (November - April, May - October). * year: Proleptic years * decade: Ten year periods ([0-to-9 decade](https://en.wikipedia.org/wiki/Decade#0-to-9_decade)), from a year ending in a 0 to the next year ending in a 9. * decade-ad: Ten year periods ([1-to-0 decade](https://en.wikipedia.org/wiki/Decade#1-to-0_decade)) better aligned with the anno Domini (AD) calendar era, from a year ending in a 1 to the next year ending in a 0. * single-period / climatology- period: A single period of arbitrary length
- Return type:
- Returns:
A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “anomaly”.
- openeo.processes.any(data, ignore_nodata=<object object>)[source]¶
Is at least one value true?
- Parameters:
data – A set of boolean values.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default.
- Return type:
- Returns:
Boolean result of the logical operation.
See also
openeo.org documentation on process “any”.
- openeo.processes.apply(data, process, context=<object object>)[source]¶
Apply a process to each value
- Parameters:
data – A data cube.
process – A process that accepts and returns a single value and is applied on each individual value in the data cube. The process may consist of multiple sub-processes and could, for example, consist of processes such as
absolute()
orlinear_scale_range()
.context – Additional data to be passed to the process.
- Return type:
- Returns:
A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “apply”.
- openeo.processes.apply_dimension(data, process, dimension, target_dimension=<object object>, context=<object object>)[source]¶
Apply a process to all values along a dimension
- Parameters:
data – A data cube.
process – Process to be applied on all values along the given dimension. The specified process needs to accept an array and must return an array with at least one element. A process may consist of multiple sub-processes.
dimension – The name of the source dimension to apply the process on. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
target_dimension – The name of the target dimension or null (the default) to use the source dimension specified in the parameter dimension. By specifying a target dimension, the source dimension is removed. The target dimension with the specified name and the type other (see
add_dimension()
) is created, if it doesn’t exist yet.context – Additional data to be passed to the process.
- Return type:
- Returns:
A data cube with the newly computed values. All dimensions stay the same, except for the dimensions specified in corresponding parameters. There are three cases how the dimensions can change: 1. The source dimension is the target dimension: - The (number of) dimensions remain unchanged as the source dimension is the target dimension. - The source dimension properties name and type remain unchanged. - The dimension labels, the reference system and the resolution are preserved only if the number of values in the source dimension is equal to the number of values computed by the process. Otherwise, all other dimension properties change as defined in the list below. 2. The source dimension is not the target dimension. The target dimension exists with a single label only: - The number of dimensions decreases by one as the source dimension is ‘dropped’ and the target dimension is filled with the processed data that originates from the source dimension. - The target dimension properties name and type remain unchanged. All other dimension properties change as defined in the list below. 3. The source dimension is not the target dimension and the latter does not exist: - The number of dimensions remain unchanged, but the source dimension is replaced with the target dimension. - The target dimension has the specified name and the type other. All other dimension properties are set as defined in the list below. Unless otherwise stated above, for the given (target) dimension the following applies: - the number of dimension labels is equal to the number of values computed by the process, - the dimension labels are incrementing integers starting from zero, - the resolution changes, and - the reference system is undefined.
See also
openeo.org documentation on process “apply_dimension”.
- openeo.processes.apply_kernel(data, kernel, factor=<object object>, border=<object object>, replace_invalid=<object object>)[source]¶
Apply a spatial convolution with a kernel
- Parameters:
data – A raster data cube.
kernel – Kernel as a two-dimensional array of weights. The inner level of the nested array aligns with the x axis and the outer level aligns with the y axis. Each level of the kernel must have an uneven number of elements, otherwise the process throws a KernelDimensionsUneven exception.
factor – A factor that is multiplied to each value after the kernel has been applied. This is basically a shortcut for explicitly multiplying each value by a factor afterwards, which is often required for some kernel-based algorithms such as the Gaussian blur.
border – Determines how the data is extended when the kernel overlaps with the borders. Defaults to fill the border with zeroes. The following options are available: * numeric value - fill with a user- defined constant number n: nnnnnn|abcdefgh|nnnnnn (default, with n = 0) * replicate - repeat the value from the pixel at the border: aaaaaa|abcdefgh|hhhhhh * reflect - mirror/reflect from the border: fedcba|abcdefgh|hgfedc * reflect_pixel - mirror/reflect from the center of the pixel at the border: gfedcb|abcdefgh|gfedcb * wrap - repeat/wrap the image: cdefgh|abcdefgh|abcdef
replace_invalid – This parameter specifies the value to replace non-numerical or infinite numerical values with. By default, those values are replaced with zeroes.
- Return type:
- Returns:
A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “apply_kernel”.
- openeo.processes.apply_neighborhood(data, process, size, overlap=<object object>, context=<object object>)[source]¶
Apply a process to pixels in a n-dimensional neighborhood
- Parameters:
data – A raster data cube.
process – Process to be applied on all neighborhoods.
size – Neighborhood sizes along each dimension. This object maps dimension names to either a physical measure (e.g. 100 m, 10 days) or pixels (e.g. 32 pixels). For dimensions not specified, the default is to provide all values. Be aware that including all values from overly large dimensions may not be processed at once.
overlap – Overlap of neighborhoods along each dimension to avoid border effects. By default no overlap is provided. For instance a temporal dimension can add 1 month before and after a neighborhood. In the spatial dimensions, this is often a number of pixels. The overlap specified is added before and after, so an overlap of 8 pixels will add 8 pixels on both sides of the window, so 16 in total. Be aware that large overlaps increase the need for computational resources and modifying overlapping data in subsequent operations have no effect.
context – Additional data to be passed to the process.
- Return type:
- Returns:
A raster data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “apply_neighborhood”.
- openeo.processes.apply_polygon(data, polygons, process, mask_value=<object object>, context=<object object>)[source]¶
Apply a process to segments of the data cube
- Parameters:
data – A data cube.
polygons – A vector data cube containing at least one polygon. The provided vector data can be one of the following: * A Polygon or MultiPolygon geometry, * a Feature with a Polygon or MultiPolygon geometry, or * a FeatureCollection containing at least one Feature with Polygon or MultiPolygon geometries. * Empty geometries are ignored.
process – A process that accepts and returns a single data cube and is applied on each individual sub data cube. The process may consist of multiple sub-processes.
mask_value – All pixels for which the point at the pixel center does not intersect with the polygon are replaced with the given value, which defaults to null (no data). It can provide a distinction between no data values within the polygon and masked pixels outside of it.
context – Additional data to be passed to the process.
- Return type:
- Returns:
A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “apply_polygon”.
- openeo.processes.arccos(x)[source]¶
Inverse cosine
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arccos”.
- openeo.processes.arcosh(x)[source]¶
Inverse hyperbolic cosine
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arcosh”.
- openeo.processes.arcsin(x)[source]¶
Inverse sine
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arcsin”.
- openeo.processes.arctan(x)[source]¶
Inverse tangent
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arctan”.
- openeo.processes.arctan2(y, x)[source]¶
Inverse tangent of two numbers
- Parameters:
y – A number to be used as the dividend.
x – A number to be used as the divisor.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arctan2”.
- openeo.processes.ard_normalized_radar_backscatter(data, elevation_model=<object object>, contributing_area=<object object>, ellipsoid_incidence_angle=<object object>, noise_removal=<object object>, options=<object object>)[source]¶
CARD4L compliant SAR NRB generation
- Parameters:
data – The source data cube containing SAR input.
elevation_model – The digital elevation model to use. Set to null (the default) to allow the back- end to choose, which will improve portability, but reduce reproducibility.
contributing_area – If set to true, a DEM-based local contributing area band named contributing_area is added. The values are given in square meters.
ellipsoid_incidence_angle – If set to true, an ellipsoidal incidence angle band named ellipsoid_incidence_angle is added. The values are given in degrees.
noise_removal – If set to false, no noise removal is applied. Defaults to true, which removes noise.
options – Proprietary options for the backscatter computations. Specifying proprietary options will reduce portability.
- Return type:
- Returns:
Backscatter values expressed as gamma0 in linear scale. In addition to the bands contributing_area and ellipsoid_incidence_angle that can optionally be added with corresponding parameters, the following bands are always added to the data cube: - mask: A data mask that indicates which values are valid (1), invalid (0) or contain no-data (null). - local_incidence_angle: A band with DEM-based local incidence angles in degrees. The data returned is CARD4L compliant with corresponding metadata.
See also
openeo.org documentation on process “ard_normalized_radar_backscatter”.
- openeo.processes.ard_surface_reflectance(data, atmospheric_correction_method, cloud_detection_method, elevation_model=<object object>, atmospheric_correction_options=<object object>, cloud_detection_options=<object object>)[source]¶
CARD4L compliant Surface Reflectance generation
- Parameters:
data – The source data cube containing multi-spectral optical top of the atmosphere (TOA) reflectances. There must be a single dimension of type bands available.
atmospheric_correction_method – The atmospheric correction method to use.
cloud_detection_method – The cloud detection method to use. Each method supports detecting different atmospheric disturbances such as clouds, cloud shadows, aerosols, haze, ozone and/or water vapour in optical imagery.
elevation_model – The digital elevation model to use. Set to null (the default) to allow the back- end to choose, which will improve portability, but reduce reproducibility.
atmospheric_correction_options – Proprietary options for the atmospheric correction method. Specifying proprietary options will reduce portability.
cloud_detection_options – Proprietary options for the cloud detection method. Specifying proprietary options will reduce portability.
- Return type:
- Returns:
Data cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. No-data values (null) are directly set in the bands. Depending on the methods used, several additional bands will be added to the data cube: Data cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. Depending on the methods used, several additional bands will be added to the data cube: - date (optional): Specifies per-pixel acquisition timestamps. - incomplete-testing (required): Identifies pixels with a value of 1 for which the per-pixel tests (at least saturation, cloud and cloud shadows, see CARD4L specification for details) have not all been successfully completed. Otherwise, the value is 0. - saturation (required) / saturation_{band} (optional): Indicates where pixels in the input spectral bands are saturated (1) or not (0). If the saturation is given per band, the band names are saturation_{band} with {band} being the band name from the source data cube. - cloud, shadow (both required),`aerosol`, haze, ozone, water_vapor (all optional): Indicates the probability of pixels being an atmospheric disturbance such as clouds. All bands have values between 0 (clear) and 1, which describes the probability that it is an atmospheric disturbance. - snow-ice (optional): Points to a file that indicates whether a pixel is assessed as being snow/ice (1) or not (0). All values describe the probability and must be between 0 and 1. - land-water (optional): Indicates whether a pixel is assessed as being land (1) or water (0). All values describe the probability and must be between 0 and 1. - incidence-angle (optional): Specifies per-pixel incidence angles in degrees. - azimuth (optional): Specifies per-pixel azimuth angles in degrees. - sun- azimuth: (optional): Specifies per-pixel sun azimuth angles in degrees. - sun-elevation (optional): Specifies per-pixel sun elevation angles in degrees. - terrain-shadow (optional): Indicates with a value of 1 whether a pixel is not directly illuminated due to terrain shadowing. Otherwise, the value is 0. - terrain-occlusion (optional): Indicates with a value of 1 whether a pixel is not visible to the sensor due to terrain occlusion during off-nadir viewing. Otherwise, the value is 0. - terrain-illumination (optional): Contains coefficients used for terrain illumination correction are provided for each pixel. The data returned is CARD4L compliant with corresponding metadata.
See also
openeo.org documentation on process “ard_surface_reflectance”.
- openeo.processes.array_append(data, value, label=<object object>)[source]¶
Append a value to an array
- Parameters:
data – An array.
value – Value to append to the array.
label – If the given array is a labeled array, a new label for the new value should be given. If not given or null, the array index as string is used as the label. If in any case the label exists, a LabelExists exception is thrown.
- Return type:
- Returns:
The new array with the value being appended.
See also
openeo.org documentation on process “array_append”.
- openeo.processes.array_apply(data, process, context=<object object>)[source]¶
Apply a process to each array element
- Parameters:
data – An array.
process – A process that accepts and returns a single value and is applied on each individual value in the array. The process may consist of multiple sub-processes and could, for example, consist of processes such as
absolute()
orlinear_scale_range()
.context – Additional data to be passed to the process.
- Return type:
- Returns:
An array with the newly computed values. The number of elements are the same as for the original array.
See also
openeo.org documentation on process “array_apply”.
- openeo.processes.array_concat(array1, array2)[source]¶
Merge two arrays
- Parameters:
array1 – The first array.
array2 – The second array.
- Return type:
- Returns:
The merged array.
See also
openeo.org documentation on process “array_concat”.
- openeo.processes.array_contains(data, value)[source]¶
Check whether the array contains a given value
- Parameters:
data – List to find the value in.
value – Value to find in data. If the value is null, this process returns always false.
- Return type:
- Returns:
true if the list contains the value, false` otherwise.
See also
openeo.org documentation on process “array_contains”.
- openeo.processes.array_create(data=<object object>, repeat=<object object>)[source]¶
Create an array
- Parameters:
data – A (native) array to fill the newly created array with. Defaults to an empty array.
repeat – The number of times the (native) array specified in data is repeatedly added after each other to the new array being created. Defaults to 1.
- Return type:
- Returns:
The newly created array.
See also
openeo.org documentation on process “array_create”.
- openeo.processes.array_create_labeled(data, labels)[source]¶
Create a labeled array
- Parameters:
data – An array of values to be used.
labels – An array of labels to be used.
- Return type:
- Returns:
The newly created labeled array.
See also
openeo.org documentation on process “array_create_labeled”.
- openeo.processes.array_element(data, index=<object object>, label=<object object>, return_nodata=<object object>)[source]¶
Get an element from an array
- Parameters:
data – An array.
index – The zero-based index of the element to retrieve.
label – The label of the element to retrieve. Throws an ArrayNotLabeled exception, if the given array is not a labeled array and this parameter is set.
return_nodata – By default this process throws an ArrayElementNotAvailable exception if the index or label is invalid. If you want to return null instead, set this flag to true.
- Return type:
- Returns:
The value of the requested element.
See also
openeo.org documentation on process “array_element”.
- openeo.processes.array_filter(data, condition, context=<object object>)[source]¶
Filter an array based on a condition
- Parameters:
data – An array.
condition – A condition that is evaluated against each value, index and/or label in the array. Only the array elements for which the condition returns true are preserved.
context – Additional data to be passed to the condition.
- Return type:
- Returns:
An array filtered by the specified condition. The number of elements are less than or equal compared to the original array.
See also
openeo.org documentation on process “array_filter”.
- openeo.processes.array_find(data, value, reverse=<object object>)[source]¶
Get the index for a value in an array
- Parameters:
data – List to find the value in.
value – Value to find in data. If the value is null, this process returns always null.
reverse – By default, this process finds the index of the first match. To return the index of the last match instead, set this flag to true.
- Return type:
- Returns:
The index of the first element with the specified value. If no element was found, null is returned.
See also
openeo.org documentation on process “array_find”.
- openeo.processes.array_find_label(data, label)[source]¶
Get the index for a label in a labeled array
- Parameters:
data – List to find the label in.
label – Label to find in data.
- Return type:
- Returns:
The index of the element with the specified label assigned. If no such label was found, null is returned.
See also
openeo.org documentation on process “array_find_label”.
- openeo.processes.array_interpolate_linear(data)[source]¶
One-dimensional linear interpolation for arrays
- Parameters:
data – An array of numbers and no-data values. If the given array is a labeled array, the labels must have a natural/inherent label order and the process expects the labels to be sorted accordingly. This is the default behavior in openEO for spatial and temporal dimensions.
- Return type:
- Returns:
An array with no-data values being replaced with interpolated values. If not at least 2 numerical values are available in the array, the array stays the same.
See also
openeo.org documentation on process “array_interpolate_linear”.
- openeo.processes.array_labels(data)[source]¶
Get the labels for an array
- Parameters:
data – An array.
- Return type:
- Returns:
The labels or indices as array.
See also
openeo.org documentation on process “array_labels”.
- openeo.processes.array_modify(data, values, index, length=<object object>)[source]¶
Change the content of an array (remove, insert, update)
- Parameters:
data – The array to modify.
values – The values to insert into the data array.
index – The index in the data array of the element to insert the value(s) before. If the index is greater than the number of elements in the data array, the process throws an ArrayElementNotAvailable exception. To insert after the last element, there are two options: 1. Use the simpler processes
array_append()
to append a single value orarray_concat()
to append multiple values. 2. Specify the number of elements in the array. You can retrieve the number of elements with the processcount()
, having the parameter condition set to true.length – The number of elements in the data array to remove (or replace) starting from the given index. If the array contains fewer elements, the process simply removes all elements up to the end.
- Return type:
- Returns:
An array with values added, updated or removed.
See also
openeo.org documentation on process “array_modify”.
- openeo.processes.arsinh(x)[source]¶
Inverse hyperbolic sine
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “arsinh”.
- openeo.processes.artanh(x)[source]¶
Inverse hyperbolic tangent
- Parameters:
x – A number.
- Return type:
- Returns:
The computed angle in radians.
See also
openeo.org documentation on process “artanh”.
- openeo.processes.atmospheric_correction(data, method, elevation_model=<object object>, options=<object object>)[source]¶
Apply atmospheric correction
- Parameters:
data – Data cube containing multi-spectral optical top of atmosphere reflectances to be corrected.
method – The atmospheric correction method to use. To get reproducible results, you have to set a specific method. Set to null to allow the back-end to choose, which will improve portability, but reduce reproducibility as you may get different results if you run the processes multiple times.
elevation_model – The digital elevation model to use. Set to null (the default) to allow the back- end to choose, which will improve portability, but reduce reproducibility.
options – Proprietary options for the atmospheric correction method. Specifying proprietary options will reduce portability.
- Return type:
- Returns:
Data cube containing bottom of atmosphere reflectances.
See also
openeo.org documentation on process “atmospheric_correction”.
- openeo.processes.between(x, min, max, exclude_max=<object object>)[source]¶
Between comparison
- Parameters:
x – The value to check.
min – Lower boundary (inclusive) to check against.
max – Upper boundary (inclusive) to check against.
exclude_max – Exclude the upper boundary max if set to true. Defaults to false.
- Return type:
- Returns:
true if x is between the specified bounds, otherwise false.
See also
openeo.org documentation on process “between”.
- openeo.processes.ceil(x)[source]¶
Round fractions up
- Parameters:
x – A number to round up.
- Return type:
- Returns:
The number rounded up.
See also
openeo.org documentation on process “ceil”.
- openeo.processes.climatological_normal(data, period, climatology_period=<object object>)[source]¶
Compute climatology normals
- Parameters:
data – A data cube with exactly one temporal dimension. The data cube must span at least the temporal interval specified in the parameter climatology-period. Seasonal periods may span two consecutive years, e.g. temporal winter that includes months December, January and February. If the required months before the actual climate period are available, the season is taken into account. If not available, the first season is not taken into account and the seasonal mean is based on one year less than the other seasonal normals. The incomplete season at the end of the last year is never taken into account.
period – The time intervals to aggregate the average value for. The following pre-defined frequencies are supported: * day: Day of the year * month: Month of the year * climatology-period: The period specified in the climatology-period. * season: Three month periods of the calendar seasons (December - February, March - May, June - August, September - November). * tropical-season: Six month periods of the tropical seasons (November - April, May - October).
climatology_period – The climatology period as a closed temporal interval. The first element of the array is the first year to be fully included in the temporal interval. The second element is the last year to be fully included in the temporal interval. The default climatology period is from 1981 until 2010 (both inclusive) right now, but this might be updated over time to what is commonly used in climatology. If you don’t want to keep your research to be reproducible, please explicitly specify a period.
- Return type:
- Returns:
A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the temporal dimension. The temporal dimension has the following dimension labels: * day: 001 - 365 * month: 01 - 12 * climatology-period: climatology-period * season: djf (December - February), mam (March - May), jja (June - August), son (September - November) * tropical-season: ndjfma (November - April), mjjaso (May - October)
See also
openeo.org documentation on process “climatological_normal”.
- openeo.processes.clip(x, min, max)[source]¶
Clip a value between a minimum and a maximum
- Parameters:
x – A number.
min – Minimum value. If the value is lower than this value, the process will return the value of this parameter.
max – Maximum value. If the value is greater than this value, the process will return the value of this parameter.
- Return type:
- Returns:
The value clipped to the specified range.
See also
openeo.org documentation on process “clip”.
- openeo.processes.cloud_detection(data, method, options=<object object>)[source]¶
Create cloud masks
- Parameters:
data – The source data cube containing multi-spectral optical top of the atmosphere (TOA) reflectances on which to perform cloud detection.
method – The cloud detection method to use. To get reproducible results, you have to set a specific method. Set to null to allow the back-end to choose, which will improve portability, but reduce reproducibility as you may get different results if you run the processes multiple times.
options – Proprietary options for the cloud detection method. Specifying proprietary options will reduce portability.
- Return type:
- Returns:
A data cube with bands for the atmospheric disturbances. Each of the masks contains values between 0 and 1. The data cube has the same spatial and temporal dimensions as the source data cube and a dimension that contains a dimension label for each of the supported/considered atmospheric disturbance.
See also
openeo.org documentation on process “cloud_detection”.
- openeo.processes.constant(x)[source]¶
Define a constant value
- Parameters:
x – The value of the constant.
- Return type:
- Returns:
The value of the constant.
See also
openeo.org documentation on process “constant”.
- openeo.processes.cos(x)[source]¶
Cosine
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed cosine of x.
See also
openeo.org documentation on process “cos”.
- openeo.processes.cosh(x)[source]¶
Hyperbolic cosine
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed hyperbolic cosine of x.
See also
openeo.org documentation on process “cosh”.
- openeo.processes.count(data, condition=<object object>, context=<object object>)[source]¶
Count the number of elements
- Parameters:
data – An array with elements of any data type.
condition – A condition consists of one or more processes, which in the end return a boolean value. It is evaluated against each element in the array. An element is counted only if the condition returns true. Defaults to count valid elements in a list (see
is_valid()
). Setting this parameter to boolean true counts all elements in the list. false is not a valid value for this parameter.context – Additional data to be passed to the condition.
- Return type:
- Returns:
The counted number of elements.
See also
openeo.org documentation on process “count”.
- openeo.processes.create_data_cube()[source]¶
Create an empty data cube
- Return type:
- Returns:
An empty data cube with no dimensions.
See also
openeo.org documentation on process “create_data_cube”.
- openeo.processes.cummax(data, ignore_nodata=<object object>)[source]¶
Cumulative maxima
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to false considers no-data values so that null is set for all the following elements.
- Return type:
- Returns:
An array with the computed cumulative maxima.
See also
openeo.org documentation on process “cummax”.
- openeo.processes.cummin(data, ignore_nodata=<object object>)[source]¶
Cumulative minima
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to false considers no-data values so that null is set for all the following elements.
- Return type:
- Returns:
An array with the computed cumulative minima.
See also
openeo.org documentation on process “cummin”.
- openeo.processes.cumproduct(data, ignore_nodata=<object object>)[source]¶
Cumulative products
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to false considers no-data values so that null is set for all the following elements.
- Return type:
- Returns:
An array with the computed cumulative products.
See also
openeo.org documentation on process “cumproduct”.
- openeo.processes.cumsum(data, ignore_nodata=<object object>)[source]¶
Cumulative sums
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to false considers no-data values so that null is set for all the following elements.
- Return type:
- Returns:
An array with the computed cumulative sums.
See also
openeo.org documentation on process “cumsum”.
- openeo.processes.date_between(x, min, max, exclude_max=<object object>)[source]¶
Between comparison for dates and times
- Parameters:
x – The value to check.
min – Lower boundary (inclusive) to check against.
max – Upper boundary (inclusive) to check against.
exclude_max – Exclude the upper boundary max if set to true. Defaults to false.
- Return type:
- Returns:
true if x is between the specified bounds, otherwise false.
See also
openeo.org documentation on process “date_between”.
- openeo.processes.date_difference(date1, date2, unit=<object object>)[source]¶
Computes the difference between two time instants
- Parameters:
date1 – The base date, optionally with a time component.
date2 – The other date, optionally with a time component.
unit – The unit for the returned value. The following units are available: - millisecond - second - leap seconds are ignored in computations. - minute - hour - day - month - year
- Return type:
- Returns:
Returns the difference between date1 and date2 in the given unit (seconds by default), including a fractional part if required. For comparison purposes this means: - If date1 < date2, the returned value is positive. - If date1 = date2, the returned value is 0. - If date1 > date2, the returned value is negative.
See also
openeo.org documentation on process “date_difference”.
- openeo.processes.date_shift(date, value, unit)[source]¶
Manipulates dates and times by addition or subtraction
- Parameters:
date – The date (and optionally time) to manipulate. If the given date doesn’t include the time, the process assumes that the time component is 00:00:00Z (i.e. midnight, in UTC). The millisecond part of the time is optional and defaults to 0 if not given.
value – The period of time in the unit given that is added (positive numbers) or subtracted (negative numbers). The value 0 doesn’t have any effect.
unit – The unit for the value given. The following pre-defined units are available: - millisecond: Milliseconds - second: Seconds - leap seconds are ignored in computations. - minute: Minutes - hour: Hours - day: Days - changes only the the day part of a date - week: Weeks (equivalent to 7 days) - month: Months - year: Years Manipulations with the unit year, month, week or day do never change the time. If any of the manipulations result in an invalid date or time, the corresponding part is rounded down to the next valid date or time respectively. For example, adding a month to 2020-01-31 would result in 2020-02-29.
- Return type:
- Returns:
The manipulated date. If a time component was given in the parameter date, the time component is returned with the date.
See also
openeo.org documentation on process “date_shift”.
- openeo.processes.dimension_labels(data, dimension)[source]¶
Get the dimension labels
- Parameters:
data – The data cube.
dimension – The name of the dimension to get the labels for.
- Return type:
- Returns:
The labels as an array.
See also
openeo.org documentation on process “dimension_labels”.
- openeo.processes.divide(x, y)[source]¶
Division of two numbers
- Parameters:
x – The dividend.
y – The divisor.
- Return type:
- Returns:
The computed result.
See also
openeo.org documentation on process “divide”.
- openeo.processes.drop_dimension(data, name)[source]¶
Remove a dimension
- Parameters:
data – The data cube to drop a dimension from.
name – Name of the dimension to drop.
- Return type:
- Returns:
A data cube without the specified dimension. The number of dimensions decreases by one, but the dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.
See also
openeo.org documentation on process “drop_dimension”.
- openeo.processes.e()[source]¶
Euler’s number (e)
- Return type:
- Returns:
The numerical value of Euler’s number.
See also
openeo.org documentation on process “e”.
- openeo.processes.eq(x, y, delta=<object object>, case_sensitive=<object object>)[source]¶
Equal to comparison
- Parameters:
x – First operand.
y – Second operand.
delta – Only applicable for comparing two numbers. If this optional parameter is set to a positive non-zero number the equality of two numbers is checked against a delta value. This is especially useful to circumvent problems with floating-point inaccuracy in machine-based computation. This option is basically an alias for the following computation: lte(abs(minus([x, y]), delta)
case_sensitive – Only applicable for comparing two strings. Case sensitive comparison can be disabled by setting this parameter to false.
- Return type:
- Returns:
true if x is equal to y, null if any operand is null, otherwise false.
See also
openeo.org documentation on process “eq”.
- openeo.processes.exp(p)[source]¶
Exponentiation to the base e
- Parameters:
p – The numerical exponent.
- Return type:
- Returns:
The computed value for e raised to the power of p.
See also
openeo.org documentation on process “exp”.
- openeo.processes.extrema(data, ignore_nodata=<object object>)[source]¶
Minimum and maximum values
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that an array with two null values is returned if any value is such a value.
- Return type:
- Returns:
An array containing the minimum and maximum values for the specified numbers. The first element is the minimum, the second element is the maximum. If the input array is empty both elements are set to null.
See also
openeo.org documentation on process “extrema”.
- openeo.processes.filter_bands(data, bands=<object object>, wavelengths=<object object>)[source]¶
Filter the bands by names
- Parameters:
data – A data cube with bands.
bands – A list of band names. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands). If the unique band name and the common name conflict, the unique band name has a higher priority. The order of the specified array defines the order of the bands in the data cube. If multiple bands match a common name, all matched bands are included in the original order.
wavelengths – A list of sub-lists with each sub-list consisting of two elements. The first element is the minimum wavelength and the second element is the maximum wavelength. Wavelengths are specified in micrometers (μm). The order of the specified array defines the order of the bands in the data cube. If multiple bands match the wavelengths, all matched bands are included in the original order.
- Return type:
- Returns:
A data cube limited to a subset of its original bands. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the dimension of type bands has less (or the same) dimension labels.
See also
openeo.org documentation on process “filter_bands”.
- openeo.processes.filter_bbox(data, extent)[source]¶
Spatial filter using a bounding box
- Parameters:
data – A data cube.
extent – A bounding box, which may include a vertical axis (see base and height).
- Return type:
- Returns:
A data cube restricted to the bounding box. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the spatial dimensions have less (or the same) dimension labels.
See also
openeo.org documentation on process “filter_bbox”.
- openeo.processes.filter_labels(data, condition, dimension, context=<object object>)[source]¶
Filter dimension labels based on a condition
- Parameters:
data – A data cube.
condition – A condition that is evaluated against each dimension label in the specified dimension. A dimension label and the corresponding data is preserved for the given dimension, if the condition returns true.
dimension – The name of the dimension to filter on. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
context – Additional data to be passed to the condition.
- Return type:
- Returns:
A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the given dimension has less (or the same) dimension labels.
See also
openeo.org documentation on process “filter_labels”.
- openeo.processes.filter_spatial(data, geometries)[source]¶
Spatial filter raster data cubes using geometries
- Parameters:
data – A raster data cube.
geometries – One or more geometries used for filtering, given as GeoJSON or vector data cube. If multiple geometries are provided, the union of them is used. Empty geometries are ignored. Limits the data cube to the bounding box of the given geometries. No implicit masking gets applied. To mask the pixels of the data cube use
mask_polygon()
.
- Return type:
- Returns:
A raster data cube restricted to the specified geometries. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the spatial dimensions have less (or the same) dimension labels.
See also
openeo.org documentation on process “filter_spatial”.
- openeo.processes.filter_temporal(data, extent, dimension=<object object>)[source]¶
Temporal filter based on temporal intervals
- Parameters:
data – A data cube.
extent – Left-closed temporal interval, i.e. an array with exactly two elements: 1. The first element is the start of the temporal interval. The specified time instant is included in the interval. 2. The second element is the end of the temporal interval. The specified time instant is excluded from the interval. The second element must always be greater/later than the first element. Otherwise, a TemporalExtentEmpty exception is thrown. Also supports unbounded intervals by setting one of the boundaries to null, but never both.
dimension – The name of the temporal dimension to filter on. If no specific dimension is specified, the filter applies to all temporal dimensions. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
- Return type:
- Returns:
A data cube restricted to the specified temporal extent. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the temporal dimensions (determined by dimensions parameter) may have less dimension labels.
See also
openeo.org documentation on process “filter_temporal”.
- openeo.processes.filter_vector(data, geometries, relation=<object object>)[source]¶
Spatial vector filter using geometries
- Parameters:
data – A vector data cube with the candidate geometries.
geometries – One or more base geometries used for filtering, given as vector data cube. If multiple base geometries are provided, the union of them is used.
relation – The spatial filter predicate for comparing the geometries provided through (a) geometries (base geometries) and (b) data (candidate geometries).
- Return type:
- Returns:
A vector data cube restricted to the specified geometries. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the geometries dimension has less (or the same) dimension labels.
See also
openeo.org documentation on process “filter_vector”.
- openeo.processes.first(data, ignore_nodata=<object object>)[source]¶
First element
- Parameters:
data – An array with elements of any data type.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if the first value is such a value.
- Return type:
- Returns:
The first element of the input array.
See also
openeo.org documentation on process “first”.
- openeo.processes.fit_curve(data, parameters, function, ignore_nodata=<object object>)[source]¶
Curve fitting
- Parameters:
data – A labeled array, the labels correspond to the variable y and the values correspond to the variable x.
parameters – Defined the number of parameters for the model function and provides an initial guess for them. At least one parameter is required.
function – The model function. It must take the parameters to fit as array through the first argument and the independent variable x as the second argument. It is recommended to store the model function as a user-defined process on the back-end to be able to re-use the model function with the computed optimal values for the parameters afterwards.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is passed to the model function.
- Return type:
- Returns:
An array with the optimal values for the parameters.
See also
openeo.org documentation on process “fit_curve”.
- openeo.processes.flatten_dimensions(data, dimensions, target_dimension, label_separator=<object object>)[source]¶
Combine multiple dimensions into a single dimension
- Parameters:
data – A data cube.
dimensions – The names of the dimension to combine. The order of the array defines the order in which the dimension labels and values are combined (see the example in the process description). Fails with a DimensionNotAvailable exception if at least one of the specified dimensions does not exist.
target_dimension – The name of the new target dimension. A new dimensions will be created with the given names and type other (see
add_dimension()
). Fails with a TargetDimensionExists exception if a dimension with the specified name exists.label_separator – The string that will be used as a separator for the concatenated dimension labels. To unambiguously revert the dimension labels with the process
unflatten_dimension()
, the given string must not be contained in any of the dimension labels.
- Return type:
- Returns:
A data cube with the new shape. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.
See also
openeo.org documentation on process “flatten_dimensions”.
- openeo.processes.floor(x)[source]¶
Round fractions down
- Parameters:
x – A number to round down.
- Return type:
- Returns:
The number rounded down.
See also
openeo.org documentation on process “floor”.
- openeo.processes.gt(x, y)[source]¶
Greater than comparison
- Parameters:
x – First operand.
y – Second operand.
- Return type:
- Returns:
true if x is strictly greater than y or null if any operand is null, otherwise false.
See also
openeo.org documentation on process “gt”.
- openeo.processes.gte(x, y)[source]¶
Greater than or equal to comparison
- Parameters:
x – First operand.
y – Second operand.
- Return type:
- Returns:
true if x is greater than or equal to y, null if any operand is null, otherwise false.
See also
openeo.org documentation on process “gte”.
- openeo.processes.if_(value, accept, reject=<object object>)[source]¶
If-Then-Else conditional
- Parameters:
value – A boolean value.
accept – A value that is returned if the boolean value is true.
reject – A value that is returned if the boolean value is not true. Defaults to null.
- Return type:
- Returns:
Either the accept or reject argument depending on the given boolean value.
See also
openeo.org documentation on process “if_”.
- openeo.processes.inspect(data, message=<object object>, code=<object object>, level=<object object>)[source]¶
Add information to the logs
- Parameters:
data – Data to log.
message – A message to send in addition to the data.
code – A label to help identify one or more log entries originating from this process in the list of all log entries. It can help to group or filter log entries and is usually not unique.
level – The severity level of this message, defaults to info.
- Return type:
- Returns:
The data as passed to the data parameter without any modification.
See also
openeo.org documentation on process “inspect”.
- openeo.processes.int(x)[source]¶
Integer part of a number
- Parameters:
x – A number.
- Return type:
- Returns:
Integer part of the number.
See also
openeo.org documentation on process “int”.
- openeo.processes.is_infinite(x)[source]¶
Value is an infinite number
- Parameters:
x – The data to check.
- Return type:
- Returns:
true if the data is an infinite number, otherwise false.
See also
openeo.org documentation on process “is_infinite”.
- openeo.processes.is_nan(x)[source]¶
Value is not a number
- Parameters:
x – The data to check.
- Return type:
- Returns:
Returns true for NaN and all non-numeric data types, otherwise returns false.
See also
openeo.org documentation on process “is_nan”.
- openeo.processes.is_nodata(x)[source]¶
Value is a no-data value
- Parameters:
x – The data to check.
- Return type:
- Returns:
true if the data is a no-data value, otherwise false.
See also
openeo.org documentation on process “is_nodata”.
- openeo.processes.is_valid(x)[source]¶
Value is valid data
- Parameters:
x – The data to check.
- Return type:
- Returns:
true if the data is valid, otherwise false.
See also
openeo.org documentation on process “is_valid”.
- openeo.processes.last(data, ignore_nodata=<object object>)[source]¶
Last element
- Parameters:
data – An array with elements of any data type.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if the last value is such a value.
- Return type:
- Returns:
The last element of the input array.
See also
openeo.org documentation on process “last”.
- openeo.processes.linear_scale_range(x, inputMin, inputMax, outputMin=<object object>, outputMax=<object object>)[source]¶
Linear transformation between two ranges
- Parameters:
x – A number to transform. The number gets clipped to the bounds specified in inputMin and inputMax.
inputMin – Minimum value the input can obtain.
inputMax – Maximum value the input can obtain.
outputMin – Minimum value of the desired output range.
outputMax – Maximum value of the desired output range.
- Return type:
- Returns:
The transformed number.
See also
openeo.org documentation on process “linear_scale_range”.
- openeo.processes.ln(x)[source]¶
Natural logarithm
- Parameters:
x – A number to compute the natural logarithm for.
- Return type:
- Returns:
The computed natural logarithm.
See also
openeo.org documentation on process “ln”.
- openeo.processes.load_collection(id, spatial_extent, temporal_extent, bands=<object object>, properties=<object object>)[source]¶
Load a collection
- Parameters:
id – The collection id.
spatial_extent – Limits the data to load from the collection to the specified bounding box or polygons. * For raster data, the process loads the pixel into the data cube if the point at the pixel center intersects with the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). * For vector data, the process loads the geometry into the data cube if the geometry is fully within the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). Empty geometries may only be in the data cube if no spatial extent has been provided. The GeoJSON can be one of the following feature types: * A Polygon or MultiPolygon geometry, * a Feature with a Polygon or MultiPolygon geometry, or * a FeatureCollection containing at least one Feature with Polygon or MultiPolygon geometries. * Empty geometries are ignored. Set this parameter to null to set no limit for the spatial extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_bbox()
orfilter_spatial()
directly after loading unbounded data.temporal_extent – Limits the data to load from the collection to the specified left-closed temporal interval. Applies to all temporal dimensions. The interval has to be specified as an array with exactly two elements: 1. The first element is the start of the temporal interval. The specified time instant is included in the interval. 2. The second element is the end of the temporal interval. The specified time instant is excluded from the interval. The second element must always be greater/later than the first element. Otherwise, a TemporalExtentEmpty exception is thrown. Also supports unbounded intervals by setting one of the boundaries to null, but never both. Set this parameter to null to set no limit for the temporal extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_temporal()
directly after loading unbounded data.bands – Only adds the specified bands into the data cube so that bands that don’t match the list of band names are not available. Applies to all dimensions of type bands. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority. The order of the specified array defines the order of the bands in the data cube. If multiple bands match a common name, all matched bands are included in the original order. It is recommended to use this parameter instead of using
filter_bands()
directly after loading unbounded data.properties – Limits the data by metadata properties to include only data in the data cube which all given conditions return true for (AND operation). Specify key-value-pairs with the key being the name of the metadata property, which can be retrieved with the openEO Data Discovery for Collections. The value must be a condition (user-defined process) to be evaluated against the collection metadata, see the example.
- Return type:
- Returns:
A data cube for further processing. The dimensions and dimension properties (name, type, labels, reference system and resolution) correspond to the collection’s metadata, but the dimension labels are restricted as specified in the parameters.
See also
openeo.org documentation on process “load_collection”.
- openeo.processes.load_geojson(data, properties=<object object>)[source]¶
Converts GeoJSON into a vector data cube
- Parameters:
data – A GeoJSON object to convert into a vector data cube. The GeoJSON type GeometryCollection is not supported. Each geometry in the GeoJSON data results in a dimension label in the geometries dimension.
properties – A list of properties from the GeoJSON file to construct an additional dimension from. A new dimension with the name properties and type other is created if at least one property is provided. Only applies for GeoJSON Features and FeatureCollections. Missing values are generally set to no-data (null). Depending on the number of properties provided, the process creates the dimension differently: - Single property with scalar values: A single dimension label with the name of the property and a single value per geometry. - Single property of type array: The dimension labels correspond to the array indices. There are as many values and labels per geometry as there are for the largest array. - Multiple properties with scalar values: The dimension labels correspond to the property names. There are as many values and labels per geometry as there are properties provided here.
- Return type:
- Returns:
A vector data cube containing the geometries, either one or two dimensional.
See also
openeo.org documentation on process “load_geojson”.
- openeo.processes.load_ml_model(id)[source]¶
Load a ML model
- Parameters:
id – The STAC Item to load the machine learning model from. The STAC Item must implement the ml- model extension.
- Return type:
- Returns:
A machine learning model to be used with machine learning processes such as
predict_random_forest()
.
See also
openeo.org documentation on process “load_ml_model”.
- openeo.processes.load_result(id, spatial_extent=<object object>, temporal_extent=<object object>, bands=<object object>)[source]¶
Load batch job results
- Parameters:
id – The id of a batch job with results.
spatial_extent – Limits the data to load from the batch job result to the specified bounding box or polygons. * For raster data, the process loads the pixel into the data cube if the point at the pixel center intersects with the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). * For vector data, the process loads the geometry into the data cube of the geometry is fully within the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). Empty geometries may only be in the data cube if no spatial extent has been provided. The GeoJSON can be one of the following feature types: * A Polygon or MultiPolygon geometry, * a Feature with a Polygon or MultiPolygon geometry, or * a FeatureCollection containing at least one Feature with Polygon or MultiPolygon geometries. Set this parameter to null to set no limit for the spatial extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_bbox()
orfilter_spatial()
directly after loading unbounded data.temporal_extent – Limits the data to load from the batch job result to the specified left-closed temporal interval. Applies to all temporal dimensions. The interval has to be specified as an array with exactly two elements: 1. The first element is the start of the temporal interval. The specified instance in time is included in the interval. 2. The second element is the end of the temporal interval. The specified instance in time is excluded from the interval. The specified temporal strings follow [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html). Also supports open intervals by setting one of the boundaries to null, but never both. Set this parameter to null to set no limit for the temporal extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_temporal()
directly after loading unbounded data.bands – Only adds the specified bands into the data cube so that bands that don’t match the list of band names are not available. Applies to all dimensions of type bands. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority. The order of the specified array defines the order of the bands in the data cube. If multiple bands match a common name, all matched bands are included in the original order. It is recommended to use this parameter instead of using
filter_bands()
directly after loading unbounded data.
- Return type:
- Returns:
A data cube for further processing.
See also
openeo.org documentation on process “load_result”.
- openeo.processes.load_stac(url, spatial_extent=<object object>, temporal_extent=<object object>, bands=<object object>, properties=<object object>)[source]¶
Loads data from STAC
- Parameters:
url – The URL to a static STAC catalog (STAC Item, STAC Collection, or STAC Catalog) or a specific STAC API Collection that allows to filter items and to download assets. This includes batch job results, which itself are compliant to STAC. For external URLs, authentication details such as API keys or tokens may need to be included in the URL. Batch job results can be specified in two ways: - For Batch job results at the same back-end, a URL pointing to the corresponding batch job results endpoint should be provided. The URL usually ends with /jobs/{id}/results and {id} is the corresponding batch job ID. - For external results, a signed URL must be provided. Not all back-ends support signed URLs, which are provided as a link with the link relation canonical in the batch job result metadata.
spatial_extent – Limits the data to load to the specified bounding box or polygons. * For raster data, the process loads the pixel into the data cube if the point at the pixel center intersects with the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). * For vector data, the process loads the geometry into the data cube if the geometry is fully within the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). Empty geometries may only be in the data cube if no spatial extent has been provided. The GeoJSON can be one of the following feature types: * A Polygon or MultiPolygon geometry, * a Feature with a Polygon or MultiPolygon geometry, or * a FeatureCollection containing at least one Feature with Polygon or MultiPolygon geometries. Set this parameter to null to set no limit for the spatial extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_bbox()
orfilter_spatial()
directly after loading unbounded data.temporal_extent – Limits the data to load to the specified left-closed temporal interval. Applies to all temporal dimensions. The interval has to be specified as an array with exactly two elements: 1. The first element is the start of the temporal interval. The specified instance in time is included in the interval. 2. The second element is the end of the temporal interval. The specified instance in time is excluded from the interval. The second element must always be greater/later than the first element. Otherwise, a TemporalExtentEmpty exception is thrown. Also supports open intervals by setting one of the boundaries to null, but never both. Set this parameter to null to set no limit for the temporal extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using
filter_temporal()
directly after loading unbounded data.bands – Only adds the specified bands into the data cube so that bands that don’t match the list of band names are not available. Applies to all dimensions of type bands. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority. The order of the specified array defines the order of the bands in the data cube. If multiple bands match a common name, all matched bands are included in the original order. It is recommended to use this parameter instead of using
filter_bands()
directly after loading unbounded data.properties – Limits the data by metadata properties to include only data in the data cube which all given conditions return true for (AND operation). Specify key-value-pairs with the key being the name of the metadata property, which can be retrieved with the openEO Data Discovery for Collections. The value must be a condition (user-defined process) to be evaluated against a STAC API. This parameter is not supported for static STAC.
- Return type:
- Returns:
A data cube for further processing.
See also
openeo.org documentation on process “load_stac”.
- openeo.processes.load_uploaded_files(paths, format, options=<object object>)[source]¶
Load files from the user workspace
- Parameters:
paths – The files to read. Folders can’t be specified, specify all files instead. An exception is thrown if a file can’t be read.
format – The file format to read from. It must be one of the values that the server reports as supported input file formats, which usually correspond to the short GDAL/OGR codes. If the format is not suitable for loading the data, a FormatUnsuitable exception will be thrown. This parameter is case insensitive.
options – The file format parameters to be used to read the files. Must correspond to the parameters that the server reports as supported parameters for the chosen format. The parameter names and valid values usually correspond to the GDAL/OGR format options.
- Return type:
- Returns:
A data cube for further processing.
See also
openeo.org documentation on process “load_uploaded_files”.
- openeo.processes.load_url(url, format, options=<object object>)[source]¶
Load data from a URL
- Parameters:
url – The URL to read from. Authentication details such as API keys or tokens may need to be included in the URL.
format – The file format to use when loading the data. It must be one of the values that the server reports as supported input file formats, which usually correspond to the short GDAL/OGR codes. If the format is not suitable for loading the data, a FormatUnsuitable exception will be thrown. This parameter is case insensitive.
options – The file format parameters to use when reading the data. Must correspond to the parameters that the server reports as supported parameters for the chosen format. The parameter names and valid values usually correspond to the GDAL/OGR format options.
- Return type:
- Returns:
A data cube for further processing.
See also
openeo.org documentation on process “load_url”.
- openeo.processes.log(x, base)[source]¶
Logarithm to a base
- Parameters:
x – A number to compute the logarithm for.
base – The numerical base.
- Return type:
- Returns:
The computed logarithm.
See also
openeo.org documentation on process “log”.
- openeo.processes.lt(x, y)[source]¶
Less than comparison
- Parameters:
x – First operand.
y – Second operand.
- Return type:
- Returns:
true if x is strictly less than y, null if any operand is null, otherwise false.
See also
openeo.org documentation on process “lt”.
- openeo.processes.lte(x, y)[source]¶
Less than or equal to comparison
- Parameters:
x – First operand.
y – Second operand.
- Return type:
- Returns:
true if x is less than or equal to y, null if any operand is null, otherwise false.
See also
openeo.org documentation on process “lte”.
- openeo.processes.mask(data, mask, replacement=<object object>)[source]¶
Apply a raster mask
- Parameters:
data – A raster data cube.
mask – A mask as a raster data cube. Every pixel in data must have a corresponding element in mask.
replacement – The value used to replace masked values with.
- Return type:
- Returns:
A masked raster data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “mask”.
- openeo.processes.mask_polygon(data, mask, replacement=<object object>, inside=<object object>)[source]¶
Apply a polygon mask
- Parameters:
data – A raster data cube.
mask – A GeoJSON object or a vector data cube containing at least one polygon. The provided vector data can be one of the following: * A Polygon or MultiPolygon geometry, * a Feature with a Polygon or MultiPolygon geometry, or * a FeatureCollection containing at least one Feature with Polygon or MultiPolygon geometries. * Empty geometries are ignored.
replacement – The value used to replace masked values with.
inside – If set to true all pixels for which the point at the pixel center does intersect with any polygon are replaced.
- Return type:
- Returns:
A masked raster data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “mask_polygon”.
- openeo.processes.max(data, ignore_nodata=<object object>)[source]¶
Maximum value
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The maximum value.
See also
openeo.org documentation on process “max”.
- openeo.processes.mean(data, ignore_nodata=<object object>)[source]¶
Arithmetic mean (average)
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed arithmetic mean.
See also
openeo.org documentation on process “mean”.
- openeo.processes.median(data, ignore_nodata=<object object>)[source]¶
Statistical median
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed statistical median.
See also
openeo.org documentation on process “median”.
- openeo.processes.merge_cubes(cube1, cube2, overlap_resolver=<object object>, context=<object object>)[source]¶
Merge two data cubes
- Parameters:
cube1 – The base data cube.
cube2 – The other data cube to be merged with the base data cube.
overlap_resolver – A reduction operator that resolves the conflict if the data overlaps. The reducer must return a value of the same data type as the input values are. The reduction operator may be a single process such as
multiply()
or consist of multiple sub-processes. null (the default) can be specified if no overlap resolver is required.context – Additional data to be passed to the overlap resolver.
- Return type:
- Returns:
The merged data cube. See the process description for details regarding the dimensions and dimension properties (name, type, labels, reference system and resolution).
See also
openeo.org documentation on process “merge_cubes”.
- openeo.processes.min(data, ignore_nodata=<object object>)[source]¶
Minimum value
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The minimum value.
See also
openeo.org documentation on process “min”.
- openeo.processes.mod(x, y)[source]¶
Modulo
- Parameters:
x – A number to be used as the dividend.
y – A number to be used as the divisor.
- Return type:
- Returns:
The remainder after division.
See also
openeo.org documentation on process “mod”.
- openeo.processes.multiply(x, y)[source]¶
Multiplication of two numbers
- Parameters:
x – The multiplier.
y – The multiplicand.
- Return type:
- Returns:
The computed product of the two numbers.
See also
openeo.org documentation on process “multiply”.
- openeo.processes.nan()[source]¶
Not a Number (NaN)
- Return type:
- Returns:
Returns NaN.
See also
openeo.org documentation on process “nan”.
- openeo.processes.ndvi(data, nir=<object object>, red=<object object>, target_band=<object object>)[source]¶
Normalized Difference Vegetation Index
- Parameters:
data – A raster data cube with two bands that have the common names red and nir assigned.
nir – The name of the NIR band. Defaults to the band that has the common name nir assigned. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority.
red – The name of the red band. Defaults to the band that has the common name red assigned. Either the unique band name (metadata field name in bands) or one of the common band names (metadata field common_name in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority.
target_band – By default, the dimension of type bands is dropped. To keep the dimension specify a new band name in this parameter so that a new dimension label with the specified name will be added for the computed values.
- Return type:
- Returns:
A raster data cube containing the computed NDVI values. The structure of the data cube differs depending on the value passed to target_band: * target_band is null: The data cube does not contain the dimension of type bands, the number of dimensions decreases by one. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged. * target_band is a string: The data cube keeps the same dimensions. The dimension properties remain unchanged, but the number of dimension labels for the dimension of type bands increases by one. The additional label is named as specified in target_band.
See also
openeo.org documentation on process “ndvi”.
- openeo.processes.neq(x, y, delta=<object object>, case_sensitive=<object object>)[source]¶
Not equal to comparison
- Parameters:
x – First operand.
y – Second operand.
delta – Only applicable for comparing two numbers. If this optional parameter is set to a positive non-zero number the non-equality of two numbers is checked against a delta value. This is especially useful to circumvent problems with floating-point inaccuracy in machine-based computation. This option is basically an alias for the following computation: gt(abs(minus([x, y]), delta)
case_sensitive – Only applicable for comparing two strings. Case sensitive comparison can be disabled by setting this parameter to false.
- Return type:
- Returns:
true if x is not equal to y, null if any operand is null, otherwise false.
See also
openeo.org documentation on process “neq”.
- openeo.processes.normalized_difference(x, y)[source]¶
Normalized difference
- Parameters:
x – The value for the first band.
y – The value for the second band.
- Return type:
- Returns:
The computed normalized difference.
See also
openeo.org documentation on process “normalized_difference”.
- openeo.processes.not_(x)[source]¶
Inverting a boolean
- Parameters:
x – Boolean value to invert.
- Return type:
- Returns:
Inverted boolean value.
See also
openeo.org documentation on process “not_”.
- openeo.processes.or_(x, y)[source]¶
Logical OR
- Parameters:
x – A boolean value.
y – A boolean value.
- Return type:
- Returns:
Boolean result of the logical OR.
See also
openeo.org documentation on process “or_”.
- openeo.processes.order(data, asc=<object object>, nodata=<object object>)[source]¶
Get the order of array elements
- Parameters:
data – An array to compute the order for.
asc – The default sort order is ascending, with smallest values first. To sort in reverse (descending) order, set this parameter to false.
nodata – Controls the handling of no-data values (null). By default, they are removed. If set to true, missing values in the data are put last; if set to false, they are put first.
- Return type:
- Returns:
The computed permutation.
See also
openeo.org documentation on process “order”.
- openeo.processes.pi()[source]¶
Pi (π)
- Return type:
- Returns:
The numerical value of Pi.
See also
openeo.org documentation on process “pi”.
- openeo.processes.power(base, p)[source]¶
Exponentiation
- Parameters:
base – The numerical base.
p – The numerical exponent.
- Return type:
- Returns:
The computed value for base raised to the power of p.
See also
openeo.org documentation on process “power”.
- openeo.processes.predict_curve(parameters, function, dimension, labels=<object object>)[source]¶
Predict values
- Parameters:
parameters – A data cube with optimal values, e.g. computed by the process
fit_curve()
.function – The model function. It must take the parameters to fit as array through the first argument and the independent variable x as the second argument. It is recommended to store the model function as a user-defined process on the back-end.
dimension – The name of the dimension for predictions.
labels – The labels to predict values for. If no labels are given, predicts values only for no-data (null) values in the data cube.
- Return type:
- Returns:
A data cube with the predicted values with the provided dimension dimension having as many labels as provided through labels.
See also
openeo.org documentation on process “predict_curve”.
- openeo.processes.predict_random_forest(data, model)[source]¶
Predict values based on a Random Forest model
- Parameters:
data – An array of numbers.
model – A model object that can be trained with the processes
fit_regr_random_forest()
(regression) andfit_class_random_forest()
(classification).
- Return type:
- Returns:
The predicted value. Returns null if any of the given values in the array is a no-data value.
See also
openeo.org documentation on process “predict_random_forest”.
- openeo.processes.product(data, ignore_nodata=<object object>)[source]¶
Compute the product by multiplying numbers
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed product of the sequence of numbers.
See also
openeo.org documentation on process “product”.
- openeo.processes.quantiles(data, probabilities=<object object>, q=<object object>, ignore_nodata=<object object>)[source]¶
Quantiles
- Parameters:
data – An array of numbers.
probabilities – Quantiles to calculate. Either a list of probabilities or the number of intervals: * Provide an array with a sorted list of probabilities in ascending order to calculate quantiles for. The probabilities must be between 0 and 1 (inclusive). If not sorted in ascending order, an AscendingProbabilitiesRequired exception is thrown. * Provide an integer to specify the number of intervals to calculate quantiles for. Calculates q-quantiles with equal-sized intervals.
q – Number of intervals to calculate quantiles for. Calculates q-quantiles with equal-sized intervals. This parameter has been deprecated. Please use the parameter probabilities instead.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that an array with null values is returned if any element is such a value.
- Return type:
- Returns:
An array with the computed quantiles. The list has either * as many elements as the given list of probabilities had or * `q`-1 elements. If the input array is empty the resulting array is filled with as many null values as required according to the list above. See the ‘Empty array’ example for an example.
See also
openeo.org documentation on process “quantiles”.
- openeo.processes.rearrange(data, order)[source]¶
Sort an array based on a permutation
- Parameters:
data – The array to rearrange.
order – The permutation used for rearranging.
- Return type:
- Returns:
The rearranged array.
See also
openeo.org documentation on process “rearrange”.
- openeo.processes.reduce_dimension(data, reducer, dimension, context=<object object>)[source]¶
Reduce dimensions
- Parameters:
data – A data cube.
reducer – A reducer to apply on the specified dimension. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes.dimension – The name of the dimension over which to reduce. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A data cube with the newly computed values. It is missing the given dimension, the number of dimensions decreases by one. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.
See also
openeo.org documentation on process “reduce_dimension”.
- openeo.processes.reduce_spatial(data, reducer, context=<object object>)[source]¶
Reduce spatial dimensions ‘x’ and ‘y’
- Parameters:
data – A raster data cube.
reducer – A reducer to apply on the horizontal spatial dimensions. A reducer is a single process such as
mean()
or a set of processes, which computes a single value for a list of values, see the category ‘reducer’ for such processes.context – Additional data to be passed to the reducer.
- Return type:
- Returns:
A data cube with the newly computed values. It is missing the horizontal spatial dimensions, the number of dimensions decreases by two. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.
See also
openeo.org documentation on process “reduce_spatial”.
- openeo.processes.rename_dimension(data, source, target)[source]¶
Rename a dimension
- Parameters:
data – The data cube.
source – The current name of the dimension. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
target – A new Name for the dimension. Fails with a DimensionExists exception if a dimension with the specified name exists.
- Return type:
- Returns:
A data cube with the same dimensions, but the name of one of the dimensions changes. The old name can not be referred to any longer. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.
See also
openeo.org documentation on process “rename_dimension”.
- openeo.processes.rename_labels(data, dimension, target, source=<object object>)[source]¶
Rename dimension labels
- Parameters:
data – The data cube.
dimension – The name of the dimension to rename the labels for.
target – The new names for the labels. If a target dimension label already exists in the data cube, a LabelExists exception is thrown.
source – The original names of the labels to be renamed to corresponding array elements in the parameter target. It is allowed to only specify a subset of labels to rename, as long as the target and source parameter have the same length. The order of the labels doesn’t need to match the order of the dimension labels in the data cube. By default, the array is empty so that the dimension labels in the data cube are expected to be enumerated. If the dimension labels are not enumerated and the given array is empty, the LabelsNotEnumerated exception is thrown. If one of the source dimension labels doesn’t exist, the LabelNotAvailable exception is thrown.
- Return type:
- Returns:
The data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that for the given dimension the labels change. The old labels can not be referred to any longer. The number of labels remains the same.
See also
openeo.org documentation on process “rename_labels”.
- openeo.processes.resample_cube_spatial(data, target, method=<object object>)[source]¶
Resample the spatial dimensions to match a target data cube
- Parameters:
data – A raster data cube.
target – A raster data cube that describes the spatial target resolution.
method – Resampling method to use. The following options are available and are meant to align with [gdalwarp](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r): * average: average (mean) resampling, computes the weighted average of all valid pixels * bilinear: bilinear resampling * cubic: cubic resampling * cubicspline: cubic spline resampling * lanczos: Lanczos windowed sinc resampling * max: maximum resampling, selects the maximum value from all valid pixels * med: median resampling, selects the median value of all valid pixels * min: minimum resampling, selects the minimum value from all valid pixels * mode: mode resampling, selects the value which appears most often of all the sampled points * near: nearest neighbour resampling (default) * q1: first quartile resampling, selects the first quartile value of all valid pixels * q3: third quartile resampling, selects the third quartile value of all valid pixels * rms root mean square (quadratic mean) of all valid pixels * sum: compute the weighted sum of all valid pixels Valid pixels are determined based on the function
is_valid()
.
- Return type:
- Returns:
A raster data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the spatial dimensions.
See also
openeo.org documentation on process “resample_cube_spatial”.
- openeo.processes.resample_cube_temporal(data, target, dimension=<object object>, valid_within=<object object>)[source]¶
Resample temporal dimensions to match a target data cube
- Parameters:
data – A data cube with one or more temporal dimensions.
target – A data cube that describes the temporal target resolution.
dimension – The name of the temporal dimension to resample, which must exist with this name in both data cubes. If the dimension is not set or is set to null, the process resamples all temporal dimensions that exist with the same names in both data cubes. The following exceptions may occur: * A dimension is given, but it does not exist in any of the data cubes: DimensionNotAvailable * A dimension is given, but one of them is not temporal: DimensionMismatch * No specific dimension name is given and there are no temporal dimensions with the same name in the data: DimensionMismatch
valid_within – Setting this parameter to a numerical value enables that the process searches for valid values within the given period of days before and after the target timestamps. Valid values are determined based on the function
is_valid()
. For example, the limit of 7 for the target timestamps 2020-01-15 12:00:00 looks for a nearest neighbor after 2020-01-08 12:00:00 and before 2020-01-22 12:00:00. If no valid value is found within the given period, the value will be set to no-data (null).
- Return type:
- Returns:
A data cube with the same dimensions and the same dimension properties (name, type, labels, reference system and resolution) for all non-temporal dimensions. For the temporal dimension, the name and type remain unchanged, but the dimension labels, resolution and reference system may change.
See also
openeo.org documentation on process “resample_cube_temporal”.
- openeo.processes.resample_spatial(data, resolution=<object object>, projection=<object object>, method=<object object>, align=<object object>)[source]¶
Resample and warp the spatial dimensions
- Parameters:
data – A raster data cube.
resolution – Resamples the data cube to the target resolution, which can be specified either as separate values for x and y or as a single value for both axes. Specified in the units of the target projection. Doesn’t change the resolution by default (0).
projection – Warps the data cube to the target projection, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (null), the projection is not changed.
method – Resampling method to use. The following options are available and are meant to align with [gdalwarp](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r): * average: average (mean) resampling, computes the weighted average of all valid pixels * bilinear: bilinear resampling * cubic: cubic resampling * cubicspline: cubic spline resampling * lanczos: Lanczos windowed sinc resampling * max: maximum resampling, selects the maximum value from all valid pixels * med: median resampling, selects the median value of all valid pixels * min: minimum resampling, selects the minimum value from all valid pixels * mode: mode resampling, selects the value which appears most often of all the sampled points * near: nearest neighbour resampling (default) * q1: first quartile resampling, selects the first quartile value of all valid pixels * q3: third quartile resampling, selects the third quartile value of all valid pixels * rms root mean square (quadratic mean) of all valid pixels * sum: compute the weighted sum of all valid pixels Valid pixels are determined based on the function
is_valid()
.align – Specifies to which corner of the spatial extent the new resampled data is aligned to.
- Return type:
- Returns:
A raster data cube with values warped onto the new projection. It has the same dimensions and the same dimension properties (name, type, labels, reference system and resolution) for all non-spatial or vertical spatial dimensions. For the horizontal spatial dimensions the name and type remain unchanged, but reference system, labels and resolution may change depending on the given parameters.
See also
openeo.org documentation on process “resample_spatial”.
- openeo.processes.round(x, p=<object object>)[source]¶
Round to a specified precision
- Parameters:
x – A number to round.
p – A positive number specifies the number of digits after the decimal point to round to. A negative number means rounding to a power of ten, so for example -2 rounds to the nearest hundred. Defaults to 0.
- Return type:
- Returns:
The rounded number.
See also
openeo.org documentation on process “round”.
- openeo.processes.run_udf(data, udf, runtime, version=<object object>, context=<object object>)[source]¶
Run a UDF
- Parameters:
data – The data to be passed to the UDF.
udf – Either source code, an absolute URL or a path to a UDF script.
runtime – A UDF runtime identifier available at the back-end.
version – An UDF runtime version. If set to null, the default runtime version specified for each runtime is used.
context – Additional data such as configuration options to be passed to the UDF.
- Return type:
- Returns:
The data processed by the UDF. The returned value can be of any data type and is exactly what the UDF code returns.
See also
openeo.org documentation on process “run_udf”.
- openeo.processes.run_udf_externally(data, url, context=<object object>)[source]¶
Run an externally hosted UDF container
- Parameters:
data – The data to be passed to the UDF.
url – Absolute URL to a remote UDF service.
context – Additional data such as configuration options to be passed to the UDF.
- Return type:
- Returns:
The data processed by the UDF. The returned value can in principle be of any data type, but it depends on what is returned by the UDF code. Please see the implemented UDF interface for details.
See also
openeo.org documentation on process “run_udf_externally”.
- openeo.processes.sar_backscatter(data, coefficient=<object object>, elevation_model=<object object>, mask=<object object>, contributing_area=<object object>, local_incidence_angle=<object object>, ellipsoid_incidence_angle=<object object>, noise_removal=<object object>, options=<object object>)[source]¶
Computes backscatter from SAR input
- Parameters:
data – The source data cube containing SAR input.
coefficient – Select the radiometric correction coefficient. The following options are available: * beta0: radar brightness * sigma0-ellipsoid: ground area computed with ellipsoid earth model * sigma0-terrain: ground area computed with terrain earth model * gamma0-ellipsoid: ground area computed with ellipsoid earth model in sensor line of sight * gamma0-terrain: ground area computed with terrain earth model in sensor line of sight (default) * null: non-normalized backscatter
elevation_model – The digital elevation model to use. Set to null (the default) to allow the back- end to choose, which will improve portability, but reduce reproducibility.
mask – If set to true, a data mask is added to the bands with the name mask. It indicates which values are valid (1), invalid (0) or contain no-data (null).
contributing_area – If set to true, a DEM-based local contributing area band named contributing_area is added. The values are given in square meters.
local_incidence_angle – If set to true, a DEM-based local incidence angle band named local_incidence_angle is added. The values are given in degrees.
ellipsoid_incidence_angle – If set to true, an ellipsoidal incidence angle band named ellipsoid_incidence_angle is added. The values are given in degrees.
noise_removal – If set to false, no noise removal is applied. Defaults to true, which removes noise.
options – Proprietary options for the backscatter computations. Specifying proprietary options will reduce portability.
- Return type:
- Returns:
Backscatter values corresponding to the chosen parametrization. The values are given in linear scale.
See also
openeo.org documentation on process “sar_backscatter”.
- openeo.processes.save_result(data, format, options=<object object>)[source]¶
Save processed data
- Parameters:
data – The data to deliver in the given file format.
format – The file format to use. It must be one of the values that the server reports as supported output file formats, which usually correspond to the short GDAL/OGR codes. This parameter is case insensitive. * If the data cube is empty and the file format can’t store empty data cubes, a DataCubeEmpty exception is thrown. * If the file format is otherwise not suitable for storing the underlying data structure, a FormatUnsuitable exception is thrown.
options – The file format parameters to be used to create the file(s). Must correspond to the parameters that the server reports as supported parameters for the chosen format. The parameter names and valid values usually correspond to the GDAL/OGR format options.
- Return type:
- Returns:
Always returns true as in case of an error an exception is thrown which aborts the execution of the process.
See also
openeo.org documentation on process “save_result”.
- openeo.processes.sd(data, ignore_nodata=<object object>)[source]¶
Standard deviation
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed sample standard deviation.
See also
openeo.org documentation on process “sd”.
- openeo.processes.sgn(x)[source]¶
Signum
- Parameters:
x – A number.
- Return type:
- Returns:
The computed signum value of x.
See also
openeo.org documentation on process “sgn”.
- openeo.processes.sin(x)[source]¶
Sine
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed sine of x.
See also
openeo.org documentation on process “sin”.
- openeo.processes.sinh(x)[source]¶
Hyperbolic sine
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed hyperbolic sine of x.
See also
openeo.org documentation on process “sinh”.
- openeo.processes.sort(data, asc=<object object>, nodata=<object object>)[source]¶
Sort data
- Parameters:
data – An array with data to sort.
asc – The default sort order is ascending, with smallest values first. To sort in reverse (descending) order, set this parameter to false.
nodata – Controls the handling of no-data values (null). By default, they are removed. If set to true, missing values in the data are put last; if set to false, they are put first.
- Return type:
- Returns:
The sorted array.
See also
openeo.org documentation on process “sort”.
- openeo.processes.sqrt(x)[source]¶
Square root
- Parameters:
x – A number.
- Return type:
- Returns:
The computed square root.
See also
openeo.org documentation on process “sqrt”.
- openeo.processes.subtract(x, y)[source]¶
Subtraction of two numbers
- Parameters:
x – The minuend.
y – The subtrahend.
- Return type:
- Returns:
The computed result.
See also
openeo.org documentation on process “subtract”.
- openeo.processes.sum(data, ignore_nodata=<object object>)[source]¶
Compute the sum by adding up numbers
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed sum of the sequence of numbers.
See also
openeo.org documentation on process “sum”.
- openeo.processes.tan(x)[source]¶
Tangent
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed tangent of x.
See also
openeo.org documentation on process “tan”.
- openeo.processes.tanh(x)[source]¶
Hyperbolic tangent
- Parameters:
x – An angle in radians.
- Return type:
- Returns:
The computed hyperbolic tangent of x.
See also
openeo.org documentation on process “tanh”.
- openeo.processes.text_begins(data, pattern, case_sensitive=<object object>)[source]¶
Text begins with another text
- Parameters:
data – Text in which to find something at the beginning.
pattern – Text to find at the beginning of data. Regular expressions are not supported.
case_sensitive – Case sensitive comparison can be disabled by setting this parameter to false.
- Return type:
- Returns:
true if data begins with pattern, false` otherwise.
See also
openeo.org documentation on process “text_begins”.
- openeo.processes.text_concat(data, separator=<object object>)[source]¶
Concatenate elements to a single text
- Parameters:
data – A set of elements. Numbers, boolean values and null values get converted to their (lower case) string representation. For example: 1 (integer), -1.5 (number), true / false (boolean values)
separator – A separator to put between each of the individual texts. Defaults to an empty string.
- Return type:
- Returns:
A string containing a string representation of all the array elements in the same order, with the separator between each element.
See also
openeo.org documentation on process “text_concat”.
- openeo.processes.text_contains(data, pattern, case_sensitive=<object object>)[source]¶
Text contains another text
- Parameters:
data – Text in which to find something in.
pattern – Text to find in data. Regular expressions are not supported.
case_sensitive – Case sensitive comparison can be disabled by setting this parameter to false.
- Return type:
- Returns:
true if data contains the pattern, false` otherwise.
See also
openeo.org documentation on process “text_contains”.
- openeo.processes.text_ends(data, pattern, case_sensitive=<object object>)[source]¶
Text ends with another text
- Parameters:
data – Text in which to find something at the end.
pattern – Text to find at the end of data. Regular expressions are not supported.
case_sensitive – Case sensitive comparison can be disabled by setting this parameter to false.
- Return type:
- Returns:
true if data ends with pattern, false` otherwise.
See also
openeo.org documentation on process “text_ends”.
- openeo.processes.trim_cube(data)[source]¶
Remove dimension labels with no-data values
- Parameters:
data – A data cube to trim.
- Return type:
- Returns:
A trimmed data cube with the same dimensions. The dimension properties name, type, reference system and resolution remain unchanged. The number of dimension labels may decrease.
See also
openeo.org documentation on process “trim_cube”.
- openeo.processes.unflatten_dimension(data, dimension, target_dimensions, label_separator=<object object>)[source]¶
Split a single dimensions into multiple dimensions
- Parameters:
data – A data cube that is consistently structured so that operation can execute flawlessly (e.g. the dimension labels need to contain the label_separator exactly 1 time for two target dimensions, 2 times for three target dimensions etc.).
dimension – The name of the dimension to split.
target_dimensions – The names of the new target dimensions. New dimensions will be created with the given names and type other (see
add_dimension()
). Fails with a TargetDimensionExists exception if any of the dimensions exists. The order of the array defines the order in which the dimensions and dimension labels are added to the data cube (see the example in the process description).label_separator – The string that will be used as a separator to split the dimension labels.
- Return type:
- Returns:
A data cube with the new shape. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.
See also
openeo.org documentation on process “unflatten_dimension”.
- openeo.processes.variance(data, ignore_nodata=<object object>)[source]¶
Variance
- Parameters:
data – An array of numbers.
ignore_nodata – Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to false considers no-data values so that null is returned if any value is such a value.
- Return type:
- Returns:
The computed sample variance.
See also
openeo.org documentation on process “variance”.
- openeo.processes.vector_buffer(geometries, distance)[source]¶
Buffer geometries by distance
- Parameters:
geometries – Geometries to apply the buffer on. Feature properties are preserved.
distance – The distance of the buffer in meters. A positive distance expands the geometries, resulting in outward buffering (dilation), while a negative distance shrinks the geometries, resulting in inward buffering (erosion). If the unit of the spatial reference system is not meters, a UnitMismatch error is thrown. Use
vector_reproject()
to convert the geometries to a suitable spatial reference system.
- Return type:
- Returns:
Returns a vector data cube with the computed new geometries of which some may be empty.
See also
openeo.org documentation on process “vector_buffer”.
- openeo.processes.vector_reproject(data, projection, dimension=<object object>)[source]¶
Reprojects the geometry dimension
- Parameters:
data – A vector data cube.
projection – Coordinate reference system to reproject to. Specified as an [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html).
dimension – The name of the geometry dimension to reproject. If no specific dimension is specified, the filter applies to all geometry dimensions. Fails with a DimensionNotAvailable exception if the specified dimension does not exist.
- Return type:
- Returns:
A vector data cube with geometries projected to the new coordinate reference system. The reference system of the geometry dimension changes, all other dimensions and properties remain unchanged.
See also
openeo.org documentation on process “vector_reproject”.
- openeo.processes.vector_to_random_points(data, geometry_count=<object object>, total_count=<object object>, group=<object object>, seed=<object object>)[source]¶
Sample random points from geometries
- Parameters:
data – Input geometries for sample extraction.
geometry_count – The maximum number of points to compute per geometry. Points in the input geometries can be selected only once by the sampling.
total_count – The maximum number of points to compute overall. Throws a CountMismatch exception if the specified value is less than the provided number of geometries.
group – Specifies whether the sampled points should be grouped by input geometry (default) or be generated as independent points. * If the sampled points are grouped, the process generates a MultiPoint per geometry given which keeps the original identifier if present. * Otherwise, each sampled point is generated as a distinct Point geometry without identifier.
seed – A randomization seed to use for random sampling. If not given or null, no seed is used and results may differ on subsequent use.
- Return type:
- Returns:
Returns a vector data cube with the sampled points.
See also
openeo.org documentation on process “vector_to_random_points”.
- openeo.processes.vector_to_regular_points(data, distance, group=<object object>)[source]¶
Sample regular points from geometries
- Parameters:
data – Input geometries for sample extraction.
distance – Defines the minimum distance in meters that is required between two samples generated inside a single geometry. If the unit of the spatial reference system is not meters, a UnitMismatch error is thrown. Use
vector_reproject()
to convert the geometries to a suitable spatial reference system. - For polygons, the distance defines the cell sizes of a regular grid that starts at the upper-left bound of each polygon. The centroid of each cell is then a sample point. If the centroid is not enclosed in the polygon, no point is sampled. If no point can be sampled for the geometry at all, the first coordinate of the geometry is returned as point. - For lines (line strings), the sampling starts with a point at the first coordinate of the line and then walks along the line and samples a new point each time the distance to the previous point has been reached again. - For points, the point is returned as given.group – Specifies whether the sampled points should be grouped by input geometry (default) or be generated as independent points. * If the sampled points are grouped, the process generates a MultiPoint per geometry given which keeps the original identifier if present. * Otherwise, each sampled point is generated as a distinct Point geometry without identifier.
- Return type:
- Returns:
Returns a vector data cube with the sampled points.
See also
openeo.org documentation on process “vector_to_regular_points”.
- openeo.processes.xor(x, y)[source]¶
Logical XOR (exclusive or)
- Parameters:
x – A boolean value.
y – A boolean value.
- Return type:
- Returns:
Boolean result of the logical XOR.
See also
openeo.org documentation on process “xor”.
ProcessBuilder
helper class¶
- class openeo.processes.ProcessBuilder(pgnode)[source]¶
The
ProcessBuilder
class is a helper class that implements (much like the openEO process functions) each openEO process as a method. On top of that it also adds syntactic sugar to support Python operators as well (e.g.+
is translated to theadd
process).Attention
As normal user, you should never create a
ProcessBuilder
instance directly.You should only interact with this class inside a callback function/lambda while building a child callback process graph as discussed at Callback as a callable.
For example, let’s start from this simple usage snippet where we want to reduce the temporal dimension by taking the temporal mean of each timeseries:
def my_reducer(data): return data.mean() cube.reduce_dimension(reducer=my_reducer, dimension="t")
Note that this
my_reducer
function has adata
argument, which conceptually corresponds to an array of pixel values (along the temporal dimension). However, it’s important to understand that themy_reducer
function is actually not evaluated when you execute your process graph on an openEO back-end, e.g. as a batch jobs. Instead,my_reducer
is evaluated while building your process graph client-side (at the time you execute thatcube.reduce_dimension()
statement to be precise). This means that thatdata
argument is actually not a concrete array of EO data, but some kind of virtual placeholder, aProcessBuilder
instance, that keeps track of the operations you intend to do on the EO data.To make that more concrete, it helps to add type hints which will make it easier to discover what you can do with the argument (depending on which editor or IDE you are using):
from openeo.processes import ProcessBuilder def my_reducer(data: ProcessBuilder) -> ProcessBuilder: return data.mean() cube.reduce_dimension(reducer=my_reducer, dimension="t")
Because
ProcessBuilder
methods return newProcessBuilder
instances, and because it support syntactic sugar to use Python operators on it, and because openeo.process functions also accept and returnProcessBuilder
instances, we can mix methods, functions and operators in the callback function like this:from openeo.processes import ProcessBuilder, cos def my_reducer(data: ProcessBuilder) -> ProcessBuilder: return cos(data.mean()) + 1.23 cube.reduce_dimension(reducer=my_reducer, dimension="t")
or compactly, using an anonymous lambda expression:
from openeo.processes import cos cube.reduce_dimension( reducer=lambda data: cos(data.mean())) + 1.23, dimension="t" )