I have used this code https://www.gears-lab.com/intro_rs_lab8/ in order to learn and practice my SAR-1 skills. I have created an almost similar code, but few things are not clear to me regard this code. In the end of the code, I am supposed to display in RGB 3 different layers. How does it work? I get only one image, so what is the meaning of display each one of them as RGB in one image?
- When I use the inspector in order to check the values I gave in the RGB stack (seasonal stack) I have "layer" that not suppose to be there- VV. That confuses me even more- why don't I get the 3 layers I stack together? (vv1,vv2, and vv3)
I would say this relates to the first question. of how it displays 3 images as 3 different band in one image.
This is the code I used, it has error with the VH for a reason I don't know yet
var geometry=geometry2;
// Filter the collection for the VV product from the descending track
var collectionVV = ee.ImageCollection('COPERNICUS/S1_GRD')
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
.filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
.filterBounds(geometry)
.select(['VV']);
print(collectionVV);
// Filter the collection for the VH product from the descending track
var collectionVH = ee.ImageCollection('COPERNICUS/S1_GRD')
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
.filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
.filterBounds(geometry)
.select(['VH']);
print(collectionVH);
Map.centerObject(geometry);
var clippedVV=collectionVV.map(function(im){
return im.clip(geometry);
});
var clippedVH=collectionVH.map(function(im){
return im.clip(geometry);
});
var VV = clippedVV.median();
var VH= clippedVH.median();
// Adding the VV layer to the map
//Map.addLayer(VV, {min: -30, max: -1}, 'VV');
//Map.addLayer(VH,{min:-30, max:-1}, 'VH');
// Create a 3 band stack by selecting from different periods (months) for VV
var VV1 = ee.Image(clippedVV.filterDate('2017-10-01', '2017-11-30').median());
var VV2 = ee.Image(clippedVV.filterDate('2017-12-01', '2018-12-31').median());
var VV3 = ee.Image(clippedVV.filterDate('2019-01-01', '2019-02-28').median());
// Create a 3 band stack by selecting from different periods (months) for VH
var VH1 = ee.Image(clippedVH.filterDate('2017-10-01', '2017-11-30').median());
var VH2 = ee.Image(clippedVH.filterDate('2017-12-01', '2018-12-31').median());
var VH3 = ee.Image(clippedVH.filterDate('2019-01-01', '2018-02-28').median());
//Add to map
Map.addLayer(VV1.addBands(VV2).addBands(VV3), {min: -30, max: -1}, 'Season compositeVV');
Map.addLayer(VH1.addBands(VH2).addBands(VH3), {min: -30, max: -1}, 'Season compositeVH');
Map.addLayer(VV1,{min:-30,max:-1},'Season composite inly vv1');
Map.addLayer(VV2,{min:-30,max:-1},'Season composite inly vv2');
Map.addLayer(VV3,{min:-30,max:-1},'Season composite inly vv3');