I am trying to classify paddy areas from time-series(in this case, four-date) Sentinel 1 image in both VH and VV polarization. Hence prior to classification, I need to mask out land covers such as urban and water areas. I plotted the temporal profile of the backscattering coefficient for these land covers and it was found to be -20 DB for water areas in VH polarization. What I tried to do is to mask out water and urban areas from the image collection using the below code.
var watermask = function(img) {
var excludewater = img.gt(-20); //Identify all pixels below threshold and set them equal to 1. All other pixels set to 0
excludewater = excludewater.updateMask(excludewater); //Remove all pixels equal to 0
return(excludewater); //Return image
};
var S1 = vh.map(watermask);// vh is the imagecollection of four images corresponding to four dates in VH polarization
print(S1,'S1');
var mergeBandsS1 = function(image, previous) {
return ee.Image(previous).addBands(image, ['VH', 'VH', 'VH','VH']);
};
var mergedS1 = ee.Image(S1.iterate(mergeBandsS1, ee.Image([])));//create a stacked image from the imagecollection S1 inorder to plot the temporal graph of various landcovers
print(mergedS1,'mergedS1');
// Define customization options.
var optionsvh = {
title: 'Time Series VH plot',
hAxis: {title: 'Date (YYYY/MM/DD)'},
vAxis: {title: 'Backscatter coefficient Sigma0_VH (dB)'},
lineWidth: 2,
pointSize: 4,
fontSize:20,
series: {
0: {color: '970F0F'},
1: {color: 'FF0000'},
2: {color: 'F68244'},
3: {color: '1230D8'},
}};
// Define a list of dates for X-axis labels.
var datesvh = ['2018/11/01','2018/12/07','2019/01/12','2019/02/05'];
// Create the chart and set options.
var spectraChartvh = ui.Chart.image.regions(
mergedS1, fromList, ee.Reducer.mean(), 30,'name', datesvh)//fromList is the featurecollection of various landcovers, name is the label given to the landcovers
.setChartType('ScatterChart')
.setOptions(optionsvh);
print(spectraChartvh);
While plotting this am getting the below image which I couldn't interpret. What should I do to mask out water landcover from this data?