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

Home » Public Forums » archive » The continuing saga of WHERE and 2D
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
The continuing saga of WHERE and 2D [message #34243] Thu, 27 February 2003 12:37 Go to next message
Sean Raffuse is currently offline  Sean Raffuse
Messages: 46
Registered: July 2001
Member
Ok, so I've found the nifty little WhereToMulti program that converts 1D
where() results back to the original 2d or 3d indices. My question, and I
am sensing that it is a dumb one, is how can I use these returned indices
properly?

Example:

;the part that works (stolen wholesale from D Fanning's website)
index = WHERE(image EQ test)
s = SIZE(image)
ncol = s(1)
col = index MOD ncol
row = index / ncol

;the part I am confused about
image[col, row] = PassedTheTest

*** Error, too many elements in array. . . and you're ugly. ***

Thanks in advance,

Sean
Re: The continuing saga of WHERE and 2D [message #34282 is a reply to message #34243] Sun, 02 March 2003 16:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst (paul.vandelst@noaa.gov) writes:

> Are you going to transplant JD's analysis to your webpage? (please) [*]

Interestingly enough, Dick Jackson has reported this phenomenon
with array subscripting taking a LOT of memory back in October
and I had written an article about that then. I guess we *all*
have to spend more time reading those articles. :-(

Anyway, I've updated that article with this new take on
the same problem. If I see it one more time, even I'll probably
begin to recognize it.

http://www.dfanning.com/misc_tips/submemory.html

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: The continuing saga of WHERE and 2D [message #34312 is a reply to message #34243] Fri, 28 February 2003 11:52 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 28 Feb 2003 11:15:11 -0700, Pavel Romashkin wrote:

> Hi JD,
> Is the same kind of allocation taking place when one simply calls
> FLTARR? I bet yes.
> I am still puzzled by the fact I can allocate 1.25 times more in the
> form of pointer arrays than as a single large array, like
>
> a = FLTARR(290000000) ; This is the limit, out of RAM over this (1.32
> Gb) a = PTRARR(3600, /allocate)
> temp = FLTARR(100000)
> for i = 0, 3599 do *a[i] = temp ; No problem at all
>

I'd go with the fragmentation argument. If so, this should be
independent of pointer use. You could, e.g., assign a different
variable name to each small array (execute comes to mind). The
system's memory allocator might not be pleased to give you a single
chunk of 1.32GB, but still be happy to hand out 100 chunks of 13.2 MB.

What if you repeat this a series of times, gradually reducing the
number of pointers to 1, while preserving the total memory allocated?
I'd bet it would slowly converge on the single-block limit, with fits
and starts as you pass awkward memory sizes.

JD
Re: The continuing saga of WHERE and 2D [message #34314 is a reply to message #34243] Fri, 28 February 2003 10:42 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
>
> Paul van Delst (paul.vandelst@noaa.gov) writes:
>
>> Are you going to transplant JD's analysis to your webpage? (please) [*]
>
> Oh, probably. I find myself completely unemployed at
> the moment and it has gotten so bad I've even started
> working on that object book. So I need something to keep
> me away from that hard work. :-)
>
> And, anyway, the only alternative this morning seems
> to be fixing a stopped-up toilet (oh, joy!) or scrubbing
> the carpets where the dogs tracked mud in last night.

Wow. Last night I left work early to mop up water leaking from stopped up bathtub pipes
(so the plumber didn't burn himself due to the caustic-y liquid plumr in the
water...ehem.) and to clean up dry cat puke from the rug. We seem to have a temporary
convergence of some sort...except I was glad to leave my "sit in front of computer"
work..... :o)

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
Re: The continuing saga of WHERE and 2D [message #34315 is a reply to message #34243] Fri, 28 February 2003 10:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst (paul.vandelst@noaa.gov) writes:

> Are you going to transplant JD's analysis to your webpage? (please) [*]

Oh, probably. I find myself completely unemployed at
the moment and it has gotten so bad I've even started
working on that object book. So I need something to keep
me away from that hard work. :-)

And, anyway, the only alternative this morning seems
to be fixing a stopped-up toilet (oh, joy!) or scrubbing
the carpets where the dogs tracked mud in last night.

Sigh....

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@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: Random spherical distributions
Next Topic: Import .RAW data from Siemens/BrukerAXS DiffracPlus Software?

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

Current Time: Sun Oct 12 10:58:52 PDT 2025

Total time taken to generate the page: 0.95869 seconds