Skip to content

Commit

Permalink
Merge branch 'issues/#2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
i-zhivetiev committed Feb 23, 2018
2 parents 84570af + 815ce52 commit f5776fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions gnss_tec/rinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,19 @@ def _parse_epoch_record(self):

timestamp = validate_epoch(timestamp)

list_of_sats = row[32:69].rstrip()
list_of_sats = row[32:68].rstrip()
rows_to_read = math.ceil(n_of_sats / 12.) - 1
if rows_to_read > 0:
while rows_to_read > 0:
row = next(self.fh)
list_of_sats += row[32:69].rstrip()
list_of_sats += row[32:68].rstrip()
rows_to_read -= 1

list_of_sats = [list_of_sats[i:i + 3] for i in
range(0, len(list_of_sats), 3)]
assert len(list_of_sats) == n_of_sats

msg = "Epoch's num of sats != actual num of sats"
assert len(list_of_sats) == n_of_sats, msg

return timestamp, epoch_flag, n_of_sats, list_of_sats

Expand Down Expand Up @@ -288,13 +290,14 @@ def retrieve_obs_types(self):
obs_types += row[6:60]
rows_to_read -= 1
obs_types = obs_types.split()

except StopIteration:
warn_msg = ("tec: Can't find '# / TYPES OF OBSERV'; "
"unexpected end of the file.")
warnings.warn(warn_msg)
raise StopIteration
except ValueError:
msg = "{program}: Couldn't extract '# / TYPES OF OBSERV'"
msg = "tec: Can't extract '# / TYPES OF OBSERV'"
raise ValueError(msg)

msg = "Some obs types are missing."
Expand Down
2 changes: 1 addition & 1 deletion tests/gnss_tec/test_obs_file_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
-14.32609534 (latitude) COMMENT
-170.72243361 (longitude) COMMENT
0053.667 (elevation) COMMENT
17 7 6 0 0 0.0000000 0 18G18R15G31G03R06G16G01R09G25G22R05G29 .000000000
17 7 6 0 0 0.0000000 0 18G18R15G31G03R06G16G01R09G25G22R05G29-0.000392832
R16G26R04G10G32G14
129609926.497 6 100994793.77642 24663965.641
24663974.148 38.600 17.800
Expand Down

0 comments on commit f5776fd

Please sign in to comment.