ka9q / ka9q-radio

Multichannel SDR based on fast convolution and IP multicasting
GNU General Public License v3.0
177 stars 42 forks source link

Remove trailing comma from powers output, and don't override the locale #65

Closed argilo closed 7 hours ago

argilo commented 1 week ago

powers prints a trailing comma at the end of each line. Here I have removed the extraneous comma, which makes the output more like rtl_power.

argilo commented 1 week ago

I added a second commit to fix another bug. Namely, powers overrides the C locale, which corrupts the CSV output in locales which use a comma as the decimal point:

argilo@sonde:~ $ LANG=de_DE.UTF-8 powers radiosonde.local -f 403025000.0 -w 800.0 -b 10 -i 1 -s 1234 -c 2
Sat 16 Nov 2024 00:18:39.417195 UTC, 403020992, 403028192, 800, 10, -0,4, -0,4, -0,1, -0,1, -0,4, -0,4, -0,4, -0,4, -0,5, -0,5,
Sat 16 Nov 2024 00:18:40.434490 UTC, 403020992, 403028192, 800, 10, -0,5, -0,2, 0,0, -0,4, -0,8, -0,6, -0,8, -0,6, -0,6, -0,0,
argilo@sonde:~ $ LANG=C powers radiosonde.local -f 403025000.0 -w 800.0 -b 10 -i 1 -s 1234 -c 2
Sat 16 Nov 2024 00:18:43.079096 UTC, 403020992, 403028192, 800, 10, -0.1, -0.1, 0.2, 0.2, -0.1, -0.1, -0.4, -0.3, -0.3, 0.1,
Sat 16 Nov 2024 00:18:44.096287 UTC, 403020992, 403028192, 800, 10, 0.2, -0.0, 0.2, 0.3, -0.3, 0.2, -0.2, -0.2, -0.0, -0.3,

Removing the locale override fixes the issue by ensuring that the program runs using the C locale.

ka9q commented 7 hours ago

Thanks!