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

Home » Public Forums » archive » Re: Incremental variable names?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Incremental variable names? [message #37888 is a reply to message #37872] Mon, 02 February 2004 21:46 Go to previous messageGo to previous message
Jonathan Greenberg is currently offline  Jonathan Greenberg
Messages: 91
Registered: November 2002
Member
I should get in the practice of not making "examples" of what I want to do
and just come out and say it:

OK, from a previous email we were discussing extracting "rings" of data from
an image to calculate a semivariance for each pixel in the image. The
previous suggestions helped a lot in optimizing how to extract the data from
the array (use where + an array of index values of the ring locations offset
from the center pixel).

I'm trying to optimize this algorithm for use with large images. ENVI/IDL
work well if you extract a single line of an image at a time (line = y axis,
by the way). For a circular mask, however, I'd need to extract at least as
many lines as the maximum circular diameter (e.g. If my circle is 3 pixels
in radius, I need to pull out 7 lines of data to figure out the values along
the ring).

It occurred to me (and tell me if I'm wrong), that while I CAN extract the
line I'm working on +/- 3 lines from the image each time, this seems like an
awful waste of I/O, when in reality the next line will use all but one of
the previous extracted rows (e.g. I just need to read the next line in, and
delete the current top line to free up memory). Creating arrays of the
lines would require rewriting the arrays each time (e.g. Arraynew =
(arrayold(2:7),newline) -- I know this isn't idl code, but you get the idea)
which seems slower than just having 7 named variables
(line1,line2,...line7), doing my calculation, then deleting line1, and
adding line8 and repeating.

No? Is there a better way of "preserving" the data I've already read from
the HD than using incremental variable names?

--j



On 2/2/04 1:45 PM, in article
df160b8f.0402021345.25b58a8@posting.google.com, "Big Bird"
<condor@biosys.net> wrote:

> Jonathan Greenberg <greenberg@ucdavis.edu> wrote in message
> news:<BC430FE2.18E9C%greenberg@ucdavis.edu>...
>> Have a question about variable names. Is there any way to create and then
>> call variable names that have some incremental value in them, e.g.:
>>
>> t0
>> t1
>> t2
>>
>> Etc... I want to be able to first create and assign a value to tn where n =
>> 0 to whatever, and then be able to subsequently call that variable using a
>> loop.
>>
>
>
> OK, now tell us what you REALLY want to do. ;-)
>
> As it is written up there, there doesn't exactly seem to be a reason
> not to use an array for your variables -- instead of tn you write t[n]
> and that's pretty much it.
>
> I assume that there's a reason for you not to do things that way.
>
> Now while there is certainly the possibility to use EXECUTE, I'd be
> surprised if tehre weren't some cleverer way to do whatever you're
> trying to do and I'm sure a lot of people would be happy to tell you
> about that way if we had a little more information at hand ...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: object graphics question
Next Topic: Re: Virtual Machine Crashes :-(

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

Current Time: Fri Oct 10 13:40:07 PDT 2025

Total time taken to generate the page: 0.62668 seconds