Skip to content

Commit 976e024

Browse files
MarkusHackspacherespg
authored andcommitted
PEP8 changes CompareDBs.py
1 parent 555c208 commit 976e024

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

com/CompareDBs.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
import shutil
77

88
# 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
1210
from pgamit.ScanArchive import export_station
13-
from pgamit import pyArchiveStruct
14-
from pgamit import pyOptions
11+
from pgamit.Utils import stationID
1512

1613

1714
def main():
@@ -20,42 +17,54 @@ def main():
2017
cnn2 = dbConnection.Cnn('gnss_data_osu.cfg')
2118

2219
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")
2422

2523
# get all the stations from the database (IGN)
2624
stns = cnn1.query('SELECT * FROM stations').dictresult()
2725

2826
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'])])
3030

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'])
3233

3334
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])))
3537
# if it was found don't do anything
3638
pass
3739
else:
3840
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']))
4146

4247
if not os.path.exists('export/maybe'):
4348
os.makedirs('export/maybe')
4449

45-
export_station(cnn1, [stn], pyArchive, Config.archive_path, False)
50+
export_station(cnn1, [stn], pyArchive,
51+
Config.archive_path, False)
4652

4753
# 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))
4956
else:
5057
print(' -- %s was NOT found' % stationID(stn))
5158

5259
if not os.path.exists('export/sure'):
5360
os.makedirs('export/sure')
5461

55-
export_station(cnn1, [stn], pyArchive, Config.archive_path, False)
62+
export_station(cnn1, [stn], pyArchive,
63+
Config.archive_path, False)
5664

5765
# 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))
5968

6069

6170
if __name__ == '__main__':

0 commit comments

Comments
 (0)