Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor update to writing out of lines to SINEX in particular functions #154

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading