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

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2600|回复: 4

[作图] 请大神们帮忙看一下这是什么原因呢?应该怎么改正

[复制链接]

新浪微博达人勋

发表于 2019-1-23 22:34:21 | 显示全部楼层 |阅读模式
5金钱
出现的错误如下:
warning:asciiread: End of file reached and only (281) elements were read from the file, filling remaining elements with the default missing value for the requested type
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        0
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        1
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        2
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        3
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        4
warning:dsgrid2: 1 one-dimensional input arrays contained missing values. No interpolation performed on these arrays


Variable: t
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:        [1]
Coordinates:
(0)        5

Variable: mdata
Type: float
Total Size: 274104 bytes
            68526 values
Number of Dimensions: 3
Dimensions and sizes:        [time | 6] x [lat | 81] x [lon | 141]
Coordinates:
            lat: [15..55]
            lon: [70..140]
Number Of Attributes: 1
  _FillValue :        9.96921e+36
(0)         
(0)        min=9.96921e+36   max=9.96921e+36
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode


Month_Tmax_adj_final.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2019-1-24 11:41:52 | 显示全部楼层
程序如下:
; ==============================================================

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 "/Users/mac/Downloads/shuju/draw/geodiag_plot_utils.ncl"
load "/Users/mac/Downloads/shuju/draw/zh.ncl"
; ==============================================================

  ntime=12
  nstd=753
  latlon = asciiread("/Users/mac/Downloads/shuju/new_latlon.txt",(/nstd,2/),"float")
  lat = latlon(:,0)
  lon = latlon(:,1)

; ==============================================================
ep = asciiread("/Users/mac/Downloads/shuju/Month_Tmax_adj_final.xlsx",(/ntime,nstd/),"float")
;==============interploation====================================
  nx=141
  ny=81
  sx=70.0
  ex=140.0
  sy=15.0
  ey=55.0
  mdata=new((/6,ny,nx/),"float")
  mdata!0="time"

do t=0,5
tt=ep(t+3,:)
; mdata(t,:,:)=zh_rectgrid(lon(0:nstd-1),lat(0:nstd-1),tt(0:nstd-1),1.0,"/Users/mac/Downloads/shuju/draw/cnmask.dat","float",nx,ny,sx,ex,sy,ey,"nat",True)
mdata(t,:,:)=zh_rectgrid(lon(0:nstd-1),lat(0:nstd-1),tt(0:nstd-1),1.0, \
  "/Users/mac/Downloads/shuju/draw/cnmask.grd","float",nx,ny,sx,ex,sy,ey,"ds",True)
print(t)
end do

mdata=where(mdata.le.-100,mdata@_FillValue,mdata)
printVarSummary(mdata)
printMinMax(mdata,True)
;===========================================================
; PLOTS
;============================================================

  wks = gsn_open_wks("png","Month_Tmax_adj_final")
  gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")       ; choose colormap
  plot = new(6,graphic)                ; create graphic array
                                          ; only needed if paneling
  res                      = True         
  res@gsnDraw              = False        ; don't draw yet
  res@gsnFrame             = False        ; don't advance frame yet
  res@gsnSpreadColors      = True         ; spread out color table
  res@gsnAddCyclic              = False

  res@mpOutlineOn                 = False
  res@mpFillOn   = False
  res@mpLimitMode                 = "Corners"
  res@mpLeftCornerLatF            = 15
  res@mpLeftCornerLonF            = 70
  res@mpRightCornerLatF           = 55
  res@mpRightCornerLonF           = 140

  res@cnFillOn             = True         ; turn on color fill
  res@cnLinesOn            = False        ; True is default
  res@cnLineLabelsOn       = False        ; True is default
  res@lbLabelBarOn         = False        ; turn off individual lb's

res@gsnSpreadColors = True ; use full color map
res@gsnSpreadColorStart = 10
res@gsnSpreadColorEnd = 256 ; don't use added gray
                                        ; set symmetric plot min/max
;  symMinMaxPlt(eof_rot, 16, False, res)       ; contributed.ncl
  res@cnLevelSelectionMode ="ManualLevels"          ;"AutomaticLevels"     ; "ManualLevels"
  res@cnMinLevelValF   = 1.
  res@cnMaxLevelValF   = 4.
  res@cnLevelSpacingF  = 0.2
; panel plot only resources
  resP                     = True         ; modify the panel plot
  resP@gsnMaximize         = True         ; large format
  resP@gsnPanelYWhiteSpacePercent = 4
  resP@gsnPanelLabelBar    = True         ; add common colorbar
  resP@lbLabelStride   = 2         ; auto stride on labels
  resP@txString           = "Extreme precipitation days"
  resP@txFontHeightF      =0.02
  resP@txFont=25
  resP@lbLabelFont =25
  resP@lbLabelFontHeightF =.01
  resP@pmLabelBarWidthF = 0.7
  resP@pmLabelBarHeightF = 0.04

  config = True
  config@isShowProvince = False
  config@isShowSouthChinaSea = True
  config@isAddMask = True
  config@isShowRivers = True

;*******************************************
; Plot standard patterns
;*******************************************
  res@gsnRightString  ="";"Extreme precipitation days"
  res@tmXBLabelFontHeightF = 0.025
  res@tmYLLabelFontHeightF = 0.025
  res@tmYLLabelFontThicknessF = 0.8
  res@tmXBLabelFontThicknessF = 0.8
  res@tmXBLabelFont = 25
  res@tmYLLabelFont = 25
  res@tmXBValues = fspan(80,120,3)
  res@tmYLValues = fspan(20,50,4)
  res@tmYLLabels = (/"20~S~o~N~N","30~S~o~N~N","40~S~o~N~N","50~S~o~N~N"/)
  res@tmXBLabels = (/"80~S~o~N~E","100~S~o~N~E","120~S~o~N~E"/)
  res@gsnStringFont=22
  res@gsnStringFontHeightF= 0.028

   month=(/"(a) January","(b) February","(c) March","(d) April","(e) May","(f) June"/)
do i=0,5
     res@gsnLeftString = month(i)
     plot(i)=gsn_csm_contour_map(wks,mdata(i,:,:),res)
     attach_china_map(wks, plot(i), config)
end do

  gsn_panel(wks,plot,(/2,3/),resP)     ; only plot the 1st four
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-1-24 16:51:05 | 显示全部楼层
有没有人帮忙看一下啊
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2019-1-24 19:31:02 | 显示全部楼层
我估计你的这段脚本
  1. mdata=where(mdata.le.-100,mdata@_FillValue,mdata)
复制代码
使得所有数据都为缺省值,从你的输出也可以看出。详见:http://www.ncl.ucar.edu/Support/talk_archives/2011/2612.html
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-1-24 20:10:40 | 显示全部楼层
弓长铭 发表于 2019-1-24 19:31
我估计你的这段脚本使得所有数据都为缺省值,从你的输出也可以看出。详见:http://www.ncl.ucar.edu/Suppor ...

那应该怎么改呢?
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

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

本版积分规则

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

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

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