Skip to content
Snippets Groups Projects
Commit fcc73350 authored by am0ebe's avatar am0ebe
Browse files

adaptSpeciesNumber.py: helper script to merge the three tags files with correct numbers

parent a72dcded
Branches
Tags
No related merge requests found
Showing with 1111 additions and 1720 deletions
ecotrack/in/temp
ecotrack/out/I/ecotrack-data-20190629-20190804
ecotrack/out/I/.bup/ecotrack-data-20190629-20190804
ecolux/II/02-inspect/ecolux-data-20200915-20201028
ecolux/all/02-inspect/ecolux-data-20200721-20201028
ecolux/I/02-inspect/ecolux-data-20200721-20200914
*.csv
*.txt
test/*
......
#!/usr/bin/python3
#
# Use to merge all tags file.
# Because the numbers for an indivual aren't unique this script
# calculates them.
#
DELIM=";"
def adaptSpeciesNumber(letter,offset,file):
with open(file) as f:
lines = f.readlines()
for l in lines:
if l.startswith(letter) and l[len(letter)].isdigit():
l=l.split(DELIM)
n=int( l[0][len(letter):] )
n+=offset
print(letter + str(n) + DELIM + DELIM.join(l[len(letter):]), end='')
#tags1
adaptSpeciesNumber('A',0,"tags1")
adaptSpeciesNumber('B',0,"tags1")
adaptSpeciesNumber('C',0,"tags1")
adaptSpeciesNumber('D',0,"tags1")
adaptSpeciesNumber('E',0,"tags1")
adaptSpeciesNumber('N',0,"tags1")
#tags2
adaptSpeciesNumber('B',28,"tags2")
adaptSpeciesNumber('C',63,"tags2")
adaptSpeciesNumber('H',0,"tags2")
adaptSpeciesNumber('N',0,"tags2")
adaptSpeciesNumber('P',0,"tags2")
#tags3
adaptSpeciesNumber('C', 41+63, "tags3")
adaptSpeciesNumber('H', 112, "tags3")
adaptSpeciesNumber('N', 101, "tags3")
adaptSpeciesNumber('P', 142, "tags3")
adaptSpeciesNumber('PM', 0, "tags3")
#speciesGroupID;latin name; german name
#>> BLOCK I
A;Pyrrhocoris apterus;Feuerwanze
B;Carabus nemoralis;Hainlaufkäfer
C;Carabus coriaceus;Lederlaufkäfer
B;Carabus coriaceus;Lederlaufkäfer
C;Carabus nemoralis;Hainlaufkäfer
D;Oniscus asellus;Mauerassel
E;Armadillidium spp.;Rollassel
N;Nebrias brevicollis;Gewöhnlicher Dammläufer
#>> BLOCK II
B;Carabus coriaceus;Lederlaufkäfer
C;Carabus nemoralis;Hainlaufkäfer
H;Acheta domesticus;Heimchen
N;Nebrias brevicollis;Gewöhnlicher Dammläufer
P;Pyrrhocoris apterus;Feuerwanze
#>> BLOCK III
C;Carabus coriaceus;Lederlaufkäfer
H;Acheta domesticus;Heimchen
N;Nebrias brevicollis;Gewöhnlicher Dammläufer
P;Pyrrhocoris apterus;Feuerwanze
......
>> BLOCK I
#speciesGroupID;latin name; german name
D;Oniscus asellus;Mauerassel
A;Pyrrhocoris apterus;Feuerwanze
B;Carabus coriaceus;Lederlaufkäfer
C;Carabus nemoralis;Hainlaufkäfer
E;Armadillidium spp.;Rollassel
>> BLOCK II
B;Carabus coriaceus;Lederlaufkäfer
C;Carabus nemoralis;Hainlaufkäfer
H;Acheta domesticus;Heimchen
N;Nebrias brevicollis;Gewöhnlicher Dammläufer
P;Pyrrhocoris apterus;Feuerwanze
>> BLOCK III
C;Carabus coriaceus;Lederlaufkäfer
H;Acheta domesticus;Heimchen
N;Nebrias brevicollis;Gewöhnlicher Dammläufer
P;Pyrrhocoris apterus;Feuerwanze
PM;Pterostichus melanarius;Gemeiner Grabkäfer
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -139,34 +139,34 @@ A137;A;37;28.06.2019;;047A7C8A7288588123;
A138;A;34;28.06.2019;;04A174597288588022;
A139;A;36;28.06.2019;;044768A37288588123;
A140;A;53;28.06.2019;;043A59EF7288588022;
B27;B;941;26.06.2019;978;0420C8643A204B80D1;
B16;B;982;26.06.2019;980;04C934713A204B80D1;
B10;B;1690;26.06.2019;1730;0457449F3A204B80D1;
B11;B;1183;26.06.2019;1223;043E42F03A204B80D1;
B12;B;1063;26.06.2019;1101;048469613A204B80D1;
B26;B;1076;26.06.2019;1109;0426BC163A204B81D0;
B13;B;1518;26.06.2019;1559;04CC11513A204B80D1;
B14;B;981;26.06.2019;1913;04467FB53A204B81D0;
B15;B;1149;26.06.2019;1185;04AA64423A204B80D1;
B11;B;1183;26.06.2019;1223;043E42F03A204B80D1;
B2;B;1279;26.06.2019;1318;044CBB7B3A204B80D1;
B16;B;982;26.06.2019;980;04C934713A204B80D1;
B17;B;2008;26.06.2019;2042;04E6BAD03A204B80D1;
B18;B;1525;26.06.2019;1568;04C0E7AB3A204B80D1;
B19;B;1715;26.06.2019;1749;044BAF683A204B80D1;
B1;B;1597;26.06.2019;1633;04E62D473A204B80D1;
B20;B;1305;26.06.2019;1340;04369F253A204B81D0;
B5;B;1320;26.06.2019;1346;04B6D3E93A204B80D1;
B8;B;1317;26.06.2019;1355;04E4CFA73A204B80D1;
B21;B;1333;26.06.2019;1379;04EF9CFF3A204B80D1;
B25;B;1427;26.06.2019;1465;0490504C3A204B80D1;
B9;B;1439;26.06.2019;1478;04B82C183A204B80D1;
B13;B;1518;26.06.2019;1559;04CC11513A204B80D1;
B18;B;1525;26.06.2019;1568;04C0E7AB3A204B80D1;
B22;B;2179;26.06.2019;2216;04229C323A204B80D1;
B23;B;2090;26.06.2019;2124;04B5437A3A204B80D1;
B24;B;1555;26.06.2019;1592;04AC6E4E3A204B80D1;
B7;B;1568;26.06.2019;1606;0441BB763A204B81D0;
B1;B;1597;26.06.2019;1633;04E62D473A204B80D1;
B10;B;1690;26.06.2019;1730;0457449F3A204B80D1;
B19;B;1715;26.06.2019;1749;044BAF683A204B80D1;
B25;B;1427;26.06.2019;1465;0490504C3A204B80D1;
B26;B;1076;26.06.2019;1109;0426BC163A204B81D0;
B27;B;941;26.06.2019;978;0420C8643A204B80D1;
B28;B;1749;26.06.2019;1772;04A15B763A204B80D1;
B4;B;1772;26.06.2019;1842;045D6FBE0ACD558012;weight without tag calculated : weight tagged – 70 mg
B2;B;1279;26.06.2019;1318;044CBB7B3A204B80D1;
B3;B;1806;26.06.2019;1876;044CA46422DF548128;weight without tag calculated : weight tagged – 70 mg
B14;B;981;26.06.2019;1913;04467FB53A204B81D0;
B4;B;1772;26.06.2019;1842;045D6FBE0ACD558012;weight without tag calculated : weight tagged – 70 mg
B5;B;1320;26.06.2019;1346;04B6D3E93A204B80D1;
B6;B;2003;26.06.2019;2040;0424F75F3A204B81D0;
B17;B;2008;26.06.2019;2042;04E6BAD03A204B80D1;
B23;B;2090;26.06.2019;2124;04B5437A3A204B80D1;
B22;B;2179;26.06.2019;2216;04229C323A204B80D1;
B7;B;1568;26.06.2019;1606;0441BB763A204B81D0;
B8;B;1317;26.06.2019;1355;04E4CFA73A204B80D1;
B9;B;1439;26.06.2019;1478;04B82C183A204B80D1;
C1;C;494;26.06.2019;532;XXXXXXXXXXXXXXXXX1;doubled with c2 old tagID:042038943A204B81D0
C2;C;471;26.06.2019;505;XXXXXXXXXXXXXXXXX2;old tagID:042038943A204B81D0
C3;C;633;26.06.2019;663;04B68CB63A204B80D1;
......
......@@ -353,6 +353,7 @@ P139;P;39;30.07.2019;;04ED53327288588022;
P140;P;39;30.07.2019;;0494829A7F3D002095;
P141;P;47;30.07.2019;;042577DE7288588022;
P142;P;32;30.07.2019;;04B17E437288588022;
B1;B;1511;30.07.2019;1581;04C0E7AB3A204B80D1;weighed without tag during experimental part I, calculated here! body without tag = mass (with tag) - 70 mg (big tag)
B2;B;1214;30.07.2019;1284;0490504C3A204B80D1;weighed without tag during experimental part I, calculated here! body without tag = mass (with tag) - 70 mg
B3;B;1786;30.07.2019;;04F2D5AB3A204B80D1;
......
unit 1
didn't find files
unit 2
didn't find files
unit 3
2019-06-28 12:33:56 /home/sugu/code/idiv/ecotrondata/ecotrack/in/data-unit-3-sorted-III.txt
2019-10-16 09:44:07 /home/sugu/code/idiv/ecotrondata/ecotrack/in/data-unit-3-sorted-III.txt
unit 4
didn't find files
unit 5
didn't find files
unit 6
didn't find files
unit 7
didn't find files
unit 8
didn't find files
unit 9
didn't find files
unit 10
didn't find files
unit 11
didn't find files
unit 12
didn't find files
unit 13
didn't find files
unit all
2019-06-28 12:33:56 /home/sugu/code/idiv/ecotrondata/ecotrack/in/data-unit-3-sorted-III.txt
2019-10-16 09:44:07 /home/sugu/code/idiv/ecotrondata/ecotrack/in/data-unit-3-sorted-III.txt
# ecotrack data
####################################################################################################
# len(Track): 13
# startTrack: 2019-06-29 04:12:00
# endTrack: 2019-06-29 19:10:52
# len(animal): 1408
# len(Temperature): 69120
# startTemp: 2019-06-29 00:00:06
# endTemp: 2019-06-29 23:59:12
####################################################################################################
#timestamp, ms, date, time, unit, habitat, x, y, tag, species, speciesnumber, weight_without_tag[mg], temp[C°]
####################################################################################################
1561774320,177,2019-06-29,04:12,3,3,3,6,045C59897288588123,A94,A,36,24.06
1561780983,445,2019-06-29,06:03,3,2,2,1,042E6CCE7288588123,N36,N,74,24.06
1561786032,445,2019-06-29,07:27,3,2,2,1,0424F75F3A204B81D0,B6,B,2003,24.06
1561794626,177,2019-06-29,09:50,3,3,4,1,0426BC163A204B81D0,NA,NA,NA,24.06
1561794764,116,2019-06-29,09:52,3,3,2,3,0426BC163A20002095,NA,NA,NA,24.06
1561794887,116,2019-06-29,09:54,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794893,116,2019-06-29,09:54,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794894,317,2019-06-29,09:54,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794895,516,2019-06-29,09:54,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794896,716,2019-06-29,09:54,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794900,918,2019-06-29,09:55,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561794905,717,2019-06-29,09:55,3,4,3,3,045C59897288588123,A94,A,36,24.06
1561828252,716,2019-06-29,19:10,3,4,3,4,04E782E97288588022,A104,A,55,24.06
begin, end, dur, last-detect, block, SXE, PEE, PXE, unit, habitat, x, y, tag, species, speciesnumber, weight_without_tag[mg], temp[C°]
29-06-2019 04:12:00,29-06-2019 04:12:00,0000,NA,Ia,False,False,False,3,3,3,6,045C59897288588123,A94,A,36,24.06
29-06-2019 06:03:03,29-06-2019 06:03:03,0000,NA,Ia,False,False,False,3,2,2,1,042E6CCE7288588123,N36,N,74,24.06
29-06-2019 07:27:12,29-06-2019 07:27:12,0000,NA,Ia,False,False,False,3,2,2,1,0424F75F3A204B81D0,B6,B,2003,24.06
29-06-2019 09:50:26,29-06-2019 09:50:26,0000,NA,Ia,False,False,False,3,3,4,1,0426BC163A204B81D0,NA,NA,NA,24.06
29-06-2019 09:52:44,29-06-2019 09:52:44,0000,NA,Ia,False,False,False,3,3,2,3,0426BC163A20002095,NA,NA,NA,24.06
29-06-2019 09:54:47,29-06-2019 09:54:47,0000,20567,Ia,True,True,True,3,4,3,3,045C59897288588123,A94,A,36,24.06
29-06-2019 09:54:53,29-06-2019 09:55:05,0012,00006,Ia,False,False,False,3,4,3,3,045C59897288588123,A94,A,36,24.06
29-06-2019 19:10:52,29-06-2019 19:10:52,0000,NA,Ia,False,False,False,3,4,3,4,04E782E97288588022,A104,A,55,24.06
File deleted
File deleted
## Tags
total: 6
known: 4 (66.66%)
unknown: 2 (33.33%)
## Detections
total: 8
known: 6 (75.00%)
unknown: 2 (25.00%)
1 : 0426BC163A204B81D0
1 : 0426BC163A20002095
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment