kopia lustrzana https://github.com/projecthorus/chasemapper
Normalise longitude range for tawhiri predictions
rodzic
ce48b7b017
commit
c1fab8bdad
|
@ -40,6 +40,10 @@ def get_tawhiri_prediction(
|
|||
# Create RFC3339-compliant timestamp
|
||||
_dt_rfc3339 = launch_datetime.isoformat()
|
||||
|
||||
# Normalise longitude to range 0 to 360
|
||||
if launch_longitude < 0:
|
||||
launch_longitude += 360
|
||||
|
||||
_params = {
|
||||
"launch_latitude": launch_latitude,
|
||||
"launch_longitude": launch_longitude,
|
||||
|
@ -93,6 +97,10 @@ def parse_tawhiri_data(data):
|
|||
|
||||
for _point in _trajectory:
|
||||
|
||||
# Normalise longitude to range -180 to 180
|
||||
if _point["longitude"] > 180:
|
||||
_point["longitude"] -= 360
|
||||
|
||||
# Create UTC timestamp without using datetime.timestamp(), for Python 2.7 backwards compatibility.
|
||||
_dt = parse(_point["datetime"])
|
||||
_dt_timestamp = (_dt - _epoch).total_seconds()
|
||||
|
|
Ładowanie…
Reference in New Issue