@@ -72,7 +72,7 @@ def matchAB5SSRecords(jWSPRRec1, jWSPRRec2):
7272 aMatch .append (jWSPRRec1 [i ])
7373 aMatch .append (jWSPRRec2 [j ])
7474 logging .debug (f" Found 1st record to process = { jWSPRRec1 [i ]['tx_sign' ]} , { jWSPRRec1 [i ]['time' ]} , { jWSPRRec1 [i ]['tx_loc' ]} , { jWSPRRec1 [i ]['band' ]} " )
75- logging .debug (f" Found 2nd record to process = { jWSPRRec2 [j ]['tx_sign' ]} , { jWSPRRec2 [j ]['time' ]} , { jWSPRRec2 [j ]['tx_loc' ]} , { jWSPRRec1 [j ]['band' ]} " )
75+ logging .debug (f" Found 2nd record to process = { jWSPRRec2 [j ]['tx_sign' ]} , { jWSPRRec2 [j ]['time' ]} , { jWSPRRec2 [j ]['tx_loc' ]} , { jWSPRRec2 [j ]['band' ]} " )
7676 else :
7777 logging .debug (f" Found 1st record to process but no match = { jWSPRRec1 [i ]['tx_sign' ]} , { jWSPRRec1 [i ]['time' ]} , { jWSPRRec1 [i ]['tx_loc' ]} , { jWSPRRec1 [i ]['band' ]} " )
7878
@@ -186,15 +186,15 @@ def decodeRecords(Packet1, Packet2):
186186 #print(f"azimuth = {azimuth}, elevation = {elevation}")
187187
188188 logging .debug (f" Telemetry data: callsign1 = { Packet1 ['tx_sign' ]} , callsign2 = { Packet2 ['tx_sign' ]} , time = { Packet1 ['time' ]} , " +
189- f"channel = { Channel } , Grid = { Grid } , Sat = { Sat } , Speed = { Speed } , Alt (m) = { Altitude } , Temp (c) = { Temp } , azimuth = { azimuth } , elevation = { elevation } " )
189+ f"channel = { Channel } , grid = { Grid } , sats = { Sat } , speed = { Speed } , alt (m) = { Altitude } , temp (c) = { Temp } , azimuth = { azimuth } , elevation = { elevation } " )
190190
191191 TelemetryData = {
192192 "callsign1" : Packet1 ['tx_sign' ],
193193 "callsign2" : Packet2 ['tx_sign' ],
194194 "time" : Packet1 ['time' ],
195195 "channel" : Channel ,
196196 "grid" : Grid ,
197- "sat " : Sat ,
197+ "sats " : Sat ,
198198 "speed" : Speed ,
199199 "altitude" : Altitude ,
200200 "temp" : Temp ,
@@ -313,7 +313,7 @@ def getAB5SS(bCfg, last_date):
313313 logging .warning (" Exit function, insufficient WSPR records to process" )
314314 return 0 , None , None
315315
316- # pprint.pp(jWsprData)
316+ pprint .pp (jWsprData )
317317 print ("-" * 40 )
318318
319319 callsign = jWsprData [record_count - 1 ]['tx_sign' ]
@@ -371,13 +371,14 @@ def getAB5SS(bCfg, last_date):
371371
372372 # add telemetry data
373373 # build strComment channel, Sats?, voltage?, alt(m), 0C?, grid, callsign2, callsign1, comment
374- strComment = str (jDecodedData [i ]['channel' ]) + " Sats (voltage) " + str ( jDecodedData [i ]['altitude' ]) + "m OC " + jDecodedData [i ]['grid' ] + " " + jDecodedData [ i ][ 'callsign2' ]
375- strComment += " " + jDecodedData [i ]['callsign1' ] + " " + bCfg ['comment' ]
374+ strComment = str (jDecodedData [i ]['channel' ]) + " Sats " + jDecodedData [i ]['sats' ] + " (voltage) " + str ( jDecodedData [i ]['altitude' ]) + "m "
375+ strComment += str ( jDecodedData [ i ][ 'temp' ]) + "C " + jDecodedData [ i ][ 'grid' ] + " " + jDecodedData [ i ][ 'callsign2' ] + " " + jDecodedData [i ]['callsign1' ] + " " + bCfg ['comment' ]
376376
377377 # put data into jUploadData format for uploading
378+ lat , lon = GridtoLatLon (jDecodedData [i ]['grid' ])
378379 JSON = {"software_name" : SOFTWARE_NAME , "software_version" : __version__ , "uploader_callsign" : bCfg ['uploadcallsign' ], "time_received" : datetime1 ,
379- "payload_callsign" : BalloonCallsign , "datetime" : datetime2 , "lat" : aMatch [ i ][ 'tx_lat' ], "lon" : aMatch [ i ][ 'tx_lon' ] , "alt" : jDecodedData [i ]['altitude' ],
380- "grid" : jDecodedData [i ]['grid' ], "comment" : strComment }
380+ "payload_callsign" : BalloonCallsign , "datetime" : datetime2 , "lat" : round ( lat , 3 ), "lon" : round ( lon , 3 ) , "alt" : jDecodedData [i ]['altitude' ],
381+ "sats" : jDecodedData [ i ][ 'sats' ], "temp" : jDecodedData [ i ][ 'temp' ], " grid" : jDecodedData [i ]['grid' ], "comment" : strComment }
381382 jUploadData .append (JSON )
382383
383384
@@ -388,19 +389,8 @@ def getAB5SS(bCfg, last_date):
388389 # create data file for John
389390 # !!!!!!!!!!!!!!!!!!!!!!!!!
390391 if bCfg ['telemetryfile' ] == 'Y' :
391- """
392- jDump = {}
393- for index, element in enumerate(aMatch):
394- jDump[index] = element
395- print("="*40)
396- pprint.pp(jDump)
397- print(f"jDump record count = {len(jDump)}")
398- json_object = json.dumps(jDump, indent=4)
399- with open("AB5SS-dump.json", "w") as outfile:
400- outfile.write(json_object)
401- """
402392 pprint .pp (jDecodedData , indent = 2 )
403- outputFilename = BalloonCallsign + ".txt "
393+ outputFilename = BalloonCallsign + ".csv "
404394 with open (outputFilename , 'w' ) as file :
405395 csv_file = csv .writer (file )
406396 csv_file .writerow (jDecodedData [0 ].keys ()) # write header from keys
0 commit comments