爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 11733|回复: 6

小白求问ncl如何求三十年夏季平均温度

[复制链接]

新浪微博达人勋

发表于 2020-1-5 07:11:52 | 显示全部楼层 |阅读模式
5金钱
求大佬帮助,手头有ncep的air.mon.mean.ncl
月平均气温数据,是从1948-2018年的。如何用其中五十年比如1961-2010年6-8月平均温度来画空间分布及时间序列图。(主要是要求时段的资料提取该如何做呢?)

最佳答案

查看完整内容

year = ispan(1961, 2010, 1) it_s = 196101 it_e = 201012 s = addfile ("/cygdrive/e/data/air.mon.mean.nc", "r") ; add file time = s->time YYYYMM = cd_calendar(time, -1) rec_s = ind(it_s.eq.YYYYMM) rec_e = ind(it_e.eq.YYYYMM) air = s->air(rec_s:rec_e,:,:) printVarSummary(air) u1 = month_to_season(air, "JJA" ) copy_VarMeta(air(0,:,:), u1(0,:,:)) ...
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-1-5 07:11:53 | 显示全部楼层
year = ispan(1961, 2010, 1)
it_s = 196101
it_e = 201012

s = addfile ("/cygdrive/e/data/air.mon.mean.nc", "r")      ; add file


time   = s->time
YYYYMM  = cd_calendar(time, -1)


rec_s  = ind(it_s.eq.YYYYMM)
rec_e  = ind(it_e.eq.YYYYMM)  

air  = s->air(rec_s:rec_e,:,:)
printVarSummary(air)

  u1 = month_to_season(air, "JJA" )
  copy_VarMeta(air(0,:,:), u1(0,:,:))
  u1!0     = "year"
  u1&year = year
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2020-1-5 09:44:17 | 显示全部楼层
month_to_season,month_to_seasonN这两个函数都可以,具体用法参见官网
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-1-5 11:28:29 来自手机 | 显示全部楼层
谢谢大佬,这两天手边没电脑,回去之后试一下,万分感谢
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-1-5 11:31:00 来自手机 | 显示全部楼层
谢谢提示~我回去之后试试
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-1-6 15:08:38 | 显示全部楼层
帅蛋fly 发表于 2020-1-5 07:11
year = ispan(1961, 2010, 1)
it_s = 196101
it_e = 201012

大佬我按您的脚本加入图像设置之后提示plot有问题,显示的这个 Fatal: the input data array must be 1D or 2D
fatal:Illegal right-hand side type for assignment
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 42
请问怎么修改啊,麻烦您了
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2020-1-6 22:26:10 | 显示全部楼层
541631787 发表于 2020-1-6 15:08
大佬我按您的脚本加入图像设置之后提示plot有问题,显示的这个 Fatal: the input data array must be 1D  ...

您的42行是什么?
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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