请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7480|回复: 0

[源代码] Pythontonc

[复制链接]

新浪微博达人勋

发表于 2018-6-14 10:18:23 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

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'  






密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表