Day-Of-Year (DOY) Charts

The methods that start with ui.Chart.image.doySeries aggregate the time series by day-of-year (DOY). The plots can be created as a DOY average, by year, or by region. The following example uses MODIS NDVI time series to illustrate different modes of DOY charting:

// Define a FeatureCollection: three regions of the American West.
var city = ee.Feature(    // San Francisco.
    ee.Geometry.Rectangle(-122.42, 37.78, -122.4, 37.8), {label: 'City'});
var forest = ee.Feature(  // Tahoe National Forest.
    ee.Geometry.Rectangle(-121, 39.4, -120.99, 39.45), {label: 'Forest'});
var desert = ee.Feature(  // Black Rock Desert.
    ee.Geometry.Rectangle(-119.02, 40.95, -119, 41), {label: 'Desert'});

var regions = new ee.FeatureCollection([city, forest, desert]);

// Load several years of MODIS NDVI data.
var collection = ee.ImageCollection('MODIS/MCD43A4_NDVI')
    .filterDate(ee.Date('2011-01-01'), ee.Date('2014-12-31'));

// Define a chart with one series in the forest region, averaged by DOY.
var series1 = ui.Chart.image.doySeries(
    collection, forest, ee.Reducer.mean(), 500);

// Define a chart with a a different series for each year in the forest region.
var series2 = ui.Chart.image.doySeriesByYear(
    collection, 'NDVI', forest, ee.Reducer.mean(), 500);

// Define a chart with different series for each region, averaged by DOY.
var series3 = ui.Chart.image.doySeriesByRegion(
    collection, 'NDVI', regions, ee.Reducer.mean(), 500, ee.Reducer.mean(), 'label');

// Display the three charts.
print(series1, series2, series3);
    

The results should look something like Figure 1. The top chart in Figure 1 represents the mean NDVI time series by DOY. The middle chart plots a different series for each year in the input imagery. The bottom chart plots a different series for each region in the input. Observe that a band name to plot needs to be specified in ui.Chart.image.doySeriesByYear() and ui.Chart.image.doySeriesByRegion(). The property of the features (label) that distinguishes different regions needs to be specified when using ui.Chart.image.doySeriesByRegion(). In all cases, the examples use the default ee.Reducer.mean() to aggregate temporally (by DOY) and spatially (by region).

ui.Chart.image.doySeries
Figure 1. NDVI time series aggregated by DOY. Top: aggregated by DOY in one region (forest), middle: for one region (forest), by each year in the input, bottom: by each region in the input.

Send feedback about...

Google Earth Engine API