Re: IDL Voodoo Experts Needed [message #19040] |
Wed, 23 February 2000 00:00 |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
David Fanning wrote:
> I violated the first rule of technical support: Don't
> take the question literally. Try to figure out what the
> user wants to *do*.
It happens to me all the time. Someone comes into my office and says
"Why doesn't XYZ work in IDL?". I have learned that the first thing to
do is disregard XYZ, and ask them "What are you trying to do?".
Cheers,
Liam.
|
|
|
Re: IDL Voodoo Experts Needed [message #19043 is a reply to message #19040] |
Wed, 23 February 2000 00:00  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
David Fanning wrote:
> Since I *really* have to work on taxes and other financial
> matters this morning (snip-snip)
Oh, boy. David, are you sure you want to start on taxes in this kind of
shape? We can't afford loosing you to the IRS! Maybe, do the taxes
tomorrow, just drink beers today?
Cheers,
Pavel
|
|
|
Re: IDL Voodoo Experts Needed [message #19045 is a reply to message #19040] |
Wed, 23 February 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Liam E.Gumley (Liam.Gumley@ssec.wisc.edu) writes:
> I think you're looking for a multi-dimensional array of structures:
>
> IDL> layer = {layer, i:0, e:0.0, p:0.0, rho:0.0}
> IDL> nlayers = 40
> IDL> ntimesteps = 100
> IDL> evolution = replicate(layer, nlayers, ntimesteps)
> IDL> help, evolution
> EVOLUTION STRUCT = -> LAYER Array[40, 100]
> IDL> help, evolution[0, 0], /structure
> ** Structure LAYER, 4 tags, length=16:
> I INT 0
> E FLOAT 0.000000
> P FLOAT 0.000000
> RHO FLOAT 0.000000
>
> Am I missing something?
Duh, do you think!? :-(
I violated the first rule of technical support: Don't
take the question literally. Try to figure out what the
user wants to *do*. And probably for the same reason most
technical support people violate it: too little time to do
too much stuff on too little sleep.
Thanks, Liam.
Cheers,
David
P.S. Let's just say a second pot of coffee is brewing now.
--
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
|
|
|
Re: IDL Voodoo Experts Needed [message #19046 is a reply to message #19040] |
Wed, 23 February 2000 00:00  |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
David Fanning wrote:
> Alright, here is an example of what I wake up to each
> morning, which might go a long way toward explaining why
> I never get any productive work done. A fellow writes me
> (this inevitably happens) on a topic we discussed just
> a couple of days ago. Namely, he wants to create an
> array of arrays--BUT, the original array is an array
> of structures.
>
> He puts the problem like this:
>
> Is it possible to create an array of arrays of structures?
> This does not work:
>
> l={layer,I:0,E:0.0,p:0.0,rho:0.0} ;STRUCT DEFINITION
> volume=replicate(l,layernum) ;ARRAY OF STRUCTURES
> evolution=replicate(volume,timesteps) ;ARRAY OF ARRAYS OF STRUCTURES
>
> I tried Craig Markwardt's CMReplicate program and the REBIN/REFORM
> voodoo offered by Liam Gumley and Bill Thompson, but all to no
> effect. All complain about structures.
>
> Since I *really* have to work on taxes and other financial
> matters this morning, and since I notice quite a few more
> willing bodies around here than we used to have, I'm turning
> this one over to the real experts. Any ideas? :-)
I think you're looking for a multi-dimensional array of structures:
IDL> layer = {layer, i:0, e:0.0, p:0.0, rho:0.0}
IDL> nlayers = 40
IDL> ntimesteps = 100
IDL> evolution = replicate(layer, nlayers, ntimesteps)
IDL> help, evolution
EVOLUTION STRUCT = -> LAYER Array[40, 100]
IDL> help, evolution[0, 0], /structure
** Structure LAYER, 4 tags, length=16:
I INT 0
E FLOAT 0.000000
P FLOAT 0.000000
RHO FLOAT 0.000000
Am I missing something?
Cheers,
Liam.
---
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|