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

add troposphere coefficient offsets #31

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"python3.8InterpreterPath": "/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8",
"modulename": "${workspaceFolderBasename}",
"distname": "${workspaceFolderBasename}",
"moduleversion": "1.0.2"
"moduleversion": "1.0.3"
}
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# pyspartn Release Notes

### RELEASE 1.0.3

FIXES:

1. Add offsets to SF043, SF045 and SF048 - thanks to @jonathanmuller for contribution.

### RELEASE 1.0.2

ENHANCEMENTS:
Expand Down
4 changes: 2 additions & 2 deletions examples/parse_gad.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def geta(att: str, i: int = None) -> object:
lon2 = lon1 + (lonnodes * lonspacing)
areapoly = (
f'"{areaid}","POLYGON (({lon1:.3f} {lat1:.3f}, {lon1:.3f} {lat2:.3f},'
+ f"{lon2:.3f} {lat2:.3f}, {lon2:.3f} {lat1:.3f},"
+ f'{lon1:.3f} {lat1:.3f}))"\n'
f"{lon2:.3f} {lat2:.3f}, {lon2:.3f} {lat1:.3f},"
f'{lon1:.3f} {lat1:.3f}))"\n'
)
data.append(areapoly)
return data
Expand Down
3,734 changes: 3,726 additions & 8 deletions examples/spartnGAD.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pyspartn"
authors = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
maintainers = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
description = "SPARTN protocol parser"
version = "1.0.2"
version = "1.0.3"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion src/pyspartn/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.0.2"
__version__ = "1.0.3"
7 changes: 6 additions & 1 deletion src/pyspartn/spartnmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,12 @@ def _set_attribute_single(
val = self._payloadi >> (self._paylenb - offset - attlen) & ((1 << attlen) - 1)
# fmt: on
if atttyp == FL:
val = (val * attinfo[2]) + attinfo[3] # (val * res) + rngmin
if len(attinfo) == 6:
val = (
(val * attinfo[2]) + attinfo[3] + attinfo[4]
) # (val * res) + rngmin + offset
else:
val = (val * attinfo[2]) + attinfo[3] # (val * res) + rngmin

except SPARTNMessageError as err:
raise err
Expand Down
8 changes: 4 additions & 4 deletions src/pyspartn/spartntypes_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

# Datafields used in message definitions
# key (IN, BM, EN): (type length in bits, resolution or n/a, description)
# key (FL): (type, length in bits, resolution, range minimum, description)
# key (FL): (type, length in bits, resolution, range minimum, [offset], description)
SPARTN_DATA_FIELDS = {
PRN: (PRN, 0, "n/a", "Satellite PRN"),
"PhaseBias": (PBS, 0, "n/a", "Phase Bias"),
Expand Down Expand Up @@ -122,13 +122,13 @@
"SF040I": (IN, 2, 1, "Ionoshere Poly/Grid block present indicator"),
"SF041": (EN, 3, 1, "Troposphere equation type"),
"SF042": (IN, 3, 1, "Troposphere quality"),
"SF043": (FL, 8, 0.004, -0.508, "Area average vertical hydrostatic delay"),
"SF043": (FL, 8, 0.004, -0.508, 2.3, "Area average vertical hydrostatic delay"),
"SF044": (IN, 1, 1, "Troposphere polynomial coefficient size indicator"),
"SF045": (FL, 7, 0.004, -0.252, "Small troposphere coefficient T00"),
"SF045": (FL, 7, 0.004, -0.252, 0.252, "Small troposphere coefficient T00"),
"SF046a": (FL, 7, 0.001, -0.063, "Small troposphere coefficient T01"),
"SF046b": (FL, 7, 0.001, -0.063, "Small troposphere coefficient T10"),
"SF047": (FL, 9, 0.0002, -0.051, "Small troposphere coefficient T11"),
"SF048": (FL, 9, 0.004, -1.02, "Large troposphere coefficient T00"),
"SF048": (FL, 9, 0.004, -1.02, 0.252, "Large troposphere coefficient T00"),
"SF049a": (FL, 9, 0.001, -0.255, "Large troposphere coefficient T01"),
"SF049b": (FL, 9, 0.001, -0.255, "Large troposphere coefficient T10"),
"SF050": (FL, 11, 0.0002, -0.2046, "Large troposphere coefficient T11"),
Expand Down
34 changes: 17 additions & 17 deletions tests/test_stream.py

Large diffs are not rendered by default.