Skip to content

Commit

Permalink
NPI-3668 small clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
treefern committed Dec 23, 2024
1 parent 9e08add commit aecd8dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnssanalysis/gn_io/sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def read_sp3(
header = content[:header_end]
content = content[header_end:]
parsed_header = parse_sp3_header(header)
header_sv_count = parsed_header.SV_INFO.count()
header_sv_count = parsed_header.SV_INFO.count() # count() of non-NA/null, vs shape: dims of whole structure
fline_b = header.find(b"%f") + 2 # TODO add to header parser
fline = header[fline_b : fline_b + 24].strip().split(b" ")
base_xyzc = _np.asarray([float(fline[0])] * 3 + [float(fline[1])]) # exponent base
Expand Down Expand Up @@ -440,7 +440,7 @@ def parse_sp3_header(header: bytes, warn_on_negative_sv_acc_values: bool = True)
head_svs = _np.asarray(sv_id_matches)[_np.newaxis].view("S3").astype(str)

# Sanity check that the number of SVs the regex found, matches what the header said should be there.
found_sv_count = head_svs.shape[0] # Effectively len() of the SVs array.
found_sv_count = head_svs.shape[0] # Effectively len() of the SVs array. Note this could include null/NA/NaN
if head_sv_expected_count is not None and found_sv_count != head_sv_expected_count:
logger.warning(
"Number of Satellite Vehicle (SV) entries extracted from the SP3 header, did not match the "
Expand Down
1 change: 1 addition & 0 deletions tests/test_sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def test_sp3merge(self):
34,
"Header stated count of SVs should be 34, matching actual number of SVs",
)
# Note: shape of first dimension (unlike count() where applicable) could include null/NA/NaN
self.assertEqual(result.attrs["HEADER"].SV_INFO.shape[0], 34, "Union of SV lists should have 34 SVs in it")
# Sample first three orbit accuracy codes and ensure that for each SV, the accuracy code value is the
# *worst* seen across all inputs. I.e. lowest common denominator of input files.
Expand Down

0 comments on commit aecd8dd

Please sign in to comment.