Create a script in Google Earth Engine that: - generates the annual sum of precipitation…
- User
Create a script in Google Earth Engine that:
- generates the annual sum of precipitation (var PR) from 1984 to 2014;
- generates the annual sum of evapotranspiration (var ET) from 1984 to 2014;
- Subtracts the sum of precipitation from the sum of evapotranspiration for each year; - generate an anomaly plot for "var geometry" print the result Here is the sample script: var geometry = /* color: #d63000 */ee.Geometry.MultiPoint( [[-44.671528999364156, -12.788129085766558], [-45.37481049040418, -10.149071093618426], [-46.73711517790418, -10.149071093618426], [-46.25371674040418, -11.874448615161938], [-45.28691986540418, -15.291181282219565]])
// Defines the scaling factor
var offset = 225//Precipitation var scale = 0.006866665//Precipitation
//var offset = 0//evapotranspiration //var scale = 0.051181102//evapotranspiration
//var offset = 15//maximum temperature //var scale = 0.001068148//maximum temperature
//var offset = 15//minimum temperature //var scale = 0.001068148//minimum temperature
//var offset = 0//Relative humidity //var scale = 0.393700787//Relative humidity
//var offset = 0//Solar radiation //var scale = 0.157086614//Solar radiation
//var offset = 0//Wind speed //var scale = 0.059055118//Wind speed
var ET = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/ET"); var PR = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/PR"); var RH = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/RH"); var RS = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/RS"); var TMAX = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/TMAX"); var TMIN = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/TMIN"); var U2 = ee.ImageCollection("projects/sat-io/open-datasets/BR-DWGD/U2"); var RAIN_GAUGES = ee.FeatureCollection("projects/sat-io/open-datasets/BR-DWGD/RAIN_GAUGES"); var WEATHER_STATIONS = ee.FeatureCollection("projects/sat-io/open-datasets/BR-DWGD/WEATHER_STATIONS");
var mask = ee.Image(1).clip(geometry3); // Placeholder for masking if necessary
var scaleBand = function(img) { var scaledImage = img.select("b1").multiply(scale).add(offset) .updateMask(mask); return scaledImage.rename('ET').set('system:time_start', img.get('system:time_start')) .set('anomes', ee.Number.parse(img.date().format("YYYYMM")).toInt()) .set('day', ee.Number.parse(img.date().format("YYYYMMdd")).toInt()); };
- Assistant
- User
Substitua o loop usando "for" por função e corrija o erro : Error generating chart: Data column(s) for axis #0 cannot be of type string
- Assistant
- User
A série temporal deve ser de 1984 até 2024. Corrija o erro: Error generating chart: Data column(s) for axis #0 cannot be of type string
- Assistant
- User
corrija os erros: Anomaly Feature Collection: FeatureCollection (Error) Image.subtract: If one image has no bands, the other must also have no bands. Got 0 and 1. Error generating chart: Image.subtract: If one image has no bands, the other must also have no bands. Got 0 and 1. Image.subtract: If one image has no bands, the other must also have no bands. Got 0 and 1.
- Assistant
- User
Avalie se o resultado da var calculateAnomalies não deve retornar uma ee.Image e anomalyFC gerar uma imagecollection para que só então o gráfico possa extrair as informações dos dados raster.
- Assistant