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

Home » Public Forums » archive » how to loop through data?
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 to loop through data? [message #74851] Wed, 02 February 2011 14:29
smuzz is currently offline  smuzz
Messages: 7
Registered: January 2011
Junior Member
Hi --

I am new to programming in IDL and I want to execute a for loop. The
data I have contains number of whale calls from different species over
a 2 month period. I have manually gone through and specified the start
and end of periods of calling that I want to focus on (i.e. bouts).
Now I want to look 1 hour before the start of each bout and 1 after
the end of each bout to total up all the whale calls that I hear from
the different species. I have about 20 bouts and ideally would like to
write some sort of for loop that will go through each bout and tally
up calls, but I am a bit confused how I would go about this since my
bouts are all different and appreciate any suggestions...

***********************
What I have so far:

; This finds all the calls for the 1st species
l = where(auto(*).species eq 7 and auto(*).call_type eq 1 and
auto(*).start_time gt stime and auto(*).start_time lt etime,lcount)

; This finds all the calls for the 2nd species
m = where(auto(*).species eq 7 and auto(*).call_type eq 3 and
auto(*).start_time gt stime and auto(*).start_time lt etime,mcount)

; This finds all the calls for the 3rd species
n = where(auto(*).species eq 10 and auto(*).call_type eq 0 and
auto(*).start_time gt stime and auto(*).end_time lt etime,ncount)

; These are the start and end times of a few of my bouts (I've already
taken care of converting time)
start_bout1 = '11/19/09 22:30:00'
end_bout1 = '11/19/09 23:21:00'
start_bout2 = '11/20/09 02:06:00'
end_bout2= '11/20/09 02:56:00'
start_bout3= '11/20/09 19:27:00'
end_bout3= '11/20/09 20:07:00'
start_bout4= '11/20/09 21:37:00'
end_bout4= '11/20/09 22:49:00'
start_bout......

*********************

Thanks, S
[Message index]
 
Read Message
Previous Topic: change background color in widget_text
Next Topic: Contour Plot w/ Colorbar

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

Current Time: Fri Oct 10 22:03:44 PDT 2025

Total time taken to generate the page: 1.28183 seconds