程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Land observation satellite data retrieval Python service

編輯:Python

Land observation satellite data retrieval Python service -ModisDownload Use

    • ModisDownload Package search Landsat website
    • install ModisDownload
    • Query steps
    • Sample code
    • Update sensor list

ModisDownload Package search Landsat website

ModisDownload In bag SearchCHN Module can be used for Landsat data website Search
Project source code
Author URI

install ModisDownload

Console cmd Command input

pip install ModisDownload==1.6

Conda Input... In the environment

pip install ModisDownload==1.6

Enter... After installation Python Environmental Science

from ModisDownload import visited
if __name__ == '__main__':
g=visited.getHtml("")

If the following results show that the installation is complete

Query steps

  1. Construct from the original information of the query SearchData, about searchData The following information needs to be passed in :
name type Examples Start date character string “20220404” End date character string “20220404” Sensor list list [Sensors.GJ1B_PMS, Sensors.DQ1_EMI]ROI list list [geom, geom2, geom3] cloudiness Integers 60 Product level Integers 1
  1. Sensors Category ,Sensors Contains the names and categories of all sensors that support queries , In the sensor list of the previous step, you need the internal object of this object . The currently supported sensor types are as follows

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,

  1. Poly structure ROI,Poly Class for ROI Three construction methods are provided :
    • spot : longitude , latitude
    • polygon : An unclosed set of points
    • rectangular : The rectangle only needs to pass in the longitude and latitude of the upper left corner , Longitude and latitude in the lower right corner
from ModisDownload.InitCHN import Init
from ModisDownload.PolygonUtiles import Poly
from ModisDownload.SearchCHN import SearchData,SearchChina,Login
from ModisDownload.Base import Sensors
from ModisDownload import visited
# draw ROI Area includes points , rectangular , polygon 
# spot 
geom = Poly.Point(123.1231, 34.123)
# polygon 
geom2 = Poly.Polygon(
[[105.550278, 32.174096], [105.550278, 28.707072],
[109.525337, 28.707072], [109.525337, 32.174096]])
# rectangular Longitude of upper left corner , Upper left latitude , Longitude of lower right corner , Lower right latitude 
geom3 = Poly.Square(104.550278, 28.174096, 109.525337, 18.707072)
# Query metadata 
# Start date , End date ,[ Query load list Characters can be entered manually ],ROI Area , cloudiness , Product grade 
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)
  1. Login Class login , The first parameter is user name , The second parameter is the password
# Sign in 
login = Login(username, password)
  1. Inquire about , Initialize the query container SearchChina And then it's coming in SearchData object .
# Query metadata 
# Start date , End date ,[ Query load list Characters can be entered manually ],ROI Area , cloudiness , Product grade 
searchData = SearchData("2020-05-11", "2022-05-21",
[Sensors.HJ2A_HSI,Sensors.HJ2A_CCD]
, [geom,geom2,geom3], 100, 1,login=login)
# Initialize query 
search = SearchChina(searchData, False)
# Inquire about 
search.search()
# Save results 
search.save_ans("ans.csv")
# Promise 
print(" Query complete ")
  1. Result display

Sample code

from ModisDownload.InitCHN import Init
from ModisDownload.PolygonUtiles import Poly
from ModisDownload.SearchCHN import SearchData,SearchChina,Login
from ModisDownload.Base import Sensors
from ModisDownload import visited
if __name__ == '__main__':
Init(False)
login = loginTest("***", "****")
geom = Poly.Point(114.220090, 30.305615)
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("2020-05-11", "2022-05-21",
[Sensors.HJ2A_HSI,Sensors.HJ2A_CCD]
, [geom,geom2,geom3], 100, 1,login=login)
search = SearchChina(searchData, False)
search.search()
search.save_ans("ans.csv")
return

Update sensor list

# Update sensor related information 
from InitCHN import Init
Init(True)

The following content indicates that the initialization of the retrieval function is completed


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved