# Image math (reduction) within image collection

I want to generate monthly average Sentinel-1 images in GEE and adapted this answer here to get 12 mean radar images over a year. However, as radar imagery in GEE is in decibel, this returns the geometric mean and not the arithmetic mean. I have been able to convert a single decibel image to power using the equation:

``````var PWR = ee.Image(10).pow(image.select('VH').divide(10))
``````

but I do not know how to implement this over each image in a collection prior to calculating the monthly average. Is it possible to calculate this when generating an image collection?

My code is:

``````var sentinel1 = ee.ImageCollection("COPERNICUS/S1_GRD");

var months = ee.List.sequence(1, 12);

var byMonth = ee.ImageCollection.fromImages(
months.map(function (m) {
return sentinel1
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filterBounds(geometry)
.filterDate('2017-01-01','2017-12-31')
.filter(ee.Filter.calendarRange(m, m, 'month'))
.select('VH')
.mean()
.set('month', m);
}));
``````

and a working example can be found here

You would need to map a function over the entire Sentinel-1 collection to apply the power calculation to each image. Here is an example:

``````var geometry = ee.Geometry.Point([-122,37.5])

// apply all of the filtering up front to prevent processing on large image collection
var sentinel1 = ee.ImageCollection("COPERNICUS/S1_GRD")
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filterBounds(geometry)
.filterDate('2017-01-01','2017-12-31');

// converting decibels to power for the VH polarization
var power = sentinel1.map(function(image){
return ee.Image(10).pow(image.select('VH').divide(10))
.rename('VH') // rename band
.copyProperties(image,['system:time_start']); // copy time property for later
});

// months to map over
var months = ee.List.sequence(1,12);

var byMonth = ee.ImageCollection.fromImages(
months.map(function (m) {
return power // using the calculated power images instead of decibel
.filter(ee.Filter.calendarRange(m, m, 'month')) // get the month of interest
.select('VH')
.mean() // mean composite
.set('month', m);
}));
print(byMonth);

• There were a couple pieces missing in my first response. I updated the answer to be correct and run as is. Basically, when you do some band math in EE it drops all of the properties and you would need to copy the `system:time_start` property to time filter when calculating the composites. Hopefully this answer is a better for your needs. Nov 20, 2019 at 15:42