Specifies the DataObjects used in the operation as an array.
Specifies the per-pixel computation method.
Specifies the unit of the value after the operation.
Optionaldate?: DateIf the DataObject after the operation has a concept of date and time, specifies that date and time. If not specified, it becomes undefined.
OptionalformattedDate?: stringIf the DataObject after the operation has a concept of date and time, specifies the string representation of that date and time. If not specified, it becomes undefined.
// Convert data in Kelvin units to data in degC units
const dataObject2 = je.data.compute({
dataObjects: [dataObject],
operation: (value) => value - 273.15,
unit: "degC",
date: dataObject.data,
formattedDate: dataObject.formattedDate,
});
// Compute the anomaly from the observed value dataObject1 and the climatological normal value dataObject2
const anomaly = je.data.compute({
dataObjects: [dataObject1, dataObject2],
// Define the computation method between pixels (the arguments are in the same order as the dataObjects array)
operation: (value_of_dataObject1, value_of_dataObject2) => value_of_dataObject1 - value_of_dataObject2,
unit: "degC",
date: dataObject1.data,
formattedDate: dataObject1.formattedDate,
});
Performs an operation using multiple DataObjects and returns a new DataObject.