kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Merge branch 'testing' into experimental
commit
46e5788e08
|
|
@ -204,7 +204,8 @@ def start_decoder(freq, sonde_type):
|
|||
exporter = exporter_functions,
|
||||
timeout = config['rx_timeout'],
|
||||
telem_filter = telemetry_filter,
|
||||
rs92_ephemeris = rs92_ephemeris
|
||||
rs92_ephemeris = rs92_ephemeris,
|
||||
imet_location = config['station_code']
|
||||
)
|
||||
autorx.sdr_list[_device_idx]['task'] = autorx.task_list[freq]['task']
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ def read_auto_rx_config(filename):
|
|||
'station_lat' : 0.0,
|
||||
'station_lon' : 0.0,
|
||||
'station_alt' : 0.0,
|
||||
'station_code' : 'SONDE',
|
||||
# Position Filter Settings
|
||||
'max_altitude' : 50000,
|
||||
'max_radius_km' : 1000,
|
||||
|
|
@ -235,6 +236,15 @@ def read_auto_rx_config(filename):
|
|||
except:
|
||||
logging.error("Config - Could not find debugging settings - using defaults.")
|
||||
|
||||
# iMet station code - added 2019-03-24
|
||||
try:
|
||||
auto_rx_config['station_code'] = config.get('location', 'station_code')
|
||||
if len(auto_rx_config['station_code']) > 5:
|
||||
auto_rx_config['station_code'] = auto_rx_config['station_code'][:5]
|
||||
logging.warning("Config - Clipped station code to 5 digits: %s" % auto_rx_config['station_code'])
|
||||
except:
|
||||
logging.error("Config - Could not find station_code field, using default.")
|
||||
|
||||
|
||||
# Now we attempt to read in the individual SDR parameters.
|
||||
auto_rx_config['sdr_settings'] = {}
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ class SondeDecoder(object):
|
|||
self.imet_id = imet_unique_id(_telemetry, custom=self.imet_location)
|
||||
|
||||
_telemetry['id'] = self.imet_id
|
||||
|
||||
_telemetry['station_code'] = self.imet_location
|
||||
|
||||
# If we have been provided a telemetry filter function, pass the telemetry data
|
||||
# through the filter, and return the response
|
||||
|
|
|
|||
|
|
@ -90,6 +90,12 @@ def sonde_telemetry_to_sentence(telemetry, payload_callsign=None, comment=None):
|
|||
if (telemetry['bt'] != -1) and (telemetry['bt'] != 65535):
|
||||
_sentence += " BT %s" % time.strftime("%H:%M:%S", time.gmtime(telemetry['bt']))
|
||||
|
||||
# Add on the station code, which will only be present if we are receiving an iMet sonde.
|
||||
# This may assist multiple receiving stations in the vicinity of an iMet launch site coordinate
|
||||
# the iMet unique ID generation.
|
||||
if 'station_code' in telemetry:
|
||||
_sentence += " LOC: %s" % telemetry['station_code']
|
||||
|
||||
# Add on any custom comment data if provided.
|
||||
if comment != None:
|
||||
comment = comment.replace(',','_')
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class TelemetryLogger(object):
|
|||
FILE_ACTIVITY_TIMEOUT = 30
|
||||
|
||||
# We require the following fields to be present in the input telemetry dict.
|
||||
REQUIRED_FIELDS = ['frame', 'id', 'datetime', 'lat', 'lon', 'alt', 'temp', 'type', 'freq', 'datetime_dt']
|
||||
REQUIRED_FIELDS = ['frame', 'id', 'datetime', 'lat', 'lon', 'alt', 'temp', 'humidity', 'type', 'freq', 'datetime_dt']
|
||||
|
||||
def __init__(self,
|
||||
log_directory = "./log"):
|
||||
|
|
@ -116,7 +116,7 @@ class TelemetryLogger(object):
|
|||
Args:
|
||||
telemetry (dict): Telemetry dictionary to process.
|
||||
"""
|
||||
_log_line = "%s,%s,%d,%.5f,%.5f,%.1f,%.1f,%s,%.3f" % (
|
||||
_log_line = "%s,%s,%d,%.5f,%.5f,%.1f,%.1f,%.1f,%s,%.3f" % (
|
||||
telemetry['datetime'],
|
||||
telemetry['id'],
|
||||
telemetry['frame'],
|
||||
|
|
@ -124,9 +124,17 @@ class TelemetryLogger(object):
|
|||
telemetry['lon'],
|
||||
telemetry['alt'],
|
||||
telemetry['temp'],
|
||||
telemetry['humidity'],
|
||||
telemetry['type'],
|
||||
telemetry['freq_float'])
|
||||
|
||||
# Other fields that may not always be present.
|
||||
if 'sats' in telemetry:
|
||||
_log_line += ",SATS %d" % telemetry['sats']
|
||||
|
||||
if 'batt' in telemetry:
|
||||
_log_line += ",BATT %.1f" % telemetry['batt']
|
||||
|
||||
# Check for Burst/Kill timer data, and add in.
|
||||
if 'bt' in telemetry:
|
||||
if (telemetry['bt'] != -1) and (telemetry['bt'] != 65535):
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ greylist = []
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
####################
|
||||
# STATION LOCATION #
|
||||
####################
|
||||
|
|
@ -82,6 +84,15 @@ station_lat = 0.0
|
|||
station_lon = 0.0
|
||||
station_alt = 0.0
|
||||
|
||||
# Location Code (Maximum 5 characters)
|
||||
# This is ONLY used by the Intermet iMet decoder, to provide additional entropy when
|
||||
# generating a unique ID for the iMet sondes, which do not transmit their serial number.
|
||||
# If you know the WMO number of the launch site, then this would be a good value to use.
|
||||
# Otherwise the ICAO Code of the airport nearest to the launch site would also work.
|
||||
# If you are not expecting to RX iMet sondes, then this can be left at its default.
|
||||
|
||||
station_code = SONDE
|
||||
|
||||
|
||||
|
||||
###########################
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue