0

I have a lat lon - 23.14, 83.14 and I need to download the NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) data from the below website only for this lat lon. I am looking to download the Tmax.

https://developers.google.com/earth-engine/datasets/catalog/NASA_NEX-DCP30_ENSEMBLE_STATS

I have not worked with Earth Engine before.

How do I go about extract and saving the daily time series of Tmax for this particular lat lon?

1 Answer 1

2

@jdbcode has a very nice implementation to extract the time series. However, there are 26 images per day for the different climate models that are used. The reduction is only giving you one climate model (and don't know which one). Here is an example to extract the tasmax data for all climate models over you area of interest.

// specify start and end date
var startDate = ee.Date('1990-01-01');
var endDate = ee.Date('1991-01-01');

// get the dataset between date range and extract band on interest
var dataset = ee.ImageCollection('NASA/NEX-GDDP')
                  .filter(ee.Filter.date(startDate,endDate));
var maximumAirTemperature = dataset.select('tasmax');

// get projection information
var proj = maximumAirTemperature.first().projection();

var point = ee.Geometry.Point([-23.14, 83.14]);

// calculate number of days to map and extract data for
var n = endDate.difference(startDate,'day').subtract(1);

// map over each date and extract all climate model values
var timeseries = ee.FeatureCollection(
  ee.List.sequence(0,n).map(function(i){
    var t1 = startDate.advance(i,'day');
    var t2 = t1.advance(1,'day');
    var feature = ee.Feature(point);
    var dailyColl = maximumAirTemperature.filterDate(t1, t2);
    var dailyImg = dailyColl.toBands();
    // rename bands to handle different names by date
    var bands = dailyImg.bandNames();
    var renamed = bands.map(function(b){
      var split = ee.String(b).split('_');
      return ee.String(split.get(0)).cat('_').cat(ee.String(split.get(1)));
    });
    // extract the data for the day and add time information
    var dict = dailyImg.rename(renamed).reduceRegion({
      reducer: ee.Reducer.mean(),
      geometry: point,
      scale: proj.nominalScale()
    }).combine(
      ee.Dictionary({'system:time_start':t1.millis(),'isodate':t1.format('YYYY-MM-dd')})
    );
    return ee.Feature(point,dict);
  })
);
print(timeseries);

// get properties to chart (all climate models)
var props = timeseries.first().propertyNames().removeAll(['system:time_start','system:index','isodate']);

// Make a chart of the results.
var chart = ui.Chart.feature.byFeature(timeseries, 'system:time_start', props.getInfo());
print(chart);

Map.addLayer(point);
Map.centerObject(point,6);

// export feature collection to CSV
Export.table.toDrive({
  collection: timeseries,
  description: 'NEX-GDDP-timeseries',
  fileFormat: 'CSV',
});

Code link: https://code.earthengine.google.com/b0303657856fd0434385b3dfe298ed1b

Keep in mind that beginning of 2006 the NEX-GDDP data switches from historic data to climate forecasts with 42 bands per day (21 climate models with 2 scenarios). So, the bands name change which will affect the export columns. You will probably have to export up to 2006 for historic then export again after 2006....

6
  • Okay. Thank you very much for your reply. I wondered where the csv file gets stored by default. I cannot seem to find it in my local machine.
    – 89_Simple
    Nov 19, 2019 at 23:46
  • @89_Simple - the data gets saved to the Google Drive account associated with the account you run the Earth Engine script from. Based the above script, the file will be called NEX-GDDP-timeseries.csv and can be found in the main folder. Nov 20, 2019 at 1:11
  • @89_Simple - you should accept this as the answer, I'll delete mine. As Kel pointed out this data set includes data derived from a number of models, mine assumes a single model. Nov 20, 2019 at 1:15
  • @jbdcode Thank you. I accepted the answer.
    – 89_Simple
    Nov 20, 2019 at 11:14
  • By any chance, is there any way I can specify which GCM I want to download the data for. At the moment, the file becomes too big so I would find it useful to specify a single GCM in the above code.
    – 89_Simple
    Nov 20, 2019 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.