-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoutput_predict.py
65 lines (48 loc) · 2.23 KB
/
output_predict.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
################################################################################
# Copyright 2015 Samuel Gongora Garcia (s.gongoragarcia@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
# Author: s.gongoragarcia[at]gmail.com
################################################################################
class Read_predict_data:
def __init__(self, index_satellite):
from os import getcwd, chdir
index_satellite = index_satellite + 1
directorio_script = getcwd()
# predict routine
self.open_predict(directorio_script)
self.open_files_predict(index_satellite)
chdir(directorio_script)
def open_predict(self, directorio_script):
from os import chdir, listdir, getcwd
chdir(directorio_script + '/results/predict')
self.files_predict = listdir(getcwd())
self.files_predict.sort()
def open_files_predict(self, index_satellite):
for i in range(index_satellite):
self.open_file_predict(self.files_predict[i])
def open_file_predict(self, name):
self.predict_simulation_time = []
self.predict_alt_satellite = []
self.predict_az_satellite = []
import csv
with open(name) as tsv:
for line in csv.reader(tsv, delimiter = "\t"):
if float(line[1]) >= 0:
linea0 = float(line[0])
self.predict_simulation_time.append(linea0)
self.predict_alt_satellite.append(float(line[1]))
self.predict_az_satellite.append(float(line[2]))