I am beginner with Google Earth Engine programming. I want to know how I can use MOD16A2 to extract good quality values of potential evapotranspiration data (MOD16A2)? because I extract the PET of MOD16A2 and I compared with PET calculated by FAO56 PM, I find the bug difference between this parameters. My study area is agricultural area.
This is my code :
//Load the dataset
var dataset = ee.ImageCollection("MODIS/006/MOD16A2")
.filter(ee.Filter.calendarRange(2001,2020, 'year'))
.filterBounds(aoi);// aoi= study area
var PET = dataset.map(function(img){
var PETmm = img.select('PET')
.multiply(0.1);
return PETmm;
});
print('8day potentiel evapotranspiration in image collection',PET);
print(PET.size());
print(aoi.size());
print(PET.toBands());
// reduce the ImageCollection to singleimage with multiple band
function imageCollectionToBands(imageCollection) {
// put all images in 1 image with multiple bband
var img = imageCollection.toBands();
// Rename bandnames
var names = img.bandNames();
var newNames = names.map(function(name){
var ind = names.indexOf(name);
return ee.String(names.get(ind)).slice(0,10);
});
return img.rename(newNames);
}
var imagePet= imageCollectionToBands(PET)
.where(imageCollectionToBands(PET).gt(100),ee.Image.constant(0));
print('8day PET', imagePet);
var marocPet = imagePet
.reduceRegions({
collection: aoi.select(['Nom_Locali']),
reducer: ee.Reducer.mean(),
scale: 1000
});
print('Feature collection of PET', marocPet);
// Save Value in google_drive
Export.table.toDrive({
collection: marocPet.select(['.*'],null,false),
description: 'PETStations',
fileNamePrefix: 'PET_Stations',
folder : "GoogleEarthEngine Data",
fileFormat: 'CSV'
});