Skip to content

Commit

Permalink
update enum docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
semuadmin committed Sep 25, 2024
1 parent d4cffce commit 0ad99ab
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 49 deletions.
131 changes: 86 additions & 45 deletions src/pyspartn/spartntables.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
SPARTN Bitmask, Lookup and Decode Tables
SPARTN Bitmask, Lookup and Decode Constants
Created on 10 Feb 2023
Expand All @@ -9,42 +9,84 @@
:author: semuadmin
"""

# satellite PRN bitmask keys
SATBITMASKKEY = {
"GPS": "SF011",
"GLO": "SF012",
"GAL": "SF093",
"BEI": "SF094",
"QZS": "SF095",
}
# satellite IODE keys
"""Satellite PRN bitmask keys"""

SATIODEKEY = {
"GPS": "SF018",
"GLO": "SF019",
"GAL": "SF099",
"BEI": "SF100",
"QZS": "SF101",
}
# satellite PRN bitmask lengths (PRN values are bitmask position + 1)
"""Satellite IODE keys"""

SF011_ENUM = {
0: 32,
1: 44,
2: 56,
3: 64,
}
"""GPS satellite mask length (leftmost 2 bits of SF011)"""

SF012_ENUM = {
0: 24,
1: 36,
2: 48,
3: 63,
}
"""GLONASS satellite mask length (leftmost 2 bits of SF012)"""

SF093_ENUM = {
0: 36,
1: 45,
2: 54,
3: 64,
}
"""Galileo satellite mask length (leftmost 2 bits of SF093)"""

SF094_ENUM = {
0: 37,
1: 46,
2: 55,
3: 64,
}
"""BDS satellite mask length (leftmost 2 bits of SF094)"""

SF095_ENUM = {
0: 10,
1: 40,
2: 48,
3: 64,
}
"""QZSS satellite mask length (leftmost 2 bits of SF095)"""

SATBITMASKLEN = {
"SF011": [32, 44, 56, 64],
"SF012": [24, 36, 48, 63],
"SF093": [36, 45, 54, 64],
"SF094": [37, 46, 55, 64],
"SF095": [10, 40, 48, 64],
SATBITMASKKEY["GPS"]: list(SF011_ENUM.values()),
SATBITMASKKEY["GLO"]: list(SF012_ENUM.values()),
SATBITMASKKEY["GAL"]: list(SF093_ENUM.values()),
SATBITMASKKEY["BEI"]: list(SF094_ENUM.values()),
SATBITMASKKEY["QZS"]: list(SF095_ENUM.values()),
}
"""Satellite PRN bitmask lengths (PRN values are bitmask position + 1)"""

# phase bias bitmask keys
PBBITMASKKEY = {
"GPS": "SF025",
"GLO": "SF026",
"GAL": "SF102",
"BEI": "SF103",
"QZS": "SF104",
}
# phase bias bitmask lengths, phase bias values
"""Phase bias bitmask keys"""

PBBITMASKLEN = {
"SF025": ( # GPS
PBBITMASKKEY["GPS"]: (
[6, 11],
{
0: "L1C",
Expand All @@ -54,15 +96,15 @@
# 4-10: spare phase bias
},
),
"SF026": ( # GLO
PBBITMASKKEY["GLO"]: (
[5, 9],
{
0: "L1C",
1: "L2C",
# 2-8: spare phase bias
},
),
"SF102": ( # GAL
PBBITMASKKEY["GAL"]: (
[8, 15],
{
0: "L1C",
Expand All @@ -71,7 +113,7 @@
# 3-14: spare phase bias
},
),
"SF103": ( # BEI
PBBITMASKKEY["BEI"]: (
[8, 15],
{
0: "L2I",
Expand All @@ -84,7 +126,7 @@
# 7-14: spare phase bias
},
),
"SF104": ( # QZS
PBBITMASKKEY["QZS"]: (
[6, 11],
{
0: "L1C",
Expand All @@ -94,18 +136,19 @@
},
),
}
"""Phase bias bitmask lengths and enumerations"""

# code bias bitmask keys
CBBITMASKKEY = {
"GPS": "SF027",
"GLO": "SF028",
"GAL": "SF105",
"BEI": "SF106",
"QZS": "SF107",
}
# code bias bitmask lengths, code bias values
"""Code bias bitmask keys"""

CBBITMASKLEN = {
"SF027": ( # GPS
CBBITMASKKEY["GPS"]: (
[6, 11],
{
0: "C1C",
Expand All @@ -115,15 +158,15 @@
# 4-10: spare code bias
},
),
"SF028": ( # GLO
CBBITMASKKEY["GLO"]: (
[5, 9],
{
0: "C1C",
1: "C2C",
# 2 to 8 : spare code bias
},
),
"SF105": ( # GAL
CBBITMASKKEY["GAL"]: (
[8, 15],
{
0: "C1C",
Expand All @@ -132,7 +175,7 @@
# 3-14: spare code bias
},
),
"SF106": ( # BEI
CBBITMASKKEY["BEI"]: (
[8, 15],
{
0: "C2I",
Expand All @@ -145,7 +188,7 @@
# 7-14: spare code bias
},
),
"SF107": ( # QZS
CBBITMASKKEY["QZS"]: (
[6, 11],
{
0: "C1C",
Expand All @@ -155,8 +198,10 @@
},
),
}
"""Code bias bitmask lengths and enumerations"""

ALN_ENUM = {0: 8, 1: 12, 2: 16, 3: 32, 4: 64}
"""Embedded authorisation length enumeration"""

SF015_ENUM = SF022_ENUM = {
0: "0 secs",
Expand All @@ -168,6 +213,7 @@
6: "120 secs",
7: "320 secs",
}
"""Continuity indicator enumeration"""

SF024_ENUM = {
0: "unknown",
Expand All @@ -179,6 +225,7 @@
6: "1.0 m",
7: "> 1.0 m",
}
"""User range error (URE) enumeration"""

SF042_ENUM = {
0: "unknown",
Expand All @@ -190,16 +237,19 @@
6: "<= 0.320 m",
7: "> 0.320 m",
}
"""Troposphere quality enumeration"""

SF044_ENUM = {
0: "Troposphere small coefficient block",
1: "Troposphere large coefficient block",
}
"""Troposphere polynomial coefficient size indicator"""

SF051_ENUM = {
0: "Troposphere small residual",
1: "Tropospherelarge residual",
}
"""Troposphere residual field size"""

SF055_ENUM = {
0: "Unknown",
Expand All @@ -219,44 +269,51 @@
14: "<= 143.36 TECU",
15: "> 143.36 TECU",
}
"""Ionosphere quality enumeration"""

SF056_ENUM = {
0: "Ionosphere small coefficient block",
1: "Ionosphere large coefficient block",
}
"""Ionosphere polynomial coefficient size indicator"""

SF063_ENUM = {
0: "Ionosphere small residual",
1: "Ionosphere medium residual",
2: "Ionosphere large residual",
3: "Ionosphere extra large residual",
}
"""Ionosphere residual field size enumeration"""

SF070_ENUM = {
0: "350 km",
1: "400 km",
2: "450 km",
3: "500 km",
}
"""Ionosphere shell height enumeration"""

SF077_ENUM = SF078_ENUM = {
0: "2.5 deg",
1: "5.0 deg",
2: "10.0 deg",
3: "15.0 deg",
}
"""BPAC area latitude/longitude grid node spacing enumeration"""

SF081_ENUM = {
0: "small VTEC residual",
1: "large VTEC residual",
}
"""VTEC size indicator"""

SF085_ENUM = {
0: "AES",
1: "ChaCha12",
2: "ChaCha20",
# 3-15 : TBD
}
"""Encryption Type enumeration"""

SF087_ENUM = { # no bits
0: 96,
Expand All @@ -266,7 +323,7 @@
4: 512,
# 5-15 : TBD
}

"""Key length enumeration"""

SF090_ENUM = {
0: "none",
Expand All @@ -275,6 +332,7 @@
3: "SHA-3",
# 4-15 : TBD
}
"""Group Authentication Type enumeration"""

SF091_ENUM = { # no bits
0: 32,
Expand All @@ -286,34 +344,15 @@
6: 512,
# 7-15 : TBD
}

SF093_ENUM = { # leftmost 2 bits
0: 36,
1: 45,
2: 54,
3: 64,
}

SF094_ENUM = { # leftmost 2 bits
0: 37,
1: 46,
2: 55,
3: 64,
}

SF095_ENUM = { # leftmost 2 bits
0: 10,
1: 40,
2: 48,
3: 64,
}
"""Computed Authentication Data (CAD) Length enumeration"""

SF096_ENUM = {
0: "Galileo F/NAV",
1: "Galileo I/NAV",
2: "Galileo C/NAV",
# 3-7: TBD
}
"""Galileo ephemeris type"""

SF097_ENUM = {
0: "D1 Nav (B1I)",
Expand All @@ -324,10 +363,12 @@
5: "B-CNAV2",
# 6-15: TBD
}
"""BDS ephemeris type"""

SF098_ENUM = {
0: "LNAV (L1C/A)",
1: "CNAV2 (L1C)",
2: "CNAV (L2C,L5)",
# 3-7: TBD
}
"""QZSS ephemeris type"""
8 changes: 4 additions & 4 deletions src/pyspartn/spartntypes_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@
"SF074": (FL, 9, 1.0, -180.0, "BPAC area reference longitude"),
"SF075": (IN, 4, 1, "BPAC area latitude grid node count"),
"SF076": (IN, 4, 1, "BPAC area longitude grid node count"),
"SF077": (IN, 2, 1, "BPAC area latitude grid node spacing "),
"SF078": (IN, 2, 1, "BPAC area longitude grid node spacing "),
"SF077": (IN, 2, 1, "BPAC area latitude grid node spacing"),
"SF078": (IN, 2, 1, "BPAC area longitude grid node spacing"),
"SF079": (BM, "N", "Bitmask", "Grid node present mask"),
"SF080": (FL, 12, 0.25, -511.75, "Area average VTEC"),
"SF081": (IN, 1, 1, "VTEC size indicator"),
"SF082": (FL, 7, 0.25, -15.75, "Small VTEC residual "),
"SF083": (FL, 11, 0.25, -255.75, "Large VTEC residual "),
"SF082": (FL, 7, 0.25, -15.75, "Small VTEC residual"),
"SF083": (FL, 11, 0.25, -255.75, "Large VTEC residual"),
"SF084": (IN, 20, 1, "Customer Key ID"),
"SF085": (EN, 4, 1, "Encryption Type"),
"SF085a": (EN, 4, 1, "Encryption Type"),
Expand Down

0 comments on commit 0ad99ab

Please sign in to comment.