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

Home » Public Forums » archive » Re: For loop avoidance - getting indices of real space
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: For loop avoidance - getting indices of real space [message #81155 is a reply to message #81151] Fri, 24 August 2012 07:41 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le vendredi 24 août 2012 16:25:03 UTC+2, simu...@gmail.com a écrit :
> On Friday, August 24, 2012 5:32:05 AM UTC-4, alx wrote:
>
>> Le jeudi 23 août 2012 22:58:48 UTC+2, simu...@gmail.com a écrit :
>
>>
>
>> If I understand well your problem, a solution might be:
>
>>
>
>>
>
>>
>
>> IDL> coord = [ [lindgen(xcells)#replicate(1,ycells*zcells)], $
>
>>
>
>> IDL> [lindgen(ycells)#replicate(1,xcells*zcells)], $
>
>>
>
>> IDL> [lindgen(zcells)#replicate(1,xcells*ycells)] ]
>
>>
>
>> IDL> coord = reform(coord,ncells,3,/OVER)
>
>>
>
>>
>
>>
>
>> alain.
>
>
>
>
>
> This seems like a great idea, but IDL won't let me concatenate arrays like this. The above produces the error message:
>
>
>
> % Unable to concatenate variables because the dimensions do not agree: <LONG Array[10,300]>.
>
>
>
> Can you think of another way to form those coordinates?
>
>
>
> Thanks,
>
>
>
> Christina

Sorry, I missed one step: I should have rather written:

IDL> coord = [ reform([lindgen(xcells)#replicate(1,ycells*zcells),ncells]), $
IDL> reform([lindgen(ycells)#replicate(1,xcells*zcells)],ncells), $
IDL> reform([lindgen(zcells)#replicate(1,xcells*ycells)],ncells) ]

alain.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How would you measure the range of density on a graph using IDL?
Next Topic: Re: image interplate and overlay lat/lon?

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

Current Time: Wed Oct 08 19:37:03 PDT 2025

Total time taken to generate the page: 0.00408 seconds