Skip to content

Commit

Permalink
Merge pull request #154 from GeoscienceAustralia/AD/work_for_AUSPOS-v3
Browse files Browse the repository at this point in the history
Minor update to writing out of lines to SINEX in particular functions
  • Loading branch information
harry093 authored Sep 16, 2024
2 parents 61e1a99 + deb12ae commit f76a6d2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions geodepy/gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,11 +1553,11 @@ def remove_stns_sinex(sinex, sites):
for line in site_id:
if line.startswith('*') or line.startswith('+') or \
line.startswith('-'):
out.write(line)
out.write(f"{line}\n")
else:
site = line[1:5]
if site not in sites:
out.write(line)
out.write(f"{line}\n")
del site_id

out.write("*-------------------------------------------------------------------------------\n")
Expand All @@ -1568,11 +1568,11 @@ def remove_stns_sinex(sinex, sites):
for line in solution_epochs:
if line.startswith('*') or line.startswith('+') or \
line.startswith('-'):
out.write(line)
out.write(f"{line}\n")
else:
site = line[1:5]
if site not in sites:
out.write(line)
out.write(f"{line}\n")
del solution_epochs

out.write("*-------------------------------------------------------------------------------\n")
Expand All @@ -1585,7 +1585,7 @@ def remove_stns_sinex(sinex, sites):
for line in solution_estimate:
if line.startswith('*') or line.startswith('+') or \
line.startswith('-'):
out.write(line)
out.write(f"{line}\n")
else:
site = line[14:18]
if site in sites:
Expand All @@ -1595,7 +1595,7 @@ def remove_stns_sinex(sinex, sites):
estimate_number += 1
number = '{:5d}'.format(estimate_number)
line = ' ' + number + line[6:]
out.write(line)
out.write(f"{line}\n")
del solution_estimate

out.write("*-------------------------------------------------------------------------------\n")
Expand All @@ -1609,9 +1609,9 @@ def remove_stns_sinex(sinex, sites):
matrix = 'lower'
elif solution_matrix_estimate[0][26:27] == 'U':
matrix = 'upper'
out.write(solution_matrix_estimate[0])
out.write(f"{solution_matrix_estimate[0]}\n")
if solution_matrix_estimate[1].startswith('*'):
out.write(solution_matrix_estimate[1])
out.write(f"{solution_matrix_estimate[1]}\n")
for line in solution_matrix_estimate:
if line.startswith(' '):
cols = line.split()
Expand Down Expand Up @@ -1715,7 +1715,7 @@ def remove_velocity_sinex(sinex):
# Read in the +SITE/ID block and write to file
site_id = read_sinex_site_id_block(sinex)
for line in site_id:
out.write(f"{line}")
out.write(f"{line}\n")
del site_id

out.write("*-------------------------------------------------------------------------------\n")
Expand All @@ -1725,7 +1725,7 @@ def remove_velocity_sinex(sinex):
numSites = 0
solution_epochs = read_sinex_solution_epochs_block(sinex)
for line in solution_epochs:
out.write(f"{line}")
out.write(f"{line}\n")
if line[0]!="+" and line[0]!="*" and line[0]!="-":
numSites+=1
del solution_epochs
Expand All @@ -1744,12 +1744,12 @@ def remove_velocity_sinex(sinex):
if line[7:10]=="VEL":
vel_indices.append(int(line[0:6]))
elif line[0]=="+" or line[0]=="*" or line[0]=="-":
out.write(f"{line}")
out.write(f"{line}\n")
else:
estimate_number+=1
number = '{:5d}'.format(estimate_number)
line = ' ' + number + line[6:]
out.write(f"{line}")
out.write(f"{line}\n")
del solution_estimate

out.write("*-------------------------------------------------------------------------------\n")
Expand All @@ -1771,10 +1771,10 @@ def remove_velocity_sinex(sinex):
# Write initial comment line(s), save last comment line, and form matrix
for line in solution_matrix_estimate:
if line[0]=="+":
out.write(f"{line}")
out.write(f"{line}\n")
continue
if line[0]=="*":
out.write(f"{line}")
out.write(f"{line}\n")
continue
if line[0]=="-":
block_end = line
Expand Down Expand Up @@ -1876,23 +1876,23 @@ def remove_matrixzeros_sinex(sinex):
# Read in the +SITE/ID block and write to file
site_id = read_sinex_site_id_block(sinex)
for line in site_id:
out.write(f"{line}")
out.write(f"{line}\n")
del site_id

out.write("*-------------------------------------------------------------------------------\n")

# Read in the +SOLUTION/EPOCHS block and write to file
solution_epochs = read_sinex_solution_epochs_block(sinex)
for line in solution_epochs:
out.write(f"{line}")
out.write(f"{line}\n")
del solution_epochs

out.write("*-------------------------------------------------------------------------------\n")

# Read in the +SOLUTION/ESTIMATE block
solution_estimate = read_sinex_solution_estimate_block(sinex)
for line in solution_estimate:
out.write(f"{line}")
out.write(f"{line}\n")
del solution_estimate

out.write("*-------------------------------------------------------------------------------\n")
Expand Down

0 comments on commit f76a6d2

Please sign in to comment.