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

Home » Public Forums » archive » Re: problems with contouring in a for loop
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: problems with contouring in a for loop [message #40838] Thu, 02 September 2004 03:45
maarten is currently offline  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 Go to previous message
Mick Pope is currently offline  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 Go to previous message
David Fanning is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Hot key using in Xmanager V2.0
Next Topic: Connection Matlab-IDL

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

Current Time: Wed Oct 08 18:13:29 PDT 2025

Total time taken to generate the page: 0.00595 seconds