I want to create a time-series of Sentinel-2 images that cover my entire study area (instead of individual tiles, since the study area spans 2 tiles). I mosaicked the image collection by day using the following function (where S2 is the Sentinel-2 image collection):
function mosaicByDate(collection){
var imagelist = S2.toList(S2.size())
var unique_dates = imagelist.map(function(image){
return ee.Image(image).date().format("YYYY-MM-dd")
}).distinct()
var imagelist_mosaic = unique_dates.map(function(d){
d = ee.Date(d)
var image = collection
.filterDate(d, d.advance(1, "day"))
.mosaic()
return image.set(
"system:time_start", d.millis(),
"system:id", d.format("YYYY-MM-dd")).copyProperties(image, image.propertyNames())
})
return ee.ImageCollection(imagelist_mosaic)
}
var S2_mosaic = mosaicByDate(S2)
The function works perfectly, but since there are some days where only one of the tiles is acquired (so there is no mosaicking), the time-series of images shows only half the study area for these dates. I created a filmstrip to show what this looks like.
I now would like to remove the image dates for which there is only one tile... anyone have a suggestion how do this? Unfortunately it is not consistantly every other image, there are subsequent one-tile dates as well. The image below corresponds to the imagedates of the filmstrip shown above.