Google Earth Engine PROBA-V NDVI – How to Download Yearly Median Data

exportgoogle-earth-enginendviproba-v

Using Google Earth Engine (GEE), I am trying to download yearly median NDVI data from PROBA-V. The output image has range 20-145.5.

ndvi

From here, it says:

The reflectances provided in this dataset are presented as Digital
Count Numbers (DN) and must be converted according to the guidelines
in Section 4.6.1 of the user manual.

According to the user manual, the equation to convert the DN to reflectance is:

PV = (DN – OFFSET) / SCALE

where:

table DN to reflectance

From my code, it seems that I am doing wrong the equation because I am getting an error: Line 25: median1.reproject is not a function

Here is the code:

var table = ee.FeatureCollection("users/nikostziokas/tehran_54009");

var dataset = ee.ImageCollection('VITO/PROBAV/C1/S1_TOC_100M')
                  .filter(ee.Filter.date('2018-01-01', '2018-12-31'))
                  .select('NDVI');
                  
var median1 = dataset.select('NDVI').reduce(ee.Reducer.median()).clip(table);

var median1 = (median1 - 20.0)/250.0;
                  
// Project the image to Mollweide.
var wkt = ' \
  PROJCS["World_Mollweide", \
    GEOGCS["GCS_WGS_1984", \
      DATUM["WGS_1984", \
        SPHEROID["WGS_1984",6378137,298.257223563]], \
      PRIMEM["Greenwich",0], \
      UNIT["Degree",0.017453292519943295]], \
    PROJECTION["Mollweide"], \
    PARAMETER["False_Easting",0], \
    PARAMETER["False_Northing",0], \
    PARAMETER["Central_Meridian",0], \
    UNIT["Meter",1], \
    AUTHORITY["EPSG","54009"]]';

var proj_mollweide = ee.Projection(wkt);
var image_mollweide = median1.reproject({
  crs: proj_mollweide,
  scale: 100
});

Export.image.toDrive({
image: image_mollweide,
description: 'ndvi',
scale: 100, //100 for Band10
maxPixels: 1000000000000,
region: table,
folder: 'Landsat-5'});

Best Answer

You cannot do client-side operations on server-side objects like an image. You can read up on it here. Something like this would do it:

var median1 = dataset.select('NDVI').reduce(ee.Reducer.median()).clip(table)
  .subtract(20).divide(250)
           

https://code.earthengine.google.com/c9a40dab0a2bf698b5b7729937612c5f

Related Question