To obtain the desired output you need to add an additional property to your images that indicates the day of acquisition regardless of the year. Then, you can use that property to filter your image collection and reduce them with a particular function. In the following code I added two possible options to do this. Although you want to mosaic all the images of the same day, it might be difficult to obtain several images for a particular date; thus, I also added an option to make mosaics using a time window.
var collection = ee.ImageCollection('COPERNICUS/S1_GRD')
.filterDate(start, finish)
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filterMetadata('resolution_meters', 'equals', 10)
.filterBounds(poly)
// Add number of day as property
.map(function(image){
// Get number of day from start of year
var day = ee.Number.parse(ee.Date(image.get('system:time_start')).format('D'));
// Set as additional property
return image.set('day', day);
});
// Option A: for the exact same day
var days = collection.aggregate_array('day').distinct().sort();
print('days',days);
var dayMosaic = ee.ImageCollection.fromImages(days.map(function(day){
var resul = collection.filter(ee.Filter.eq('day', day))
// Use a reducer to define how to calculate areas
// that overlap. Here I used mean
.mean()
.set('day', day);
return resul;
}));
Map.centerObject(poly, 9);
// Add first image to the map
Map.addLayer(dayMosaic.first(),
{bands: ['VH','VV','VH'],min:-35, max: -1},
'dayMosaic first');
// Option B: ror a range of dates. Here I use a window of 30 days before each date
var dayStep = 30;
var days2 = ee.List.sequence(dayStep,366,dayStep);
print('days2',days2);
var dayMosaicRange = ee.ImageCollection.fromImages(days2.map(function(day){
var resul = collection.filter(ee.Filter.and(
ee.Filter.gte('day',ee.Number(day).subtract(ee.Number(dayStep))),
ee.Filter.lt('day',ee.Number(day))))
// Use a reducer to define how to calculate areas
// that overlap. Here I used mean
.mean()
.set('day', day);
return resul;
}));
// Add first image to the map
Map.addLayer(dayMosaicRange.first(),
{bands: ['VH','VV','VH'],min:-35, max: -1},
'dayMosaic range first');