I tried the following code snippet to resample high-resolution data to a lower resolution. The first method works, but the second one doesn’t. It seems I missed some parameters for the “to
” keyword in the resample
function.
begin
lon1,lat1 = X(-179.5:0.1:179.5), Y(-89.5:0.1:89.5)
var1 = Raster(rand(lon1, lat1), crs=EPSG(4326))
lon2,lat2 = X(-179.5:1:179.5), Y(-89.5:1:89.5)
#first method
ref = Raster(rand(lon2, lat2))
var2 = resample(var1; to=ref, crs=EPSG(4326), method="average")
#second method
var3 = resample(var1; to=(X=lon2,Y=lat2), crs=EPSG(4326), method="average")
end