Re: How to use stScalarFieldData?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 05 2010 - 15:21:55 MST

Hi Christian,

This is a case where we don't have any examples that use this special
resource.

As Rick pointed out, you can go a little deeper than the gsn_xxx
codes to get this
to work.

It made me realize that we have the gsn_xxx_vector_scalar_xxxx
functions, but
no corresponding gsn_xxx_streamline_scalar_xxx functions.

I don't have time right now to do the full gsn_csm_xxxx version of
these routines,
but I was able to quickly create gsn_streamline_scalar and
gsn_streamline_scalar_map,
if you want to give these a try. Internally, they use
stScalarFieldData and set
stUseScalarArray to True, causing the streamlines to be colored by
the given
scalar field.

I'm attaching the code (streamline_scalar.ncl), two test scripts
(stream_test1.ncl and
stream_test2.ncl), and a sample data file (uvtest.nc).

Let me know if this is not what you want.

--Mary

On Mar 5, 2010, at 5:18 AM, Christian Pause wrote:

> Hi again,
>
> I want to use the stScalarFieldData ressource in a streamline-plot.
> However stScalarFieldData is of the type NhlTInteger, and the
> reference
> guide says:
>
> "Specifies the id of a ScalarField data object. If this resource is
> set
> with a valid ScalarField object and the resource stUseScalarArray
> is set
> True, StreamlinePlot will use the scalar array data for coloring the
> streamlines. In order for StreamlinePlot to consider the ScalarField
> object valid, it must find that it has the same number of elements
> along
> each dimension as are found in the VectorField object."
>
> The scalar field I specified is valid so far, but what is that id
> of the
> field it wants?
> I only have name of the array which obviously is of the type
> character and
> not integer, so how do I get that id?
>
> Greetings
> Christian
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 5 15:22:38 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 08 2010 - 12:07:42 MST