I am trying to calculate the NDVI using the Google Earth engine. my area of interest is not covered in one scene so I need to mosaic the required bands. but the mosaic function does not work when I define a specific date although it seems to work without a date.
here is a link to my code:
https://code.earthengine.google.com/a464f6f1f43748ee42721c2447141615
here is my code:
var image = l8.filterBounds(table)
.filterMetadata('CLOUD_COVER','less_than',1)
.filterDate('2023-05-1','2023-08-30');
var RED = image.select('B4');
var NIR = image.select('B5');
var mosaic_red = RED.mosaic();
var mosaic_nir = NIR.mosaic();
var NDVI = mosaic_nir.subtract(mosaic_red).divide(mosaic_nir.add(mosaic_red));
Map.addLayer(NDVI);
Map.centerObject(table,8);