0

I am trying to combine MODIS products; MOD09GA (bands 1-7) and MODOCGA (bands 8-16) in order to look at the spectral signature (bands 1-16) at different points in my study area (a large lake).

The first issue I am having is that MODOCGA will not allow me to .select the bands I need. see below the MODO9 works fine, but the MODOC does not.

var MOD09 = ee.ImageCollection('MODIS/006/MOD09GA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b0[1-7]"]);

var MODOC = ee.ImageCollection('MODIS/006/MODOCGA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b[08-16]"]);

Once I have figured this out, I can try to combine the two collections so that I have a collection consisting of bands 1-16. If you have any ideas on that, they would also be very much appreciated!

4

2 回答 2

1

Does this work for you? Note that the matching image is stored in a property called 'match':

var MOD09 = ee.ImageCollection('MODIS/006/MOD09GA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b0[1-7]"]);

var MODOC = ee.ImageCollection('MODIS/006/MODOCGA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b(.*)"]);

var filter = ee.Filter.equals({
  leftField: 'system:index', 
  rightField: 'system:index', 
});

var join = ee.Join.saveFirst('match').apply({
  primary: MOD09, 
  secondary: MODOC, 
  condition: filter
});

print(join);
于 2017-08-07T16:42:37.293 回答
0

A much simple solution:

var MOD09 = ee.ImageCollection('MODIS/006/MOD09GA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b0[1-7]"]);

var MODOC = ee.ImageCollection('MODIS/006/MODOCGA')
           .filterDate('2016-08-20', '2016-09-30')
           .select(["sur_refl_b(.*)"]);

var pkgs = require('users/kongdd/public:pkgs.js');
// default combine by system:time_start
var imgcol_join = pkgs.InnerJoin(MOD09, MODOC).sort("system:time_start");
print(imgcol_join, 'imgcol_join');

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

于 2019-07-16T09:15:23.990 回答