- 积分
- 1901
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-6
- 最后登录
- 1970-1-1
|
发表于 2016-5-3 11:36:40
|
显示全部楼层
copy_VarCoords
Copies all named dimensions and coordinate variables from one variable to another.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
procedure copy_VarCoords (
var_from ,
var_to
)
Examples
Example 1
;---read in netCDF file and read in data
cdf_file = addfile("slp.1963.nc","r")
slp = cdf_file->slp(:,::-1,:) ; slp has coordinate arrays
newslp = ((slp*slp@scale_factor)+slp@add_offset)*.01 ; newslp won't have any coordinate arrays
copy_VarCoords(slp,newslp) ; copy coordinate arrays from slp to newslp
-------------------------------------------------------------------------------------------------------------------------------------------
copy_VarMeta
Copies all attributes, named dimensions and coordinate variables from one variable to another.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
procedure copy_VarMeta (
var_from ,
var_to
)
Examples
Example 1
;---read in zonal winds
a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r")
u = a->U(1,:,:)
v = a->V(1,:,:)
spd = sqrt(u^2+v^2) ; spd won't have any metadata
copy_VarMeta(u,spd) ; Copy metadata from u to spd
------------------------------------------------------------------------------------------------------------------------------------------为自己深深地踩个脚印! |
|