Python 3.x 如何使用Amazon S3下载Landsat 8图像
我实现了教程中的python代码 它工作得很好,但我想根据日期检索数据。我甚至更改了一些代码并尝试了,但没有成功Python 3.x 如何使用Amazon S3下载Landsat 8图像,python-3.x,amazon-web-services,amazon-s3,google-colaboratory,landsat,Python 3.x,Amazon Web Services,Amazon S3,Google Colaboratory,Landsat,我实现了教程中的python代码 它工作得很好,但我想根据日期检索数据。我甚至更改了一些代码并尝试了,但没有成功 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, cloudc
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)
bulk_list=[]
#遍历路径和行
对于路径,zip中的行(路径,行):
打印('路径:',路径,'行:',行)
#过滤Landsat Amazon S3表格中匹配路径、行、云量和处理状态的图像。
场景=s3_场景[(s3_scenes.path==path)&(s3_scenes.row==row)&
(s3_scenes.cloudCover我认为日期格式应该是YYYYMMDD
有关更多信息,请参阅
或者简单地使用s3\u scenes.productId.str.contains('20190422')
你忘了&
在这句话的结尾我已经做了这个教程,我想你应该在熊猫数据帧过滤中使用“==”而不是简单的“=”,甚至“>=”。我的问题是,使用这个方法,速度非常慢:s
File "<ipython-input-37-ec27c752ae7e>", line 11
(s3_scenes.acquisitionDate='2019-04-22')
^
SyntaxError: invalid syntax