爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6663|回复: 4

ncl画气压场温度场问题

[复制链接]
发表于 2016-11-10 22:41:27 | 显示全部楼层 |阅读模式

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

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

x
本人刚学ncl,花了两张丑图,一个温度场,一个气压场。问题1:为什么陆地总是绿色的。还有就是色标数值大小是单位K吧。有没有命令可以只画陆地或只画海洋
问题2:气压场中气压值怎么让它单位是hpa。
问题3:如何让亚洲这一块处在中间位置。现在的地图是北美在图的中间
都是小问题,但是这些东西找起来也费劲。希望熟练ncl的人能帮助一下。或者推荐一下这些问题的网址。感谢啦
温度场脚本:
;************************************
;
; CSM_Graphics: ocean_1.ncl
;
;************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;************************************

begin
;************************************
in = addfile("/lustre/home/niehw/msst.nc","r")
sst=in->sst            ; get rid of cyclic points (req to plt)
;************************************
wks = gsn_open_wks("x11","ocean")  ; open a x11 file
gsn_define_colormap(wks,"BlAqGrYeOrRe")

;res@gsnSpreadcolorStart      =14

res                      = True
res@cnFillOn             = True     ; turn on color fill
res@mpFillOn             = True     ; turn off gray continents
res@mpFillColor          = "gray"
res@mpOutlineOn          = True     ; turn off continental outline
res@gsnDraw              = False    ; do not draw picture
res@gsnFrame             = False    ; do not advance frame
res@cnMinLevelValF           = 195.0     ; 最小值
res@cnMaxLevelValF           = 328.0     ; 最大值
;res@cnLevelSpacingF          = 2.25      ; 间隔
res@gsnSpreadColorStart      = 14        ; 起始于color index 14

sst2=sst@add_offset+sst*sst@scale_factor
copy_VarMeta(sst,sst2)

sst_mean=dim_avg_n_Wrap(sst2,0)
printVarSummary(sst2)

plot = gsn_csm_contour_map_ce(wks,sst_mean,res)     ; create plot

draw(plot)
frame(wks)
;************************************

end


气压场脚本
;************************************
;
; CSM_Graphics: ocean_1.ncl
;
;************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;************************************

begin
;************************************
in = addfile("/lustre/home/niehw/mslp.nc","r")
msl=in->msl            ; get rid of cyclic points (req to plt)
msl&longitude@units            ="degrees_east"
msl&latitude@units            ="degrees_north"

;************************************
wks = gsn_open_wks("x11","oceanpresure")  ; open a x11 file
gsn_define_colormap(wks,"BlAqGrYeOrRe")

res                      = True
res@cnFillOn             = False     ; turn on color fill
res@mpOutlineOn          = True     ; turn off continental outline

msl2=msl@add_offset+msl*msl@scale_factor
copy_VarMeta(msl,msl2)

msl_mean=dim_avg_n_Wrap(msl2,0)
printVarSummary(msl2)

plot = gsn_csm_contour_map_ce(wks,msl_mean,res)     ; create plot

draw(plot)
frame(wks)
;************************************

end













QQ20161026155756.png
QQ20161026155812.png
密码修改失败请联系微信:mofangbao
发表于 2016-11-10 23:22:25 | 显示全部楼层
第一个问题:陆地的填充颜色可以用res@mpFillColor更改,至于单位可以用print(sst@units)查看;
第二个问题:hPa可以使用sst = sst/100.0,然后更改sst@units = hPa;
第三个问题:res@mpCenterLonF = 110.0
密码修改失败请联系微信:mofangbao
发表于 2016-11-11 11:16:02 | 显示全部楼层
我什么时候能达到着中国程度
密码修改失败请联系微信:mofangbao
发表于 2016-11-15 15:54:23 | 显示全部楼层
你好 想问一下  为什么要求平均msl呢   还有就是  dim avg这个求出来的是什么呢
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-11-15 21:33:15 | 显示全部楼层
jianglegejiang 发表于 2016-11-15 15:54
你好 想问一下  为什么要求平均msl呢   还有就是  dim avg这个求出来的是什么呢

求平均的函数,因为每个格点有多年每月数据
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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