- 积分
- 7
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-6-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
# coding: utf-8
#函数名称:NCandTIFconvert()
#函数用途:网络通用数据格式NetCDF和TIF数据格式互相转换(ArcMAP的工具箱中的多维工具箱Multidimension Tools)
#编写人员:陆国政
#编写时间:2018-01-25
# Import system modules
import arcpy
from arcpy import *
from arcpy import env
##############################NC数据转换为tif格式数据#########################################
# # Set local variables
# inNetCDFFile = "F:/20180124liuyong/nc_to_tif/data/Z_NAFP_C_BABJ_20180113122429_P_CLDAS_RT_ASI_0P0625_HOR-SM000010-2018011311.nc"
# variable = "SOILLIQ"
# XDimension = "LON"
# YDimension = "LAT"
# outRasterLayer = "SOILLIQ_Layer"
# bandDimmension = ""
# dimensionValues = ""
# valueSelectionMethod = "BY_VALUE"
#
#
# temppath = "F:/20180124liuyong/nc_to_tif/2/"
#
#
# try:
# arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension, YDimension,outRasterLayer, bandDimmension, dimensionValues, valueSelectionMethod)
# except Exception,e:
# arcpy.AddError(e.message)
# print 'ok'
#
# arcpy.CopyRaster_management(outRasterLayer, temppath+'1.tif')
##############################tif数据转换为NC格式数据#########################################
# Set local variables
inRaster = "F:/20180124liuyong/nc_to_tif/2/1.tif"
outNetCDFFile = "F:/20180124liuyong/nc_to_tif/3/elevnetcdf.nc"
# Process: RasterToNetCDF
try:
arcpy.RasterToNetCDF_md(inRaster, outNetCDFFile)
except Exception,e:
arcpy.AddError(e.message)
print 'ok'
|
|