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

Home » Public Forums » archive » making a checkerboard 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: making a checkerboard array? [message #56021 is a reply to message #55935] Tue, 25 September 2007 15:07 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
David Fanning wrote:
> JD Smith writes:
>
>
>>> I'm trying to make a checkerboard mask for an array, but I'm missing
>>> something that is likely to be obvious to the IDL array masters.
>>
>> l=lindgen(nx,ny)
>> l=(l mod (xside*2) lt xside) XOR (l/nx mod (yside*2) ge yside)
>
>
> Well, uh, it's not obvious to me. :-(
>
> Cheers,
>
> David
IDL> nx=20
IDL> ny=20
IDL> l=lindgen(nx,ny)
IDL> l=(l mod (nx*2) lt nx) XOR (l/nx mod (ny*2) ge ny)
IDL> print,l
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Parsing C -> Generating DLL/DLM
Next Topic: selection box in widget program

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

Current Time: Thu Oct 09 21:34:24 PDT 2025

Total time taken to generate the page: 0.00610 seconds