-
Notifications
You must be signed in to change notification settings - Fork 8
/
sredine.py
66 lines (50 loc) · 1.57 KB
/
sredine.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simon Šanca: Analiza GNSS in tahimetrične izmere
"""
import numpy as np
#%% 1. Računanje aritmetičnih sredin statičnih opazovanj
file = open("gLAB.txt","r")
fi = [] #enako za e,n,h
la = []
h = []
fi.append([])
la.append([])
h.append([])
jePrvicKin = False;
prejsna = "FGG2";
stevec = 0;
for line in file:
oznaka = line.split()[0]
if(prejsna != oznaka and oznaka != "FGG2" and oznaka != "FGG4"):
jePrvicKin = True;
if(oznaka == "FGG2" or oznaka == "FGG4"):
fi[stevec].append(float(line.split()[1]))
la[stevec].append(float(line.split()[2]))
h[stevec].append(float(line.split()[3]))
if(jePrvicKin):
stevec = stevec + 1;
fi.append([])
la.append([])
h.append([])
jePrvicKin = False;
prejsna = oznaka;
file.close()
fiav = []
laav = []
hav = []
for i in range(stevec):
fi = np.array(fi)
la = np.array(la)
h = np.array(h)
fiav.append(np.average(fi[i])) #np.average() np.mean() - vseeno
laav.append(np.average(la[i]))
hav.append(np.average(h[i]))
#FORMATIRANJE IZPISA za izračunane koordinate
dec = "{:.9f}" # fi,lam
dech = "{:.4f}" # h
print("FGG2_1",dec.format(fiav[0]),dec.format(laav[0]),dech.format(hav[0]))
print("FGG2_2",dec.format(fiav[1]),dec.format(laav[1]),dech.format(hav[1]))
print("FGG4_1",dec.format(fiav[2]),dec.format(laav[2]),dech.format(hav[2]))
print("FGG4_2",dec.format(fiav[3]),dec.format(laav[3]),dech.format(hav[3]))