comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: plot structured data II
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: plot structured data II [message #24133] Wed, 14 March 2001 01:55
dw is currently offline  dw
Messages: 10
Registered: February 2001
Junior Member
<Dear all,
<sorry for being unprecise last time.
<What I like to know is how to get access to the data in the structure or
<as David Fanning already said how to tear that structure apart and get a
<2d array for further use.
<The data in the structure is already gridded and I know how to use
<surface function but until now I can't find information how to use it
<with structured data sets.
<thanks a lot
<
< Dirk

Hi Dirk,

I got some help from Dave Fanning yesterday because I was trying to extract
an image from a structure so I could plot it.
In my particular case Dave suggested:

info.thisWindow->GetProperty, Image_Data=snapshot

and then you can use

Write_JPEG, filename, snapshot, True=1

to write the jpeg.

Here the display window object is in the 'info' structure and named
"thisWindow"

Don't know if this is helpful for you?
Dorthe



--
Posted from mail.isva.dtu.dk [192.38.88.3]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Re: plot structured data II [message #24159 is a reply to message #24133] Mon, 12 March 2001 07:35 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
David Fanning wrote:
>
> Dirk Burose (dirk.burose@uni-bonn.de) writes:
>
>> sorry for being unprecise last time.
>> What I like to know is how to get access to the data in the structure or
>> as David Fanning already said how to tear that structure apart and get a
>> 2d array for further use.
>> The data in the structure is already gridded and I know how to use
>> surface function but until now I can't find information how to use it
>> with structured data sets.
>> thanks a lot
>
> Structures are de-referenced with a "dot". You want
> something like this:
>
> Surface, struct.mydata, struct.my_xvector, struct.my_yvector
>
> Sometimes structures have structures inside them. Then you
> use two dots, etc.:
>
> Surface, struct.mydata.grid, struct.mydata.xvec, struct.mydata.yvec

And sometimes you are using structures entirely inappropriately, like
when you really want an array instead, but are using read_ascii to get
it out of file. You might try crafting your own formatted read and
avoid read_ascii altogether, reading it directly into a 15xn array.
It's really pretty simple.

Read_ascii is best for multi-variable plots, not higher dimensional
data. If you are really stuck with a structure of fields with columns
of data the same length, and you'd like to convert it to a 2d array,
try:

for i=0,n_tags(st)-1 do $
if n_elements(a) eq 0 then a=1#st.(i) else a=[a,1#st.(i)]

But really, a better solution is to use the correct data type in the
first place.

Good luck,

JD
Re: plot structured data II [message #24160 is a reply to message #24159] Mon, 12 March 2001 07:05 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Dirk Burose (dirk.burose@uni-bonn.de) writes:

> sorry for being unprecise last time.
> What I like to know is how to get access to the data in the structure or
> as David Fanning already said how to tear that structure apart and get a
> 2d array for further use.
> The data in the structure is already gridded and I know how to use
> surface function but until now I can't find information how to use it
> with structured data sets.
> thanks a lot

Structures are de-referenced with a "dot". You want
something like this:

Surface, struct.mydata, struct.my_xvector, struct.my_yvector

Sometimes structures have structures inside them. Then you
use two dots, etc.:

Surface, struct.mydata.grid, struct.mydata.xvec, struct.mydata.yvec

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: GIF compression support in ImageMagick
Next Topic: Re: converting to array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:35:57 PDT 2025

Total time taken to generate the page: 0.00615 seconds