如何使用 Amazon S3 下载 Landsat 8 图像
How to download Landsat 8 images using Amazon S3
我实现了 Automated Bulk Downloads of Landsat-8 Data Products in Python | Geology and Python 教程中的 python 代码。
还可以,但是我想在date.I的基础上取回数据,还改了一些代码试了没成功
bulk_list = []
# Iterate through paths and rows
for path, row in zip(paths, rows):
print('Path:',path, 'Row:', row)
# Filter the Landsat Amazon S3 table for images matching path, row, cloudcover and processing state.
scenes = s3_scenes[(s3_scenes.path == path) & (s3_scenes.row == row) &
(s3_scenes.cloudCover <= 15) &
(s3_scenes.acquisitionDate='2019-04-22')
(~s3_scenes.productId.str.contains('_T2')) &
(~s3_scenes.productId.str.contains('_RT'))]
print(' Found {} images\n'.format(len(scenes)))
# If any scenes exists, select the one that have the minimum cloudCover.
if len(scenes):
scene = scenes.sort_values('acquisitionDate').iloc[0]
# Add the selected scene to the bulk download list.
bulk_list.append(scene)
但它抛出一个错误:
File "<ipython-input-37-ec27c752ae7e>", line 11
(s3_scenes.acquisitionDate='2019-04-22')
^
SyntaxError: invalid syntax
我知道日期格式有问题但无法解决。
还请向我推荐一些关于 AWS on Landsat 8 图像的好教程。
当我打印批量列表时
bulk_list
[productId LC08_L1TP_152042_20190422_20190507_01_T1
entityId LC81520422019112LGN00
acquisitionDate 2019-04-22 05:56:08.442691
cloudCover 0
processingLevel L1TP
path 152
row 42
min_lat 24.9171
min_lon 66.742
max_lat 27.0339
max_lon 69.0604
download_url https://s3-us-west-2.amazonaws.com/landsat-pds...
Name: 1520154, dtype: object]
甚至在我使用 (s3_scenes.acquisitionDate='2019-04-22 05:56:08.442691')
之后结果仍然相同
我觉得日期格式应该是YYYYMMDD
有关详细信息,请参阅 amazon
或简单地使用 s3_scenes.productId.str.contains('20190422')
你忘记了语句末尾的 &
我实现了 Automated Bulk Downloads of Landsat-8 Data Products in Python | Geology and Python 教程中的 python 代码。
还可以,但是我想在date.I的基础上取回数据,还改了一些代码试了没成功
bulk_list = []
# Iterate through paths and rows
for path, row in zip(paths, rows):
print('Path:',path, 'Row:', row)
# Filter the Landsat Amazon S3 table for images matching path, row, cloudcover and processing state.
scenes = s3_scenes[(s3_scenes.path == path) & (s3_scenes.row == row) &
(s3_scenes.cloudCover <= 15) &
(s3_scenes.acquisitionDate='2019-04-22')
(~s3_scenes.productId.str.contains('_T2')) &
(~s3_scenes.productId.str.contains('_RT'))]
print(' Found {} images\n'.format(len(scenes)))
# If any scenes exists, select the one that have the minimum cloudCover.
if len(scenes):
scene = scenes.sort_values('acquisitionDate').iloc[0]
# Add the selected scene to the bulk download list.
bulk_list.append(scene)
但它抛出一个错误:
File "<ipython-input-37-ec27c752ae7e>", line 11
(s3_scenes.acquisitionDate='2019-04-22')
^
SyntaxError: invalid syntax
我知道日期格式有问题但无法解决。
还请向我推荐一些关于 AWS on Landsat 8 图像的好教程。
当我打印批量列表时
bulk_list
[productId LC08_L1TP_152042_20190422_20190507_01_T1
entityId LC81520422019112LGN00
acquisitionDate 2019-04-22 05:56:08.442691
cloudCover 0
processingLevel L1TP
path 152
row 42
min_lat 24.9171
min_lon 66.742
max_lat 27.0339
max_lon 69.0604
download_url https://s3-us-west-2.amazonaws.com/landsat-pds...
Name: 1520154, dtype: object]
甚至在我使用 (s3_scenes.acquisitionDate='2019-04-22 05:56:08.442691')
之后结果仍然相同
我觉得日期格式应该是YYYYMMDD
有关详细信息,请参阅 amazon
或简单地使用 s3_scenes.productId.str.contains('20190422')
你忘记了语句末尾的 &