Re: gsn_csm_vector Vs gsn_vector

From: Sabeerali(sebi) <sabeerl_at_nyahnyahspammersnyahnyah>
Date: Thu May 26 2011 - 22:41:15 MDT

Thanks Dave.Now both plots gives almost similar pattern.

On 26 May 2011 22:43, David Brown <dbrown@ucar.edu> wrote:

> Hi Sabeer,
>
> I suspect that your problem is the same as another user (Cheung) had
> recently. First of all, as Mary Haley pointed out:
>
> The main difference between gsn_vector and gsn_csm_vector is that
> gsn_vector doesn't use coordinate arrays that may be attached to your data.
> This is part of the cause in difference of your two plots.
>
> The other thing is my response to Cheung:
>
> By default, the vector direction is mapped into the coordinate space
> defined by the coordinate variables. This is appropriate for horizontal
> vectors drawn on a map, but not for vectors in a vertical space such as
> yours where the Y axis and the X Axis have completely unrelated units. To
> fix this you should set the resource vcMapDirection to False. This will make
> the output of gsn_vector and
> gsn_csm_vector look pretty much alike. However, it also has the effect of
> always making the positive Y direction from bottom to top. If, as you say,
> the gsn_vector output looks like what you want, it may mean the vertical
> component is positive from top to bottom of the atmosphere. If this is the
> case, then you will need to multiply the vertical component by -1.0 to get
> the result you are looking for.
>
> ----
> So bottom line is: set vcMapDirection to False.
>
> -dave
>
>
> On May 26, 2011, at 6:11 AM, Sabeerali(sebi) wrote:
>
> Dear Mateus,
>
> Thanks for your response. As you said there are some difference between
> graphics generated with *gsn_** functions and those generated with *
> gsn_csm** functions. But when we plot with *gsn_csm_vector* functions, the
> Hadley circulation never comes to reality. It gives entirely wrong picture (
> It never gives the ascending and descending motion. It gives some horizontal
> vectors). But when we plot with *gsn_vector* functions, it gives correct
> plot. But the problem with the *gsn_vector* function is that it never
> gives the coordinate in X and Y axis. In that case how I can resolve my
> issues.
>
> Thanks in advance
> sabeer
>
>
> On 26 May 2011 16:53, Mateus Teixeira <mateus.teixeira@gmail.com> wrote:
>
>> Hi Sabeerali,
>>
>> As you can see in the section 2.2 of the graphics manual (
>> http://www.ncl.ucar.edu/Document/Manuals/) there are some changes between
>> graphics generated with *gsn_** functions and those generated with *
>> gsn_csm** functions.
>>
>> Please, take a look in that sections of the graphics manual.
>>
>> Best regards,
>>
>> Mateus
>>
>>
>>
>>
>> 2011/5/26 Sabeerali(sebi) <sabeerl@gmail.com>
>>
>>> Dear NCL users,
>>>
>>> I used the function "gsn_vector" to plot the jjas mean Hadley
>>> circulation and I got the correct plot. But to have more control over the
>>> plot ( I have to get coordinate in X and Y), i used the "gsn_csm_vector"
>>> function. But in this case I getting a different plot. Why this difference
>>> is coming and what is the solution? In the following script I changed only
>>> gsn_vector to gsn_csm_vector.Any help would be greatly appreciated.
>>>
>>> I used the ncep v wind and omega. For scaling I multiplied the omega with
>>> -100
>>>
>>> Thanks in advance
>>> sabeer
>>>
>>> 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"
>>> begin
>>> wf=addfile("mon.omega.nc","r")
>>> vf=addfile("mon.vwnd.nc","r")
>>>
>>> date=ut_calendar((wf->time),-5)
>>> month=date(:,1)
>>> jjas_indx=ind(month.eq.06.or.month.eq.07.or.month.eq.08.or.month.eq.09)
>>>
>>> w=short2flt(wf->omega(jjas_indx,:,::-1,{68:80}))
>>> v=short2flt(vf->vwnd(jjas_indx,:,::-1,{68:80}))
>>>
>>> jjas_w=dim_avg_n_Wrap(w(:,:,{-30:30},:),0)
>>> jjas_v=dim_avg_n_Wrap(v(:,:,{-30:30},:),0)
>>>
>>> jjas_w_lonavg=dim_avg_n_Wrap(jjas_w,2)
>>> jjas_v_lonavg=dim_avg_n_Wrap(jjas_v,2)
>>>
>>> ws=jjas_w_lonavg*-100
>>> copy_VarCoords(jjas_w_lonavg,ws)
>>>
>>> wks=gsn_open_wks("x11","hadley")
>>> gsn_define_colormap(wks,"gui_default")
>>> res = True
>>> res@tiMainString = ""
>>> res@gsnSpreadColors = True
>>> res@vcRefMagnitudeF = 7.0
>>> res@vcRefLengthF = 0.045
>>> res@vcMonoLineArrowColor = False
>>> res@vcGlyphStyle = "CurlyVector"
>>>
>>> ;;plot = gsn_vector(wks,jjas_v_lonavg,ws,res)
>>>
>>> plot=gsn_csm_vector(wks,jjas_v_lonavg,ws,res)
>>>
>>> end
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>>
>> --
>> Mateus da Silva Teixeira
>> Registered Linux User #466740 (http://counter.li.org/)
>>
>>
> _______________________________________________
> 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 Thu May 26 22:41:28 2011

This archive was generated by hypermail 2.1.8 : Wed Jun 01 2011 - 12:41:15 MDT