I am working with MODIS-NDVI data (MODIS/006/MOD13Q1) in Google Earth Engine. I have a script which exports each image in the image collection for given area and time period. I need to upgrade script which will composite band by years to have a single file for each year. Later, I need to export them Google Drive. Could anyone please assist me on upgrading below shown code?
var col = ee.ImageCollection("MODIS/006/MOD13Q1")
.select("NDVI")
.filterDate("2000-01-01","2018-06-01");
var ExportCol = function(col, folder, scale, type,
nimg, maxPixels, region) {
type = type || "float";
nimg = nimg || 500;
var colList = col.toList(nimg);
var n = colList.size().getInfo();
for (var i = 0; i < n; i++) {
var img = ee.Image(colList.get(i));
var id = img.id().getInfo();
var imgtype = {"float":img.toFloat(),
"byte":img.toByte(),
"int":img.toInt(),
"double":img.toDouble()
}
Export.image.toDrive({
image:imgtype[type],
description: id,
folder: folder,
fileNamePrefix: id,
region: studyarea2,
scale: scale,
maxPixels: maxPixels})
}
}
ExportCol(col, "NDVI_MODIS_NKz_KZ", 250);