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

Home » Public Forums » archive » Re: array subscripting problem
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: array subscripting problem [message #43425 is a reply to message #43423] Mon, 11 April 2005 06:38 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Martin Doyle writes:

> I've got a gridded dataset and I'm searching the grid trying to find
> those points which have a certain value. Once I've found this point, I
> want to check all points around it to see if they have the same value
> plus a little bit. This is what I've come up with:
>
> If (data(i,j,k) GE p) THEN begin
>
> cd = data(i,j,k)
>
> If(ABS(cd-data[i-1,j-1,k]) LE mg) then f = f+1
> If(ABS(cd-data[i, j-1,k]) LE mg) then f = f+1
> If(ABS(cd-data[i+1,j-1,k]) LE mg) then f = f+1
> If(ABS(cd-data[i-1,j, k]) LE mg) then f = f+1
> If(ABS(cd-data[i+1,j, k]) LE mg) then f = f+1
> If(ABS(cd-data[i-1,j+1,k]) LE mg) then f = f+1
> If(ABS(cd-data[i, j+1,k]) LE mg) then f = f+1
> If(ABS(cd-data[i+1,j+1,k]) LE mg) then f = f+1
>
> endif
>
> However, array subscripting with negative numbers isn't allowed by
> IDL.
>
> Has anyone any ideas how I might get around this?

array[0 > j]

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: vector matrix multipication
Next Topic: Re: vector matrix multipication

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

Current Time: Sat Oct 11 20:42:06 PDT 2025

Total time taken to generate the page: 1.08403 seconds