[ncl-talk] contour & vector overlay map
Dennis Shea
shea at ucar.edu
Mon Jun 15 08:59:53 MDT 2015
As noted by Karin, the dimensionality of the arguments you are passing is
not acceptable.
[1]
u = f->u({150:165},{15:18},:,:)
v = f->v({150:165},{15:18},:,:)
printVarSummary(u) ; **look** at this.
The variable is 4-dimensional
[2]
You use these and speed in
contours = gsn_csm_contour(wks,speed,cnres)
vectors = gsn_csm_vector(wks,u,v,vcres)
Please *read* the documentation for functions you are using:
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour.shtml
Note what it shows for the 'dat' argument
*data*
The data to contour; ****must be one or two-dimensional.****
You are using 4D arrays. That is what the error message is telling you
[3]
do nt=...
do kl=...
contours = gsn_csm_contour(wks,speed(nt,kl,:,:),cnres)
vectors = gsn_csm_vector(wks,u(nt,kl,:,:),v(nt,kl,:,:),vcres)
;---Overlay vectors and contours on map
overlay(map,contours)
overlay(map,vectors)
;---Drawing the map will draw contours and vectors too.
draw(map)
frame(wks)
end do
end do
On Mon, Jun 15, 2015 at 8:23 AM, Karin Meier-Fleischer <
meier-fleischer at dkrz.de> wrote:
> Hi,
>
> the error message is telling you what is wrong. Your speed, u and v
> variable
> have more than 2 dimensions. Do a printVarSummary to get variable
> information.
>
> Bye,
> Karin
>
> Am 15.06.15 um 16:01 schrieb saeed bayat:
>
> Dear NCL users
> I want to plot a map which includes contour and vector (or streamline)
> overlay. I prepared a ncl script that has error.:
> gsn_csm_contour: Fatal: the input data array must be 1D or 2D
> fatal:Illegal right-hand side type for assignment
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 45 in
> file cn_vc.ncl
>
> Please find attached script to find more about the script and help me to
> solve the problem.
>
> Best Regards
> --
> Abdolhalim Bayat
> Ph.D Candidate of Synoptic Climatology
> University of Tehran (Iran)
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> Dipl. Geophys. Karin Meier-Fleischer
> Visualization
> Application Support
>
> Deutsches Klimarechenzentrum GmbH (DKRZ)
> Bundesstrasse 45a - D20146 Hamburg - Germany
>
> Phone: +49 (0)40 460094 126
> Fax: +49 (0)40 460094 270
> E-Mail: meier-fleischer at dkrz.de
> URL: www.dkrz.de
>
> Geschäftsführer: Prof. Dr. Thomas Ludwig
> Sitz der Gesellschaft: Hamburg
> Amtsgericht Hamburg HRB 39784
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150615/5398caf8/attachment.html
More information about the ncl-talk
mailing list