用python批量下载modis数据的速度怎么样_MODIS数据下载与处理-pymodis的使用(持续更新...)...

MODIS数据下载与处理-pymodis的使用(持续更新...)MODIS数据如何下载?下载量小的话,可以从NASA官网 根据产品、时间、位置进行筛选自己要的,之后下载。当下载量比较大时…肯定是编程来的快了…之前一直在想怎么编程,后来接触python后,得知pymodis工具…一个函数搞定。后续拼接处理也有相应的函数,可以调用MRT(官网上好像已经下架,替代产品还未了解)软件和GDAL库

关于pymodis

pymodis是基于python语言的开源modis数据处理库。pymodis 提供按照用户提供的时间范围的modis产品的批量下载函数、对modis瓦片数据进行镶嵌以及投影、将hdf格式转化为其他格式,并提取数据质量信息。

具有如下特点:

1. 用于下载大量modis hdf/xml 文件以及解析xml文档以获取有关HDF文件的信息

2. 使用MRT或GDAL将modis文件转为geotiff格式

3. 使用MRT或GDAL将modis瓦片数据拼接、重投影

4. 用于下载大量modis hdf/xml 文件以及解析xml文档以获取有关HDF文件的信息

5. 创建融合后影像的xml格式元数据

6. 从modis字节编码质量评估图层提取具体信息

包括:

pymodis脚本工具:

modis_download.py

modis_download_from_list.py

modis_parse.py

modis_multiparse.py

modis_mosaic.py

modis_convert.py

modis_quality.py

pymodis库:

downmodis module

parsemodis module

convertmodis module

convertmodis_gdal module

qualitymodis module

optparse_required module

optparse_gui module

脚本工具使用

warning:无论用脚本工具还是模块编程,下载数据是从NASA的官方网站上下载,所以在使用下载前要提前在网站上注册,记住用户名和密码

脚本可以在终端调用,通过下面命令方式:

modis_download.py [options] destination_folder

其中[options]为可选命令,由下面参数组成,参数都设置了默认值,一般要根据自己需求修改。

-h --help shows the help message and exit

-u --url http/ftp server url [default=https://e4ftl01.cr.usgs.gov]

-I --input insert user and password from standard input

-P --password password to connect

-U --username username to connect

-t --tiles string of tiles separated by comma

[default=none] for all tiles

-s --source directory on the http/ftp server

[default=MOLT]

-p --product product name as on the http/ftp server

[default=MOD11A1.005]

-D --delta delta of day starting from first day [default=10]

-f --firstday the day to start download, if you want change

data you have to use this format YYYY-MM-DD

([default=none] is for today)

-e --endday the day to finish download, if you want change

data you have to use this format YYYY-MM-DD

([default=none] use delta option)

-x useful for debugging the download

[default=False]

-j download also the jpeg files [default=False]

-O download only one day, it sets delta=1 [default=False]

-A download all days, useful for initial download of a

product. It overwrites the 'firstday' and 'endday'

options [default=False]

-r remove files with size same to zero from

'destination_folder' [default=False]

如下载过去15天的Aqua卫星LST数据

modis_download.py -I -r -s MOLA -p MYD11A1.005 -t h18v03,h18v04 -D 15 lst_aqua/

还是要彻底了解一下各个参数的输入及意义,有的看的一头雾水,不了解变量很难变通。解析一下前面的代码,其中modis_download.py就是脚本命令,-I -r -s MOLA -p MYD11A1.005 -t h18v03,h18v04 -D 15这部分都是可选输入参数部分,lst_aqua为下载数据的存储文件夹

其中,可选输入参数部分,每个都是变量标识后跟相应参数,为空则是默认变量值,其中 -s 是网站上的目录,为 MOLA;-p是产品名称,为MYD11A1.005;-t是要下载产品的行列号,多个用逗号隔开,在这里下载h18v03,h18v04,即18行3列和18行4列的两个数据瓦片;-D表示从下载日期开始,往历史搜寻的天数,在这个时间段的数据即下载下来,这里下载从今天开始过去15天内的数据。其中下载开始日期/结束日期都可以分别通过**-f和-e**设定,开始日期默认为今天。其中,刚开始比较迷惑的是如何确定网站下的产品所在的那一级目录、产品名称,这里可以参考这个网站。

MYD11A1.005是在MOLA目录下的。库的函数参数的确定与此相同。总结来说,明确工具或函数的各个变量含义才能灵活使用。

再比如modis_convert.py脚本,他的运行命令为:

modis_convert.py [options] hdf_file

他的可选参数输入部分如下:此处调用了MRT软件或GDAL库,分别给出了针对这两种方法的输入参数

-h, --help show this help message and exit

Required options:

-s SUBSET, --subset=SUBSET

(Required) a subset of product's layers. The string

should be similar to: ( 1 0 )

-o OUTPUT_FILE, --output=OUTPUT_FILE

(Required) the prefix of output file

-g RESOLUTION, --grain=RESOLUTION

the spatial resolution of output file

-r RESAMPLING_TYPE, --resampl=RESAMPLING_TYPE

the method of resampling. -- mrt methods:

'NEAREST_NEIGHBOR', 'BICUBIC', 'CUBIC_CONVOLUTION',

'NONE' -- gdal methods: 'AVERAGE', 'BILINEAR',

'CUBIC', 'CUBIC_SPLINE', 'LANCZOS', 'MODE',

'NEAREST_NEIGHBOR' [default=NEAREST_NEIGHBOR]

Options for GDAL:

-f OUTPUT_FORMAT, --output-format=OUTPUT_FORMAT

output format supported by GDAL [default=GTiff]

-e EPSG, --epsg=EPSG

EPSG code for the output

-w WKT, --wkt_file=WKT

file or string containing projection definition in WKT

format

-v, --vrt Read from a GDAL VRT file.

--formats print supported GDAL formats

Options for MRT:

-m MRT_PATH, --mrt=MRT_PATH

the path to MRT software

-d DATUM, --datum=DATUM

the code of datum. Available: 'NODATUM', 'NAD27',

'NAD83', 'WGS66', 'WGS72', 'WGS84' [default=WGS84]

-t PROJECTION_SYSTEM, --proj_type=PROJECTION_SYSTEM

the output projection system. Available: 'AEA', 'GEO',

'HAM', 'IGH', 'ISIN', 'LA', 'LCC', 'MOL', 'PS', 'SIN',

'TM', 'UTM', 'MERCAT' [default=GEO]

-p PROJECTION_PARAMETERS, --proj_parameters=PROJECTION_PARAMETERS

a list of projection parameters, for more info check

the 'Appendix C' of MODIS reprojection tool user's

manual https://lpdaac.usgs.gov/content/download/4831/2

2895/file/mrt41_usermanual_032811.pdf [default=( 0.0

0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

0.0 )]

-u UTM_ZONE, --utm=UTM_ZONE

the UTM zone if projection system is UTM

the UTM zone if projection system is UTM

标签:MODIS,modis,default,0.0,py,pymodis,...,download,下载

来源: https://blog.csdn.net/qq_40821274/article/details/94739578

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值