I am trying to download yearly median Landsat 5. Specifically, I am interested in the thermal band (Band 6) and the spectral index called EBBI (formula in the code below).
My initial try, so far is (link to the code I am using) by downloading each month of the year and then calculate the yearly image outside of Google Earth Engine (GEE)
, in a GIS software. But this takes a huge amount of time and the end shows an error that there are no bands.
How can I export yearly median Landsat 5 images (Thermal and EBBI) in a more efficient way? By efficient I mean something similar to the code I am using to download Landsat 8. As you can see in the code for Landsat 8, all I have to change in order to compute a median monthly image or a median yearly image is to change the range in var landsat = landsat.filter(ee.Filter.calendarRange(1,1,'month'))
to var landsat = landsat.filter(ee.Filter.calendarRange(1,12,'month'))
. And the year of course.
I would like create a similar code for Landsat 5. I have tried to do it but I am getting errors, depending to what parameters I am changing in the Landsat 5 code.
Best Answer
A complete code to download median monthly (or yearly, check the comments) Landsat 5 (surface reflectance, collection 1):