6
6
import shutil
7
7
8
8
# app
9
- from pgamit import dbConnection
10
- from pgamit import pyPPP
11
- from pgamit .Utils import stationID
9
+ from pgamit import dbConnection , pyArchiveStruct , pyOptions , pyPPP
12
10
from pgamit .ScanArchive import export_station
13
- from pgamit import pyArchiveStruct
14
- from pgamit import pyOptions
11
+ from pgamit .Utils import stationID
15
12
16
13
17
14
def main ():
@@ -20,42 +17,54 @@ def main():
20
17
cnn2 = dbConnection .Cnn ('gnss_data_osu.cfg' )
21
18
22
19
pyArchive = pyArchiveStruct .RinexStruct (cnn1 )
23
- Config = pyOptions .ReadOptions ("gnss_data_ign.cfg" ) # type: pyOptions.ReadOptions
20
+ # type: pyOptions.ReadOptions
21
+ Config = pyOptions .ReadOptions ("gnss_data_ign.cfg" )
24
22
25
23
# get all the stations from the database (IGN)
26
24
stns = cnn1 .query ('SELECT * FROM stations' ).dictresult ()
27
25
28
26
for stn in stns :
29
- sp = pyPPP .PPPSpatialCheck ([float (stn ['lat' ])], [float (stn ['lon' ])], [float (stn ['height' ])])
27
+ sp = pyPPP .PPPSpatialCheck ([float (stn ['lat' ])],
28
+ [float (stn ['lon' ])],
29
+ [float (stn ['height' ])])
30
30
31
- found , match , stn_list = sp .verify_spatial_coherence (cnn2 , stn ['StationCode' ])
31
+ found , match , stn_li = sp .verify_spatial_coherence (cnn2 ,
32
+ stn ['StationCode' ])
32
33
33
34
if found :
34
- # print(' -- %s was found as %s' % (stationID(stn), stationID(match[0])))
35
+ # print(' -- %s was found as %s'
36
+ # % (stationID(stn), stationID(match[0])))
35
37
# if it was found don't do anything
36
38
pass
37
39
else :
38
40
if len (match ) > 0 :
39
- print (' -- %s was NOT found: maybe it is %s (distance: %8.3f m)'
40
- % (stationID (stn ), stationID (match [0 ]), match [0 ]['distance' ]))
41
+ print (''' -- %s was NOT found:
42
+ maybe it is %s (distance: %8.3f m)'''
43
+ % (stationID (stn ),
44
+ stationID (match [0 ]),
45
+ match [0 ]['distance' ]))
41
46
42
47
if not os .path .exists ('export/maybe' ):
43
48
os .makedirs ('export/maybe' )
44
49
45
- export_station (cnn1 , [stn ], pyArchive , Config .archive_path , False )
50
+ export_station (cnn1 , [stn ], pyArchive ,
51
+ Config .archive_path , False )
46
52
47
53
# move the file into the folder
48
- shutil .move ('%s.zip' % stationID (stn ), 'export/maybe/%s.zip' % stationID (stn ))
54
+ shutil .move ('%s.zip' % stationID (stn ),
55
+ 'export/maybe/%s.zip' % stationID (stn ))
49
56
else :
50
57
print (' -- %s was NOT found' % stationID (stn ))
51
58
52
59
if not os .path .exists ('export/sure' ):
53
60
os .makedirs ('export/sure' )
54
61
55
- export_station (cnn1 , [stn ], pyArchive , Config .archive_path , False )
62
+ export_station (cnn1 , [stn ], pyArchive ,
63
+ Config .archive_path , False )
56
64
57
65
# move the file into the folder
58
- shutil .move ('%s.zip' % stationID (stn ), 'export/sure/%s.zip' % stationID (stn ))
66
+ shutil .move ('%s.zip' % stationID (stn ),
67
+ 'export/sure/%s.zip' % stationID (stn ))
59
68
60
69
61
70
if __name__ == '__main__' :
0 commit comments