Re: Error while plotting NCEP data

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 08 2010 - 09:32:03 MST

Hi A.R.,
Also, you might want to check to make sure that your data is of type
float, and not of type short. In my NCEP Reanalysis holdings, uwnd/vwnd
data is of type short. (Add a printVarSummary(U) line in after you read
in the variable to check.) If the data is of type short, use short2flt
to convert it to floats:
http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml
Adam

On 03/08/2010 09:07 AM, Mary Haley wrote:
> A.R.
>
> With an error like this, it helps to debug it by turning off some of
> your resources. Perhaps
> you have them set to values that are not in the range of your data.
>
> I would start by commenting out these three lines, and see what you get
> by default, and
> also see if you still get the error message:
>
>> res@vcRefMagnitudeF = 5.0 ; make vectors larger
>> res@vcRefLengthF = 0.005 ; ref vec length
>> res@vcMinDistanceF = 0.017 ; thin out windbarbs
>
> If you don't get an error message, then look at the plot to see
> what the default reference vector is, and use this information
> to help determine if the one you picked was too large.
>
> --Mary
>
>
> On Mar 8, 2010, at 1:12 AM, A.R Ragi wrote:
>
>> Dear NCl users..,
>> I'm getting error while coding wind vectors using NCEP data.
>> I'm attaching the code.
>>
>>
>>
>> begin
>>
>> u = addfile("/CMAP/WIND/uwnd.mon.mean.nc <http://uwnd.mon.mean.nc>","r")
>> v = addfile("/CMAP/WIND/vwnd.mon.mean.nc <http://vwnd.mon.mean.nc>","r")
>>
>> U = u->uwnd(:,:,:,:)
>> V = v->vwnd(:,:,:,:)
>>
>> wks = gsn_open_wks("ps","windpattern_cmap") ; open ps file
>>
>> gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose color map
>> i = NhlNewColor(wks,0.8,0.8,0.8) ; add gray to colors
>>
>> res = True ; plot mods desired
>> res@gsnSpreadColors = True ; use full colormap
>> res@gsnSpreadColorEnd = -2 ; don't use added gray
>> res@lbOrientation = "vertical" ; vertical label bar
>>
>> res@tiMainString = "Windpattern"
>>
>>
>> res@vcRefMagnitudeF = 5.0 ; make vectors larger
>> res@vcRefLengthF = 0.005 ; ref vec length
>> res@vcMinDistanceF = 0.017 ; thin out windbarbs
>> res@vcGlyphStyle = "WindBarb" ; choose wind barbs
>> res@vcMonoWindBarbColor = False ; color barbs by scalar
>> res@vcWindBarbTickLengthF = 0.3 ; length of the barb tick
>> res@vcWindBarbTickSpacingF = 0.3 ; distance between ticks
>>
>>
>> ; zoom in on map
>>
>> minlat = -20
>> maxlat = 40
>> minlon = 40
>> maxlon = 120
>>
>> res@mpMinLatF = minlat
>> res@mpMaxLatF = maxlat
>> res@mpMinLonF = minlon
>> res@mpMaxLonF = maxlon
>>
>> ;******************************************************
>> ; Plot wind barb
>> ;******************************************************
>>
>> plot=gsn_csm_vector_map_ce(wks,U(653,3,:,:),V(653,3,:,:),res)
>>
>> end
>>
>>
>> I want to plot winds at 2002 june....so converted time using
>> *ut_calenda*r function and i got it is :653 and level is 850 hpa -->3
>> thus U(653,3,:,:) and V(653,3,:,:). I hope the calculation is correct.
>>
>> The error am getting is:
>>
>>
>> fatal:VectorPlotDraw: VVECTR - VECTOR NDC LENGTH TOO GREAT
>> fatal:VectorPlotDraw: error drawing vectors
>> fatal:VectorPlotDraw: draw error
>> fatal:PlotManagerDraw: error in plot draw
>> fatal:_NhlPlotManagerDraw: Draw error
>>
>>
>>
>> Thanks in advance
>>
>>
>> --
>> *********************************************************************
>> A.R.Ragi
>> M.Tech Atmospheric science
>> Department of Atmospheric science
>> Cochin University of Science and Technology
>> Email : ar.ragi@gmail.com <mailto:ar.ragi@gmail.com>
>>
>> ************************************************************************
>> "I want to know how God created this world.I am not interested in this
>> or that phenomenon. I want to know, his thought, the rest are details"
>> . ---Albert Einstein
>>
>> ************************************************************************
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 8 09:32:08 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 08 2010 - 12:07:42 MST