Sponsored Content
Top Forums Shell Programming and Scripting dont have a clue again- flying bat data new logger Post 302502991 by cmp260 on Wednesday 9th of March 2011 11:37:39 AM
Old 03-09-2011
Hi, I tested the grep above but unsure how to really use it and nothing seemed to happen. Ill have to read a manual on grep I thingk.

what I need as output is a file with, as a minimum, the following on each line of text:
date of each day, the maximum count of bats out for each day, the time of that maximum count
e.g.
22/12/2011, 313, 21:00 or similar

"nice to have" but not necesary, any or all of the follwing:
average speed of flight( so I can see when in the year the baby bats start to emerge)
time of first evening flight,
time of last morning flight,
during what 20 minute time did most bats go out

not needed as output: ip address, ticks, pin (althought the ticks and pin will have to be used to caclulate the others)

each full transit by a bat is either an in or an out

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.
it might help at this stage to confuse the issue more and explain how it is planned to get daily total counts:
these bat species do a weird thing called "light sampling" where they go in and out multiple times until the conditons are right and finally leave to forage for the night. Obv, this causes a total screw up if you just simply count the total number exiting - you end up with an order of magnitude more bats than actually exist in the roost. To eliminate this as best as possible we need to total the ins and outs until a peak number is arrived at as follows:
If we set "out" = +1 (plus one) and "in" = -1 (minus one)
thus:

dinrection total
out +1 1
out +1 2
out +1 3
out +1 4
in -1 3
in -1 2
out +1 3
etc. this way at some point in each evening there is a maximum in the total column which will Smiliemore or less equate to the total number in the roost

does this make sense? is it possible to do?

Last edited by cmp260; 03-10-2011 at 01:56 PM..
 

3 More Discussions You Might Find Interesting

1. Programming

I have no clue what's the point - fcntl() ?

hi, I need to know how to lock a file. I used the following code, but after executing the program the file 'write.txt' remined empty, and I have no idea why.Maybe I'm not using the corresponding syntax for blocking a file. But I deleted then the blocking part and the problem persisted. see to... (2 Replies)
Discussion started by: atticus
2 Replies

2. Solaris

Filesystem filling up and no clue as to why!

df shows that the filesystem is filling up and the usage is 94%. However when I actually traverse to the directory I du shows only about 10% of the space occupied! Below is the output of df and du: >>>df -kh /cbmdata/00 470M 393M 29M 94% /cbmdata/00 >>>/cbmdata/00>... (3 Replies)
Discussion started by: zombiezparadize
3 Replies

3. Shell Programming and Scripting

Dont have a clue which program to use to process flying bat data

Hi, Im not a unix person but need to analyse some data. This is bat data (animals) from large roosts using data loggers. I think AWK is probably the best thing to use but dont really know so any help appreciated. (python, grep) whichever it is, I'll have to learn it! here is an example of... (27 Replies)
Discussion started by: cmp260
27 Replies
TOTAL(1)						      General Commands Manual							  TOTAL(1)

NAME
total - sum up columns SYNOPSIS
total [ -m ][ -sE | -p | -u | -l ][ -i{f|d}[N] ][ -o{f|d} ][ -tC ][ -N [ -r ]] [ file .. ] DESCRIPTION
Total sums up columns of real numbers from one or more files and prints out the result on its standard output. By default, total computes the straigt sum of each input column, but multiplication can be specified instead with the -p option. Likewise, the -u option means find the upper limit (maximum), and -l means find the lower limit (minimum). Sums of powers can be computed by giving an exponent with the -s option. (Note that there is no space between the -s and the exponent.) This exponent can be any real number, positive or negative. The absolute value of the input is always taken before the power is computed in order to avoid complex results. Thus, -s1 will produce a sum of absolute values. The default power (zero) is interpreted as a straight sum without taking absolute values. The -m option can be used to compute the mean rather than the total. For sums, the arithmetic mean is computed. For products, the geomet- ric mean is computed. (A logarithmic sum of absolute values is used to avoid overflow, and zero values are silently ignored.) If the input data is binary, the -id or -if option may be given for 64-bit double or 32-bit float values, respectively. Either option may be followed immediately by an optional count, which defaults to 1, indicating the number of double or float binary values to read per record on the input file. (There can be no space between the option and this count.) Similarly, the -od and -of options specify binary double or float output, respectively. These options do not need a count, as this will be determined by the number of input channels. A count can be given as the number of lines to read before computing a result. Normally, total reads each file to its end before producing its result, but this behavior may be overridden by inserting blank lines in the input. For each blank input line, total produces a result as if the end-of-file had been reached. If two blank lines immediately follow each other, total closes the file and proceeds to the next one (after reporting the result). The -N option (where N is a decimal integer) tells total to produce a result and reset the calculation after every N input lines. In addition, the -r option can be specified to override reinitialization and thus give a running total every N lines (or every blank line). If the end of file is reached, the current total is printed and the calculation is reset before the next file (with or without the -r option). The -tC option can be used to specify the input and output tab character. The default tab character is TAB. If no files are given, the standard input is read. EXAMPLE
To compute the RMS value of colon-separated columns in a file: total -t: -m -s2 input To produce a running product of values from a file: total -p -1 -r input BUGS
If the input files have varying numbers of columns, mean values will certainly be off. Total will ignore missing column entries if the tab separator is a non-white character, but cannot tell where a missing column should have been if the tab character is white. AUTHOR
Greg Ward SEE ALSO
cnt(1), neaten(1), rcalc(1), rlam(1), tabfunc(1) RADIANCE
2/3/95 TOTAL(1)
All times are GMT -4. The time now is 05:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy