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

Home » Public Forums » archive » Re: XY position of subscripts
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: XY position of subscripts [message #80182 is a reply to message #80181] Fri, 11 May 2012 08:36 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den fredagen den 11:e maj 2012 kl. 17:14:27 UTC+2 skrev KH:
> Hello,
> I have a quick question I was hoping to get some help with.
>
> Assuming you have a 2D array and then use WHERE to find specific
> subscripts in the array, how can you convert those subscripts into X
> and Y coordinates?
>
> I feel like this is something I should know how to do, but I am
> drawing a blank right now.
> Thanks,
> Kim

Here's an example:

IDL> Ni=10
IDL> Nj=20
IDL> A=bytarr(Ni,Nj)
IDL> A[4,7]=1
IDL> indx=where(A eq 1)
IDL> print,A[indx mod Ni, indx / Ni]
1
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scalar system variable as single element array
Next Topic: cgplot and the disappearing white axis

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

Current Time: Wed Dec 03 01:01:33 PST 2025

Total time taken to generate the page: 8.41675 seconds