Skip to content

Commit e1c378e

Browse files
MarkusHackspacherespg
authored andcommitted
pep8 line lenght
1 parent 3c1f25a commit e1c378e

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

com/CloseStationInfo.py

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Date: 08/30/22 12:44 PM
55
Author: Demian D. Gomez
66
7-
Script to close the StationInfo of a station that has not been collecting data for X time
7+
Script to close the StationInfo of a station that
8+
has not been collecting data for X time
89
"""
910

1011
import argparse
1112

1213
from pgamit import pyDate
13-
from pgamit import pyOptions
1414
from pgamit import dbConnection
1515
from pgamit import pyStationInfo
1616
from pgamit import Utils
@@ -20,15 +20,22 @@
2020

2121

2222
def main():
23-
parser = argparse.ArgumentParser(description='Close an opened station information record for a station using the'
24-
'last available RINEX file date time')
25-
26-
parser.add_argument('stnlist', type=str, nargs='+', metavar='all|net.stnm',
27-
help="List of networks/stations to process given in [net].[stnm] format or just [stnm] "
28-
"(separated by spaces; if [stnm] is not unique in the database, all stations with that "
29-
"name will be processed). Use keyword 'all' to process all stations in the database. "
30-
"If [net].all is given, all stations from network [net] will be processed. "
31-
"Alternatively, a file with the station list can be provided.")
23+
parser = argparse.ArgumentParser(
24+
description='''Close an opened station information record for a
25+
station using the last available RINEX file date time''')
26+
27+
parser.add_argument('stnlist', type=str, nargs='+',
28+
metavar='all|net.stnm',
29+
help='''List of networks/stations to process given
30+
in [net].[stnm] format or just [stnm]
31+
(separated by spaces; if [stnm] is not unique
32+
in the database, all stations with that
33+
name will be processed). Use keyword 'all'
34+
to process all stations in the database.
35+
If [net].all is given, all stations from
36+
network [net] will be processed.
37+
Alternatively, a file with the station
38+
list can be provided.''')
3239

3340
args = parser.parse_args()
3441

@@ -38,21 +45,29 @@ def main():
3845
stnlist.sort(key=stationID)
3946

4047
for stn in stnlist:
41-
fd = cnn.query_float('SELECT max("ObservationFYear") FROM rinex '
42-
'WHERE "NetworkCode" = \'%s\' AND "StationCode" = \'%s\''
48+
fd = cnn.query_float('''SELECT max("ObservationFYear") FROM rinex
49+
WHERE "NetworkCode" = \'%s\'
50+
AND "StationCode" = \'%s\''''
4351
% (stn['NetworkCode'], stn['StationCode']))
4452

4553
dd = fd[0][0]
4654

4755
if not dd:
48-
print(' -- No RINEX files found for %s.%s' % (stn['NetworkCode'], stn['StationCode']))
56+
print(' -- No RINEX files found for %s.%s'
57+
% (stn['NetworkCode'], stn['StationCode']))
4958
else:
50-
print(' -- Closing station information for %s.%s using %.3f from last RINEX file'
59+
print(''' -- Closing station information for %s.%s
60+
using %.3f from last RINEX file'''
5161
% (stn['NetworkCode'], stn['StationCode'], dd))
5262

53-
stninfo = pyStationInfo.StationInfo(cnn, stn['NetworkCode'], stn['StationCode'])
54-
record = pyStationInfo.StationInfoRecord(stn['NetworkCode'], stn['StationCode'], stninfo.records[-1])
55-
# change the time to the end of the day to avoid problems with GAMIT and other
63+
stninfo = pyStationInfo.StationInfo(cnn,
64+
stn['NetworkCode'],
65+
stn['StationCode'])
66+
record = pyStationInfo.StationInfoRecord(stn['NetworkCode'],
67+
stn['StationCode'],
68+
stninfo.records[-1])
69+
# change the time to the end of the day
70+
# to avoid problems with GAMIT and other
5671
# RINEX files (with different end times)
5772
date = pyDate.Date(fyear=dd)
5873
date.hour = 23

0 commit comments

Comments
 (0)