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

Home » Public Forums » archive » How can I optimize this?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How can I optimize this? [message #62616] Thu, 18 September 2008 02:46
hldevil is currently offline  hldevil
Messages: 6
Registered: September 2008
Junior Member
Hi,

I'm looking for a way of optimizing a chunk of IDL code. The following
code snippet is part of a larger program. What it does is basically
test in some Anti-Coincidence Tables if a certain threshold energy is
met. Those AC-Events which meet the condition have their frame times
compared with my actual event list. If a AC frame equals an event
frame the event frame is thrown away. I've tried doing it with array
operations but always end up of having the problem that the AC and
frame array have different lengths, so just selecting via WHERE
doesn't work. Any help is very much appreciated since this part really
slows the whole program


;four different AC sets, each with each own threshhold energy

ACdeleteIDs=[WHERE((myFitsAC.AC EQ 0) AND (myFitsAC.PI GT
ACEnergies[i])),WHERE((myFitsAC.AC EQ 1) AND (myFitsAC.PI GT
ACEnergies[j])),WHERE((myFitsAC.AC EQ 2) AND (myFitsAC.PI GT
ACEnergies[k])),WHERE((myFitsAC.AC EQ 3 AND myFitsAC.PI GT
ACEnergies[l]))]

;the AC events which are above threshold
ACdeletes=myFitsAC[ACdeleteIDs]

;keep the original data for the next loop
myFitsHED2=myFitsHED
myFitsLED2=myFitsLED

;filter event list
FOR z=0L, n_elements(ACdeletes)-1 DO BEGIN

del=WHERE(myFitsHED.time EQ ACdeletes[z].time, cnt)
IF cnt GT 0 THEN myFitsHED2[del].time=-1

del=WHERE(myFitsLED.time EQ ACdeletes[z].time, cnt)
IF cnt GT 0 THEN myFitsLED2[del].time=-1

ENDFOR

myFitsHED2=myFitsHED2[WHERE(myFitsHED2.time NE -1)]
myFitsLED2=myFitsLED2[WHERE(myFitsLED2.time NE -1)]
[Message index]
 
Read Message
Previous Topic: Re: IDL Cursor and OS X 10.5.5
Next Topic: IDL FOR Loop variable increments

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

Current Time: Wed Oct 08 15:53:17 PDT 2025

Total time taken to generate the page: 0.00457 seconds