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

Home » Public Forums » archive » IDL Way to have a single row/collum act on all rows/collums in an 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
IDL Way to have a single row/collum act on all rows/collums in an array [message #89540] Fri, 24 October 2014 07:32 Go to previous message
JTMHD is currently offline  JTMHD
Messages: 9
Registered: October 2014
Junior Member
Hi Guys,


What I am trying to do is analogous to the following

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
timedistancearray =FINDGEN(3,3)

timezero = timedistancearray(*,0)

timedistance_minustimezero = FLTARR(3,3)

FOR t=0,2 DO timedistance_minustimezero(*,t)=timedistancearray(*,t)-timez ero
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


The thing is in this case the array is HUGE so I don't think the FOR loop would be optimum.

The other thing I thought about was taking the timezero array and changing it into a 2D array of the correct dimensions, e.g.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;

timedistancearray =FINDGEN(3,3)

timezero = timedistancearray(*,0)#MAKE_ARRAY(1, 3, /DOUBLE, VALUE = 1D0)

timedistance_minustimezero = timedistancearray-timezero

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;

But again, this perhaps isn't ideal as it will involve creating an equally huge array to do the operation which will have add to the memory overhead.

I keep hearing that if you want to get good at IDL you have to exploit the array operations properly - what other options do I have here?

Thanks in advance

Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to choose the Language of IDL Workbench on mac os
Next Topic: rescaling draw widgets: is there an easier solution to this?

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

Current Time: Wed Oct 08 16:15:13 PDT 2025

Total time taken to generate the page: 0.00181 seconds