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

Home » Public Forums » archive » Re: subset a 2d array
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: subset a 2d array [message #61932 is a reply to message #61931] Thu, 14 August 2008 07:54 Go to previous messageGo to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Aug 13, 10:53 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> hmmm... The problem is I have a array like 240*500. And all the
>> values are different. And I do not know the row and column. I only
>> know the center value should be 2.5 . Then ,how can I do that? :)
>
> index = Where(array EQ 2.5, count)
> xy = array_indices(array, index[0])
> subarray = array[xy[0]-1:xy[0]+1, xy[1]-1:xy[1]+1]
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

hoho, Thank you very much~ David~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to preserve trailing Shallow dimensions!
Next Topic: Need help with an Iterative solution in IDL (relative newb question)

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

Current Time: Sat Oct 11 14:31:09 PDT 2025

Total time taken to generate the page: 0.88341 seconds