Comments on what things are doing and also doing the DD step in the script

This commit is contained in:
nzkarit
2017-09-07 18:59:24 +12:00
parent 4f3f124790
commit 475bc5da83
3 changed files with 15 additions and 7 deletions
+6
View File
@@ -40,6 +40,10 @@ def encode_alt_modes(alt, bit13):
latz = 15
def nz(ctype):
"""
Number of geographic latitude zones between equator and a pole. It is set to NZ = 15 for Mode-S CPR encoding
https://adsb-decode-guide.readthedocs.io/en/latest/content/cpr.html
"""
return 4 * latz - ctype
def dlat(ctype, surface):
@@ -68,6 +72,8 @@ def dlon(declat_in, ctype, surface):
return tmp / nlcalc
#encode CPR position
# https://adsb-decode-guide.readthedocs.io/en/latest/content/cpr.html
# compact position reporting
def cpr_encode(lat, lon, ctype, surface):
if surface is True:
scalar = 2.**19