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

Home » Public Forums » archive » Re: Indices ?
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: Indices ? [message #41920 is a reply to message #41918] Wed, 01 December 2004 04:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pepe writes:

> On this very newsgroup Matt McCabe once wrote: " I always get nervous
> posting to this site for fear of asking a particularly stupid
> question....well, here goes."
>
> Well, let me say that I feel the very same way...

Oh, well, fear. We'd probably all be better off never getting
out of bed. :-)

> I have the following situation:
> a = fltarr(x, y) ;say satellite sea surface temperature data
> b = fltarr(x) ;say the longitude points of the grid
> c = fltarr(y) ;say the latitude points of the grid
>
> data_valid = where(a GT 0.0) ;search for the valid sst values
>
> I need to know the longitude "b(lon_valid)" and latitude
> "c(lat_valid)" points of the valid sst values "a(data_valid)".
> How can I get to them ?

It is not totally clear to me exactly why you think
you need them. There will certainly be points on an
X grid (for example) that contain both valid and
invalid points. So, I can't see that having a(data_valid)
would be very helpful in any particular application
that I can envision.

But that said, you can turn your 1-D subscripts
into, for example, column and row subscripts by using
any of the routines mentioned on this newsgroup over
the years, for example:

http://www.dfanning.com/tips/where_to_2d.html

Or, just use the built-in IDL routine ARRAY_INDICES:

r = Array_Indices(data_valid)
col_indices = Reform(r[0,*])
row_indices = Reform(r[1,*])

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
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL and Intel's 64-bit Xeon processor
Next Topic: Re: Problems when printing ps plots from C

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

Current Time: Sun Oct 12 04:43:31 PDT 2025

Total time taken to generate the page: 7.83543 seconds