I am creating a code to automate the process of downloading point-based reflectance data tables that comes from a JSON file. The code is almost ready and I can reduce and export a table containing the reflectance data per band at each point. The problem is that I'm generating a table with all the reflectance values for each point I've created for all available dates in the time interval between points. I need to generate a table with only data referring to the date the point was created.
Any idea how to do this?
This is the code working so far: Code here
var ict = ee.Dictionary({RAWJSONDATA})
var feats = ee.FeatureCollection(ee.List(dict.get('pings')).map(function(feat){
feat = ee.Dictionary(feat);
var geom = ee.Geometry.Point([ee.Number.parse(feat.get('longitude')), ee.Number.parse(feat.get('latitude'))]);
var getDate = ee.String(feat.get('datetime'));
var systemDate = ee.Date.parse("dd MMM YYYY hh:mm:ss aa", getDate).millis();
return ee.Feature(geom, ee.Dictionary(feat)).set('system:time_start', systemDate);
}));
feats = ee.FeatureCollection(feats.setMulti(dict));
print(feats);
var rrs = ee.ImageCollection("NASA/OCEANDATA/MODIS-Aqua/L3SMI")
.filterDate('2018-2-22','2018-2-24') //HOW DO I FILTER WITH THE "systemDate" ??
.select('Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555');
var reduceR = function(image) {
var reducedVal = image.reduceRegions({
collection: feats,
reducer: ee.Reducer.first(),
});
return reducedVal;
};
var mRrs = rrs.map(reduceR);
mRrs = ee.FeatureCollection(mRrs).flatten();
Export.table.toDrive({
collection: mRrs,
description: 'aaaagoraaa',
fileNamePrefix: 'vaiii',
fileFormat: 'CSV',
selectors: ('Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555'),
});