Из-за моего краткого объяснения я редактирую этот вопрос в 2020/01/20. Извините за ответчик оригинала.
Я хочу значение отражающей способности TOA для определенной c полосы широты / долготы. Я мог сделать это с помощью javascript по приведенному ниже коду, но я не мог сделать то же самое с python. Я был бы рад вашей будущей помощи.
var start = '2018-01-01'
var end = '2018-01-16'
var lon = 134.01
var lat = 34.04
var p = ee.Geometry.Point(lon, lat)
var imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterDate(start, end)
.filterBounds(p)
var im1 = imageCollection
.first()
var image = ee.Image(im1);
// Extract the data
var data_b1 = im1.select("B1").reduceRegion(ee.Reducer.mean(),p,10).get("B1")
print('B1 T1_TOA: ', data_b1)
Javascript - это коэффициент отражения TOA:
B1 T1_TOA:
0.25892749428749084
Но при Python он не работает хорошо. Выходные данные - это ComputedObject, но они не содержат значения отражательной способности TOA.
import ee
ee.Initialize()
start = '2018-01-01'
end = '2018-01-16'
lon = 134.01
lat = 34.04
p = ee.Geometry.Point([lon, lat])
imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA').filterDate(start, end).filterBounds(p)
im1 = imageCollection.first()
data_b1 = im1.select("B1").reduceRegion(ee.Reducer.mean(),p,10).get("B1")
print(data_b1)
Выходные данные ниже json, не включая значение отражательной способности TOA "0.25892749428749084":
ee.ComputedObject({
"type": "Invocation",
"arguments": {
"dictionary": {
"type": "Invocation",
"arguments": {
"image": {
"type": "Invocation",
"arguments": {
"input": {
"type": "Invocation",
"arguments": {
"collection": {
"type": "Invocation",
"arguments": {
"collection": {
"type": "Invocation",
"arguments": {
"collection": {
"type": "Invocation",
"arguments": {
"id": "LANDSAT/LC08/C01/T1_TOA"
},
"functionName": "ImageCollection.load"
},
"filter": {
"type": "Invocation",
"arguments": {
"rightField": "system:time_start",
"leftValue": {
"type": "Invocation",
"arguments": {
"start": "2018-01-01",
"end": "2018-01-16"
},
"functionName": "DateRange"
}
},
"functionName": "Filter.dateRangeContains"
}
},
"functionName": "Collection.filter"
},
"filter": {
"type": "Invocation",
"arguments": {
"leftField": ".all",
"rightValue": {
"type": "Invocation",
"arguments": {
"geometry": {
"type": "Point",
"coordinates": [
134.01,
34.04
]
}
},
"functionName": "Feature"
}
},
"functionName": "Filter.intersects"
}
},
"functionName": "Collection.filter"
}
},
"functionName": "Collection.first"
},
"bandSelectors": [
"B1"
]
},
"functionName": "Image.select"
},
"reducer": {
"type": "Invocation",
"arguments": {},
"functionName": "Reducer.mean"
},
"geometry": {
"type": "Point",
"coordinates": [
134.01,
34.04
]
},
"scale": 10
},
"functionName": "Image.reduceRegion"
},
"key": "B1"
},
"functionName": "Dictionary.get"
})