Skip to content
Open
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
22 changes: 17 additions & 5 deletions packages/pride-ppp/src/pride_ppp/factories/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,27 @@ def get_wrms_from_res(res_path):
line = res_file.readline()
line_data = line.split()
while not line.startswith("TIM"):
phase_residual = float(line_data[1])
phase_weight = float(line_data[3].replace("D", "E"))
sumOfSquares += phase_residual**2 * phase_weight
sumOfWeights += phase_weight
try:
phase_residual = float(line_data[1])
phase_weight = float(line_data[3].replace("D", "E"))
except (ValueError, IndexError):
Comment on lines 82 to +86
# PRIDE-PPPAR writes residuals in fixed-width columns; an
Comment on lines +83 to +87
# unusually large value (e.g. an unresolved ambiguity) can
# overflow its column and run into the neighbouring field
# with no separating space (e.g. "0.0000-1641.5825"),
# which breaks whitespace-based splitting. Skip just this
# satellite's contribution rather than failing the epoch.
logger.warning(
f"Skipping unparsable residual line in {res_path}: {line.strip()!r}"
)
else:
sumOfSquares += phase_residual**2 * phase_weight
sumOfWeights += phase_weight
line = res_file.readline()
if line == "":
break
line_data = line.split()
wrms = (sumOfSquares / sumOfWeights) ** 0.5 * 1000 # in mm
wrms = (sumOfSquares / sumOfWeights) ** 0.5 * 1000 if sumOfWeights else float("nan") # in mm
data.append(wrms)
else:
line = res_file.readline()
Expand Down