Re: problems with contouring in a for loop [message #40838] |
Thu, 02 September 2004 03:45 |
maarten
Messages: 30 Registered: April 2002
|
Member |
|
|
Mick Pope wrote:
> Hi David,
>
> there seems to be a problem if I had an array and I want to contour say
> array(0,*,*). If I plot this outside of the loop by specifying my ith
> position explicityly, and then loop from 1,n-1 then I am ok! Wierd.
>
> I've also had issues doing the following
>
> plot a map projection
> plot shaded contours
> plot line contours
> plot the map again (since it is erased - even with /noerase)
>
> Finally, by using /advance and !p=, etc... I worked it out! Nothing
> complicated is ever simple!
>
> Cheers
>
> Mick....
>
> "David Fanning" <davidf@dfanning.com> wrote in message
> news:MPG.1ba034286801fbf2989876@news.frii.com...
>
>> Mick Pope writes:
>>
>>
>>> I have this wierd problem with for loops. I have a 3D array of data and
>>
> I
>
>>> want to plot 2D slices using a for loop and then contour the array.
>>
> Guess
>
>>> what - it tells me that Array dimensions must be greater than 0.
>>>
>>> So I take a 2D array and substitute it for my reduced 3D array, inside
>>
> the
>
>>> for loop. Same error message!!!!!
>>>
>>> What gives?
>>
>> I'd guess you have an extra dimension of 1 hanging
>> around, but it is hard to say without seeing some code.
>> A "HELP, array2D" before the contour command might
>> help. :-)
>>
>> Cheers,
>>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>
>
A simple contour( reform(array[i,*,*]) ) should do the trick.
good luck, maarten
|
|
|
Re: problems with contouring in a for loop [message #40841 is a reply to message #40838] |
Wed, 01 September 2004 22:39  |
Mick Pope
Messages: 4 Registered: March 2003
|
Junior Member |
|
|
Hi David,
there seems to be a problem if I had an array and I want to contour say
array(0,*,*). If I plot this outside of the loop by specifying my ith
position explicityly, and then loop from 1,n-1 then I am ok! Wierd.
I've also had issues doing the following
plot a map projection
plot shaded contours
plot line contours
plot the map again (since it is erased - even with /noerase)
Finally, by using /advance and !p=, etc... I worked it out! Nothing
complicated is ever simple!
Cheers
Mick....
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1ba034286801fbf2989876@news.frii.com...
> Mick Pope writes:
>
>>
>> I have this wierd problem with for loops. I have a 3D array of data and
I
>> want to plot 2D slices using a for loop and then contour the array.
Guess
>> what - it tells me that Array dimensions must be greater than 0.
>>
>> So I take a 2D array and substitute it for my reduced 3D array, inside
the
>> for loop. Same error message!!!!!
>>
>> What gives?
>
> I'd guess you have an extra dimension of 1 hanging
> around, but it is hard to say without seeing some code.
> A "HELP, array2D" before the contour command might
> help. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: problems with contouring in a for loop [message #40843 is a reply to message #40841] |
Wed, 01 September 2004 19:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mick Pope writes:
>
> I have this wierd problem with for loops. I have a 3D array of data and I
> want to plot 2D slices using a for loop and then contour the array. Guess
> what - it tells me that Array dimensions must be greater than 0.
>
> So I take a 2D array and substitute it for my reduced 3D array, inside the
> for loop. Same error message!!!!!
>
> What gives?
I'd guess you have an extra dimension of 1 hanging
around, but it is hard to say without seeing some code.
A "HELP, array2D" before the contour command might
help. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|