[ncl-talk] plot masked vectors

Adam Phillips asphilli at ucar.edu
Thu May 31 10:45:56 MDT 2018


Hi Michele,
You are correct, vcMinMagnitudeF seemingly is not applied when vcGlyphStyle
= "CurlyVector". (It should state that in the documentation.) The likely
reason for this is that CurlyVectors use information from neighboring grids
to draw the vector. If neighboring vectors are missing, the vector might
not be drawn.

I'm modified vector_6.ncl to show what is happening. If you are happy with
vcGlyphStyle = "LineArrow", you can use vcMinMagnitudeF as you can see in
the first panel. For the third panel, I calculated the magnitude of the
vector, and used where to mask those values beneath a threshold. Note that
less vectors are draw in panel 3 than in panel 1, and that's because of
CurlyVector needing neighboring grid cells. Thus, you will want to play
with the where threshold for masking.

Hope that helps. If you have further questions let ncl-talk know.
Adam

On Thu, May 31, 2018 at 3:22 AM, Michele Petrini - CITG <
M.Petrini at tudelft.nl> wrote:

> Hi Adam,
>
> thank you for the reply.
>
> However, even setting the resource I don’t get rid of the tiny vectors.
> Below the resources I set for vector plot
>
>
>         res_vc                            = res
>
>         res_vc at vcRefMagnitudeF           = 20.             ; define
> vector ref mag
>         res_vc at vcRefLengthF              = 0.01          ; define length
> of vec ref
>         res_vc at vcRefAnnoArrowLineColor   = "black"         ; change ref
> vector color
>         res_vc at vcRefAnnoArrowUseVecColor = False           ; don't use
> vec color for ref
>         res_vc at vcGlyphStyle            = "CurlyVector"     ; turn on
> curly vectors
>         res_vc at vcLineArrowColor        = "white"           ; change
> vector color
>         res_vc at vcLineArrowThicknessF   = 2.5           ; change vector
> thickness
>         res_vc at vcVectorDrawOrder       = "Draw"        ; draw vectors last
>         res_vc at tfDoNDCOverlay         = True
>         res_vc at vcMinDistanceF             = 0.017
>         res_vc at vcMinFracLengthF         = 0.0
> res_vc at vcMinMagnitudeF            = 300.
>
> any thoughts?
>
> thanks!
>
> ******************************************************************
> Michele Petrini, PhD
>
> Department of Geoscience and Remote Sensing, TUDelft
> Delft, The Netherlands
>
> M.Petrini at tudelft.nl
> +39 3398367372
> michele.petrins (Skype alias)
>
>
>
> On 31 May 2018, at 00:48, Adam Phillips <asphilli at ucar.edu> wrote:
>
> Hi Michele,
> Yes there is. Try setting vcMinMagnitudeF:
> http://www.ncl.ucar.edu/Document/Graphics/Resources/
> vc.shtml#vcMinMagnitudeF
>
> Three examples use this resource:
> http://www.ncl.ucar.edu/Applications/res_list.shtml#vcMinMagnitudeF
>
> Hope that helps!
> Adam
>
>
>
> On Wed, May 30, 2018 at 4:38 PM, Michele Petrini - CITG <
> M.Petrini at tudelft.nl> wrote:
>
>> Dear helpdesk,
>>
>> I am trying to plot velocity vectors over a contour (+other stuff, see
>> attached pdf).
>>
>> I have a question, is there a way to mask out the small vectors and leave
>> only velocity vectors exceeding some threshold (let’s say 100 m/yr)?
>>
>> If I try to mask the u/v variables, I get an error.
>>
>> Looking on the internet, I see that there is someone suggesting to
>> overlay two vector contours, but the procedure seems to be a little bit
>> complicated, and I wonder if there exists a simpler way,..
>>
>> thanks!
>> Michele
>>
>>
>> ******************************************************************
>> Michele Petrini, PhD
>>
>> Department of Geoscience and Remote Sensing, TUDelft
>> Delft, The Netherlands
>>
>> M.Petrini at tudelft.nl
>> +39 3398367372
>> michele.petrins (Skype alias)
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/8b7b80ae/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector_6.ncl
Type: text/x-ncl
Size: 2016 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/8b7b80ae/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector.png
Type: image/png
Size: 324180 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180531/8b7b80ae/attachment-0001.png>


More information about the ncl-talk mailing list