If these are just input lines for optical sensors, and not gray code or something, I don't think your original events make much sense:
I only find fourteen of these, and all of them backwards... Shouldn't the patterns be more like this?
This works a little better: 20 events.
But why does it have to start with no sensors blocked? The shorter the pattern you look for, the less you'll be messed up by flapping and noise. I tried checking for this:
...and vice-versa for event B. This clocks 112 events, 58 A's and 54 B's. There's even a pattern to when they happen, though I'm less sure that makes sense(bats at high noon? what time zone was your logger? )
I know you didn't want shell, but even getting the list of directories into awk would've been a chore, let alone sorting it. Processing all the dates would've been very inefficient in BASH but is a snap in GAWK.
Doing a final bit of changes to add more stuff you asked for.
---------- Post updated at 12:11 PM ---------- Previous update was at 11:57 AM ----------
This version creates one big datafile, output.txt. It also prints individual events and their times to standard output, and final statistics to standard error. Modify the match sequences however you want but make sure you tell it the new length in the L variable.
Hi, yes sorry dinn't want to confuse things with the times if not necessary but since you noticed:
its not actualy a time zone thing, its me twealing the time to make it work -sort of...
the logger automatically starts a new directory ever midnight, I have no control of this so what I did is make the PC clock 16 hours early thus 4pm (when bats start to flyin in winter) = midnight in pc/logger time and a new directory is started.
as regards the data I know its a bit confusing:
bit zero is the first port which is triggered by the beams. bit 1 is the secont port which is triggerd by the beams. -however... to make it "fun", the state of the ports is also recorded as a zero or a one - there is only one state per line of text
sometimes bats will break one beam by turning in the lightbox this obv screws things up and makes it more difficult. thus we need to search for definite patterns and ignore all others.
I am now going to try to make sure I have explained things the right way
for each line of text (they are installed in remote locations hours away from here)
here is a sample from the manufacturer showing more than two ports in operation,
this shows that the port is logged first then the state.
Last edited by Scott; 02-24-2011 at 03:59 PM..
Reason: Code tags
I think you misunderstand the nature of the data representation. I know I did and was puzzled by the bat teleportation phenomenon. I don't think the final fields each represent a beam's state. Instead, the penultimate field identifies the beam and the ultimate its state. At least, that's the only way it makes sense to me.
Regards,
Alister
---------- Post updated at 01:52 PM ---------- Previous update was at 01:32 PM ----------
Hello, cmp260:
Quote:
Originally Posted by cmp260
the above is a single transit in directiion "A" the opposite would be a transit in direction "B" as follows:
the abvoe two examples are they only valid transits.
Is the order in which the beams report high important? If the first two lines in each of those patterns were reversed, would it still constitute a valid transit (since both beams were high prior to both going low)? If yes, then the following would also be a valid transit.
Also, your newer sample data has increased in resolution from minutes to seconds. Should an otherwise valid transit be invalidated if it crosses a second boundary? Or is the following a valid transit?
Regards,
Alister
Blarg. Oh well, you can plug whatever patterns you want into my script. Glad to know I wasn't catching dozens of false-positives from daylight bat gremlins. I'll work on it.
I still think you can make your patterns a whole lot shorter to catch a lot more valid events on the assumption that any bug big enough to simultaneously block two sensors is probably a bat. In fact, since it just records changes, the lines also tell us what the state used to be, so the pattern can be really really short:
These give the following event counts:
...and that's with the accuracy increased to within a second(MAX=1).
Or to make them a bit more sure:
That nets you
If you want to deal with multiple sets of sensors in one data file I think you'll need a perl script, since awk doesn't have multidimensional arrays...
Last edited by Corona688; 02-24-2011 at 03:29 PM..
hi, you have mixed it up a bit: state zero means unblocked beam so your statement below is wrong: Getting these two events in a row implies both beams were blocksed. this should be:
however, there are only two sensors in actual fact -above is just to illustrate the point
Alastair,
as regards your Q: if this is a valid transit?
the answer is sort of - but it would not help to count it as one since it would indicate that the bat turned around and flew back from where it had come whilst inside the beams.
Hey , guys I am new to shell programing ,, so need a help from you guys ...
I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options .
1.overwrite the content
2.append the... (2 Replies)
Hi:
I have 2 script on AIX server.
The child script is called by parent script.
For example:
The parent script full name is /home/op/def/parent.spt, which calls
/home/op/abc/child.spt
I want to get the parent program name with full path name (i.e. /home/op/def/parent.spt),
in... (3 Replies)
hi,
this is related to this thread https://www.unix.com/shell-programming-scripting/154822-dont-have-clue-program-use-process-flying-bat-data.html
using another type of logger (ipcas ipether232) which produces csv data but not seperated into differnt folders. I need to work out how to get... (2 Replies)
All,
I am getting a wired scenario, Not all times but some times i am getting the defunct process for a program. If i rerun the same program it is working fine.This defunct scenario is not occuring often. And this is happening only for the one program in my system that to sometimes
Can you... (1 Reply)
Hi,
can somebody please help me regarding this?
How can i print parent's PID from child's and vice versa.
I have tried with getpid() & ngetppid() function but it is not giving me the correct data. The logic i used is:
if (pid == 0)
{
getpid() : Chil'd PID
getppid():... (1 Reply)
I have a set of attributes such as group id,group name,etc related to a linux process. Iwant to know how to start a process in linux using C program.Plz do help me. (3 Replies)
Hi,
I am wondering if there is a way to find out in a C software program if a particular process is running without having to write a file. In the past, I have been using the system command to execute a pgrep and output the info to a file. Then the C program reads the file to make the... (1 Reply)
Hi ,
I have query regarding to get a program name given a pid in HP-Ux .
give procees id ( PID) i would like to retrieve the process/program through a C program ?
my input to c program will be will be pid and i would like to know what is process name /program name .
Many Thanks ... (1 Reply)
HI there,
I'm trying to find a way of showing the IO's performed by individual programs. Number of reads/writes IO time that kind of thing.
Anybody know of any way to show this information. Free little downloads that kind of thing?
Cheers
Phil (2 Replies)