Hi Erick,
gsn_csm_vector_map expects u,v to be 2D but since you are concatenating u,v
they are 3D variables.
Try this:
do n=0, dimsizes(time) - 1
sfx = get_file_suffix(flista(n),1)
pltName = sfx@fBase
print (pltName)
;exit
wks = gsn_open_wks(pltType,pltName) ; open a ps file
; gsn_define_colormap(wks,"BlAqGrYeOrRevi200") ; choose color map
gsn_define_colormap(wks,"temp1") ; choose a color map
i = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap
res = True ; plot mods desired
res@gsnSpreadColors = True ; Use full color map
res@gsnSpreadColorStart = 16
res@gsnSpreadColorEnd = -3 ; exlude gray at color 200
res@mpLandFillColor = "gray" ; set land to be gray
res@mpMinLonF = minLon ; select a subregion
res@mpMaxLonF = maxLon
res@mpMinLatF = minLat
res@mpMaxLatF = maxLat
res@mpDataBaseVersion = "HighRes"
; res@mpDataBaseVersion = "MediumRes"
res@pmTickMarkDisplayMode = "Always"
res@pmTickMarkZone = 3
res@mpProjection = "mercator" ; projection
res@mpLimitMode = "Corners" ; method to zoom
res@mpLeftCornerLatF = minLat; min(lat)
res@mpLeftCornerLonF = minLon; min(lon)
res@mpRightCornerLatF = maxLat; max(lat)
res@mpRightCornerLonF = maxLon; max(lon)
; res@mpFillDrawOrder = "PostDraw"
;res@tfDoNDCOverlay = True ; do not transform data
res@gsnAddCyclic = False
res@gsnMaximize = True ; Maximize plot in frame
res@gsnSpreadColors = True ; span full colormap
res@lbOrientation = "Vertical"
res@lbLabelAutoStride = "True"
res@lbTitleString = "Surface Velocity cm/s"
res@lbTitlePosition = "Right"
res@lbTitleDirection = "Down"
res@lbTitleFontHeightF = "0.015"
res@lbLabelAlignment = "InteriorEdges"
res@vcMonoLineArrowColor = False ; color arrows based on magnitude
res@vcMonoFillArrowFillColor = False ; Color according to magnitude
;res@vcFillArrowEdgeColor = "black"
res@vcLevelSelectionMode = "ManualLevels" ;
res@vcLevelSpacingF = 2.5;
res@vcMinLevelValF = 0;
res@vcMaxLevelValF = 25;
; the full domain. If you wish to just consider the domain you are plotting,
; you must manually set those levels.
res@tiMainString = "Standard Radar Network ~C~ Sea Surface
Currents Normal Vectors~C~ " + date(n)
;res@gsnCenterString = "Sea Surface Currents"
res@gsnRightString = ""
res@tiXAxisString = " Longitude"
res@tiYAxisString = " Latitude"
; res@vcMinFracLengthF = 0.075 ; define fraction vector
res@vcRefMagnitudeF = 50.0 ; define vector ref mag
res@vcRefLengthF = 0.08; 0.055 Shorter Vector 0.125
Longer Vector ; define length of vec ref
res@vcMinDistanceF = 0.01 ;0.015 0.0075 0.000 ;
remove out vectors Higher number less are shown
; 0.015 is the original number. 0.0075 more vectors. 0.000 double
the amount of vectors
res@vcRefAnnoOrthogonalPosF = -0.20 ; move ref vector
;res@vcRefAnnoArrowLineColor = "black" ; change ref vector color
;res@vcRefAnnoArrowUseVecColor = True ; don't use vec color for ref
res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
;res@vcLineArrowColor = "black" ; change vector color
res@vcLineArrowThicknessF = 1.0 ; change vector thickness
; res@vcVectorDrawOrder = "PostDraw" ; draw vectors last
res@mpFillDrawOrder = "PostDraw"
;res@vcMonoLineArrowColor = True
plot =gsn_csm_vector_map(wks,u(n,:,:),v(n,:,:),res)
end do
-------------------------------------------------------------
Brandon Fisel
On Mon, Sep 12, 2011 at 10:24, Erick Rivera Lemus
<lemus@marine.rutgers.edu>wrote:
> Hello,
>
> I was going thru some of the archiving help list but I couldn't find
> something specific to what I want to do.
>
> I am reading in 24 hrs of hourly data and I will like to plot each hour as
> a figure (png works but preferably PS for higher quality resolution) named
> with a time stamp. I get this error as well.
>
> fatal:Number of dimensions in parameter (1) of (gsn_csm_vector_map) is (3),
> (2) dimensions were expected
> fatal:Execute: Error occurred at or near line 134 in file mult_plots.ncl
>
>
> I have attach my code.Any input would be greatly appreciate it.
>
>
>
> Cheers,
> Erick Rafael Rivera Lemus
> Software Technician
> Institute of Marine and Coastal Sciences
> Coastal Ocean Observation Laboratory
>
> Rutgers, The State University of New Jersey
> 71 Dudley Road New Brunswick, NJ 08901
>
> Office: 848-932-3261
> Fax: 732-932-8578
> Cell: 617-447-5106
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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
Received on Mon Sep 12 10:08:48 2011
This archive was generated by hypermail 2.1.8 : Mon Sep 12 2011 - 13:37:01 MDT