Hardware Reference
In-Depth Information
The Analysis Program with Noise Filtering
Listing 17-3 shows the modiied basic analysis program to include the concept of time. It is
shown in full here.
Listing 17-3 analyseBirdDataFiltered.py
#!/usr/bin/env python
import sys
import datetime
#print a debug message on if debugging is turned on
def debug(msg):
if DEBUG:
print msg
state=”INIT”
#Constants
INNER_BEAM = 0
OUTER_BEAM = 1
BROKEN = 0
UNBROKEN = 1
DEBUG = True
# timestamp of event from previously processed event
lastEventTime = 0
outwardTimes=[]
# loop over every line that is being piped into the program
for line in sys.stdin:
#ignore lines beginning #
if line.startswith('#'):continue
# remove the new line character
line = line.rstrip('\n')
#split the text at each comma. This creates the event
#array, with three items
Search WWH ::




Custom Search