Satellite Cloud Map via GP-radar-rainfall forecast

Source: Internet
Author: User
Tags radar

# ---------------------------------------------------------------------------
# meteorologicalimageload.py
# Created on:2014-01-24 08:33:03.00000
# Created by Smartmap
# usage:meteorologicalimageload <analyzeType> <analyzeResult>
# Description:
# ---------------------------------------------------------------------------


Import arcpy
Import Shutil
Import Os,sys

Arcpy.env.overwriteOutput = True


Projectnamesatelliteimage = ' geogcs[' gcs_wgs_1984 ', datum[' d_wgs_1984 ', spheroid[' wgs_1984 ', 6378137.0,298.257223563]],primem["Greenwich", 0.0],unit["degree", 0.0174532925199433],authority["EPSG", 4326] "
Projectnamewaterreport = ' projcs[' asia_north_equidistant_conic ', geogcs[' gcs_wgs_1984 ', DATUM[' D_WGS_1984 ', spheroid["wgs_1984", 6378137.0,298.257223563]],primem["Greenwich", 0.0],unit["degree", 0.0174532925199433], projection["Equidistant_conic"],parameter["false_easting", 0.0],parameter["false_northing", 0.0],PARAMETER[" Central_meridian ", 95.0],parameter[" Standard_parallel_1 ", 15.0],parameter[" standard_parallel_2 ", 65.0],PARAMETER[ "Latitude_of_origin", 30.0],unit["Meter", 1.0],authority["ESRI", 102026]] '
Projectnameweatherradar = ' projcs[' asia_lambert_conformal_conic ', geogcs[' gcs_wgs_1984 ', DATUM[' D_WGS_1984 ', spheroid["wgs_1984", 6378137.0,298.257223563]],primem["Greenwich", 0.0],unit["degree", 0.0174532925199433], projection["Lambert_conformal_conic"],parameter["false_easting", 0.0],parameter["false_northing", 0.0],PARAMETER ["Central_meridian", 105.0],parameter["Standard_parallel_1", 30.0],parameter["standard_parallel_2", 62.0], parameter["Latitude_of_origin", 0.0],unit["Meter", 1.0],authority["ESRI", 102012]] '

Analyzeresult = "%scratchworkspace%\\analyzeresult.img"

# Script Arguments
Analyzetype = arcpy. Getparameterastext (0)
if analyzetype = = ' # ' or not analyzetype:
Analyzetype = "Satelliteimage"

Imagedirectory = "d:\\data\\spatialdata\\sourcedir\\" + analyzetype
Copytargetpath = "D:\\data\\spatialdata\\targetdir\\default" + Analyzetype + ". jpg"
Inputlinkfile = "d:\\data\\spatialdata\\targetdir\\" + Analyzetype + "Tic.txt"

Lasttime = 0
Lastfilepath = "#"
If Imagedirectory and imagedirectory! = ' # ':
FileList = Os.listdir (imagedirectory) #列出目录下的所有文件和目录
For line in FileList:
filepath = Os.path.join (imagedirectory,line)
If Os.path.isfile (filepath):
# Os.stat (filepath). St_ctime
LastModifyTime = Os.path.getctime (filepath)
If LastModifyTime > Lasttime:
Lasttime = LastModifyTime
Lastfilepath = FilePath

if Lastfilepath = = "#":
Lastfilepath = "D:\\data\\spatialdata\\default" + Analyzetype + ". jpg"

Shutil.copy (Lastfilepath, Copytargetpath)
# Process:register Raster
arcpy. Registerraster_management (Copytargetpath, "REGISTER", "", Inputlinkfile, "POLYORDER1", "")

# process:copy Raster
arcpy. Copyraster_management (Copytargetpath, Analyzeresult, "", "", "" "," none "," None "," "," none "," none ")

# Process: Defining projections
if Analyzetype = = ' Satelliteimage ':
ProjectName = Projectnamesatelliteimage
elif Analyzetype = = ' Weatherradar ':
ProjectName = Projectnameweatherradar
elif Analyzetype = = ' Waterreport ':
ProjectName = Projectnamewaterreport
Else
ProjectName = Projectnamesatelliteimage

arcpy. Defineprojection_management (Analyzeresult, ProjectName)

arcpy. Setparameterastext (1, Analyzeresult)

Satellite Cloud Map via GP-radar-rainfall forecast

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.