I have been able to display NDVI value in my project but I need some single certain band reflectance value for my data. I have tried in showing blue band (B2) but when I check the inspector tab, the number represent DN and not reflectance.
How do I display single band reflectance value in earth engine? Been searching and did not find the answer yet.
Below is my script:
var sentinelns = ee.ImageCollection('COPERNICUS/S2_SR')
.filterDate('2019-01-01', '2019-12-30')
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 95))
.map(maskS2clouds)
.median()
.clip(geometry);
function maskS2clouds(image) {
var qa = image.select('QA60');
var cloudBitMask = 1 << 10;
var cirrusBitMask = 1 << 11;
var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
.and(qa.bitwiseAnd(cirrusBitMask).eq(0));
return image.updateMask(mask).divide(1);
}
var SingleBandBlue = sentinelns.select(['B2']);
var BlueParam = { min: 0, max: 1000,};
Map.addLayer(SingleBandBlue, BlueParam, 'Sentinel B2');