Replies: 1 comment 2 replies
-
I changed an image set : LANDSAT/LC08/C01/T1, but why LANDSAT/LC08/C01/T1_SR doesn't work? Another question, I want to calculate how many images collected from each month. When I use imageCollection.size(), but it doesn't show the number of image but list of properties. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear professor,
I want to calculate monthly NDVI, but I got the error messages:
ImageCollection.reduce: Error in map(ID=LC08_001005_20150324):
Landsat.TOA: Image is not a Landsat scene or is missing SENSOR_ID metadata. Could you kindly help me and give me advice how to solve it? Thank you in advance!
Load landsat image
imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate('2000-10-01', '2020-12-31')
months = ee.List.sequence(1, 12)
function to return NDVI monthly
def func_blw(m):
filtered = imageCollection.filter(ee.Filter.calendarRange(**{
'start': m,
'field': 'month'
}))
composite = ee.Algorithms.Landsat.simpleComposite(filtered)
return composite.normalizedDifference(['B4', 'B3']).rename('NDVI')
.set('month', m)
composites = ee.ImageCollection.fromImages(months.map(func_blw))
check = ee.Image(composites.first())
ndviViz = {'min': 0.5, 'max': 1, 'palette': ['eaff00', 'aeff00', '59ff00', '00ff04', '5ac773', '64e366', '00FF00']}
Map.addLayer(check, ndviViz, 'check')
Best!
Beta Was this translation helpful? Give feedback.
All reactions