陆地观测卫星数据检索Python服务-ModisDownload的使用
ModisDownload包检索陆地卫星网站
ModisDownload包中的SearchCHN模块可以对陆地观测卫星数据网站进行检索 项目源码 作者主页
安装ModisDownload
控制台cmd命令下输入
pip install ModisDownload==1.5
Conda 环境下输入
pip install ModisDownload==1.5
安装完成后进入Python环境
from ModisDownload import visited
if __name__ == '__main__':
g=visited.getHtml("")
如果出现以下结果证明安装完成
查询步骤
- 通过查询的原始信息构造SearchData,对于searchData需要传入以下信息:
名称 | 类型 | 样例 |
---|
开始日期 | 字符串 | “20220404” | 结束日期 | 字符串 | “20220404” | 传感器列表 | 列表 | [Sensors.GJ1B_PMS, Sensors.DQ1_EMI] | ROI列表 | 列表 | [geom, geom2, geom3] | 云量 | 整数 | 60 | 产品级别 | 整数 | 1 |
- Sensors类别,Sensors中包含了所有支持查询的传感器名称以及类别,在上一步的传感器列表中需要为此对象的内部对象。目前支持的传感器类型如下
CSES_TBB,CSES_EFD,CSES_SCM,CSES_HPM,CSES_LAP,CSES_PAP,CSES_GRO,CSES_HEP,CBERS2B_WFI,CBERS2B_CCD,CBERS2B_HR,DQ1_PSS,DQ1_ACDL,DQ1_WSI,DQ1_DPC,DQ1_EMI,DQ1_POSP,ZY303_PMS,ZY303_NAD,ZY303_MUX,ZY303_TLC,ZY303_FWD,ZY303_BMS,ZY303_BWD,ZY303_DLC,ZY303_DMS,ZY303_TMS,SCSY1_HIS,GFDM01_SMAC,GFDM01_PMS,ZY302_MUX,ZY302_NAD,ZY302_PMS,ZY302_TLC,ZY302_TMS,ZY302_DLC,HJ1B_CCD,HJ1B_IRS,HJ1A_CCD,HJ1A_HSI,HJ1C_SAR,ZY3_TLC,ZY3_NAD,ZY3_BWD,ZY3_MUX,ZY3_FWD,ZY1E_VNIC,ZY1E_AHSI,LT1B_SAR,LT1A_SAR,CBERS01_WFI,CBERS01_CCD,CBERS01_IRS,CBERS02_IRS,CBERS02_WFI,CBERS02_CCD,ZY1F_AHSI,ZY1F_VNIC,ZY1F_IRS,LT1AB_SAR,GF5B_DPC,GF5B_GMI,GF5B_AHSI,GF5B_VIMI,GF5B_POSP,GF5B_AAS,GF5B_PSS,GF5B_EMI,GF3C_SAR,GF3B_SAR,HJ2A_IRS,HJ2A_HSI,HJ2A_CCD,HJ2A_PSAC,CB04A_MUX,CB04A_WPM,CB04A_WFI,GF1C_PMS,GF1B_PMS,GJ1A_PMS,GF2_PMS,GF1D_PMS,GF1_PMS,GF1_WFV,HJ2B_IRS,HJ2B_HSI,HJ2B_CCD,HJ2B_PSAC,GF4_B1,GF4_B3,GF4_B2,GF4_B4,GF4_PMS,GF4_PI,GF4_PMI,GF4_IRS,GF4_B5,GJ1C_PMS,GJ1B_PMS,GF3_SAR,GF6_PMS,GF6_WFV,GF5_DPC,GF5_VIMS,GF5_AHSI,GF5_AIUS,GF5_GMI,GF5_EMI,GJ1D_PMS,GF7_DLC,GF7_BWD,GF7_LSA,CB04_MUX,CB04_P10,CB04_P5M,CB04_PM,CB04_IRS,CB04_WFI,ZY02C_PMS,ZY02C_HRC,
- Poly构造ROI,Poly类对于ROI提供了三种构造方法:
- 点:经度,纬度
- 多边形:非封闭的点集
- 矩形:矩形只需传入左上角经纬度,右下角经纬度
from ModisDownload.Base import Base, Sensors
from ModisDownload.PolygonUtiles import Poly
geom = Poly.Point(123.1231, 34.123)
geom2 = Poly.Polygon(
[[105.550278, 32.174096], [105.550278, 28.707072],
[109.525337, 28.707072], [109.525337, 32.174096]])
geom3 = Poly.Square(104.550278, 28.174096, 109.525337, 18.707072)
searchData = SearchData("2021-05-11", "2022-05-21",
[Sensors.GJ1B_PMS, Sensors.DQ1_EMI,
Sensors.GF1B_PMS, Sensors.LT1B_SAR, Sensors.GF4_B3,
Sensors.ZY302_NAD, Sensors.GF5_EMI, Sensors.CSES_GRO]
, [geom, geom2, geom3], 60, 1)
- 查询,初始化查询容器SearchChina后传入SearchData对象。
search = SearchChina(searchData, True)
search.search()
search.save_ans("temp/ans.csv")
- 结果展示
示例代码
from ModisDownload.InitCHN import Init
from ModisDownload.PolygonUtiles import Poly
from ModisDownload.SearchCHN import SearchData,SearchChina
from ModisDownload.Base import Sensors
if __name__ == '__main__':
geom = Poly.Point(123.1231, 34.123)
geom2 = Poly.Polygon(
[[105.550278, 32.174096],
[105.550278, 28.707072],
[109.525337, 28.707072],
[109.525337, 32.174096]])
geom3 = Poly.Square(104.550278, 28.174096,
109.525337, 18.707072)
searchData = SearchData("2021-05-11", "2022-05-21",
[Sensors.GF1B_PMS,
Sensors.LT1B_SAR,
Sensors.GF4_B3,
Sensors.ZY302_NAD,
Sensors.GF5_EMI,
Sensors.CSES_GRO]
, [geom, geom2, geom3], 60, 1)
search = SearchChina(searchData, True)
search.search()
search.save_ans("ans.csv")
更新传感器列表
from InitCHN import Init
Init(True)
出现以下内容表示检索功能初始化完成
|