Re: streamline plot with stUseScalarArray = True

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 5 Sep 2007 10:34:49 -0600 (MDT)

Hi Radovan,

I need to make a correction here. Dave Brown, who's the technical
lead for our Python software, pointed out that he had implemented
a similar feature for streamlines that we have for vectors,
which allows you to color the streamlines based on a separate
scalar field.

The problem is that we don't have an equivalent Ngl.streamline_scalar
or Ngl.streamline_scalar_map function to do this. I will implement one
shortly and provide you with a copy.

--Mary

On Wed, 5 Sep 2007, Mary Haley wrote:

> Hi Radovan,
>
> Sorry for the late response. We had a burst of consulting activity
> yesterday. I guess everybody came back from vacation and had
> immediate software questions. :-)
>
> Anyway, you can't color streamlines according to another field like
> you can with vectors. So, how about instead using curly vectors, and
> then coloring according to a third field that way? The functions to
> use are Ngl.vector_scalar, or Ngl.vector_scalar_map if you want to do
> this over a map.
>
> We have some examples of this. Go to:
>
> http://www.pyngl.ucar.edu/Examples/gallery.shtml
>
> and look at examples ngl03p and ngl06p, and vector_pop. These examples
> don't have curly vectors, but this can easily be remedied by setting
> the "vcGlyphStyle" resource to "CurlyVector". (See vector_pop.py on
> the same page for an example of curly vectors.)
>
> Let me know if this is not the solution you were hoping for.
>
> --Mary
>
>
> On Tue, 4 Sep 2007, radovan bast wrote:
>
>> dear all,
>>
>> first, please let me thank the pyngl/ncl developers for their great work!
>>
>> i would like to plot a streamline plot where the coloring
>> uses a scalar data array.
>> for instance i manage to plot the streamline plot with:
>>
>> plot = Ngl.streamline(wks, u_array, v_array, resources)
>>
>> and now i would like to color the streamlines according to one vector
>> component (i.e. the v_array) or another 2d array
>>
>> i understand that i must specify:
>>
>> resources.stMonoLineColor = False
>> resources.stUseScalarArray = True
>>
>> but how can i specify how/which scalar data array has to be used for the
>> coloring?
>>
>> since i don't i get:
>>
>> warning:StreamlinePlotInitialize: No scalar data: using streamline
>> magnitude for levelsa
>> and pyngl colors according to the norm of the vector
>>
>> the manual indicates: the resource stScalarFieldData is [to be] set with a
>> valid ScalarField object
>> i don't know how this can be done in practice and i would be very grateful
>> for every hint.
>>
>> best greetings,
>>
>>
>> radovan
>> _______________________________________________
>> pyngl-talk mailing list
>> pyngl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Sep 05 2007 - 10:34:49 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 07 2007 - 11:01:08 MDT