Skip to content

Commit

Permalink
Merge pull request #939 from darksidelemm/testing
Browse files Browse the repository at this point in the history
Remove scan plot data decimation.
  • Loading branch information
darksidelemm authored Nov 15, 2024
2 parents 994f219 + df6dfdf commit 3ec9911
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 38 deletions.
2 changes: 1 addition & 1 deletion auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.

__version__ = "1.8.0-beta2"
__version__ = "1.8.0-beta3"

# Global Variables

Expand Down
9 changes: 2 additions & 7 deletions auto_rx/autorx/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from types import FunctionType, MethodType
from .utils import (
detect_peaks,
rtlsdr_test,
reset_rtlsdr_by_serial,
reset_all_rtlsdrs,
peak_decimation,
timeout_cmd
)
from .sdr_wrappers import test_sdr, reset_sdr, get_sdr_name, get_sdr_iq_cmd, get_sdr_fm_cmd, get_power_spectrum, shutdown_sdr
Expand Down Expand Up @@ -974,9 +970,8 @@ def sonde_search(self, first_only=False):
raise ValueError("Error getting PSD")

# Update the global scan result
(_freq_decimate, _power_decimate) = peak_decimation(freq / 1e6, power, 10)
scan_result["freq"] = list(_freq_decimate)
scan_result["power"] = list(_power_decimate)
scan_result["freq"] = [round(x,6) for x in list(freq/1e6)]
scan_result["power"] = [round(x,2) for x in list(power)]
scan_result["timestamp"] = datetime.datetime.now(datetime.timezone.utc).isoformat()
scan_result["peak_freq"] = []
scan_result["peak_lvl"] = []
Expand Down
30 changes: 0 additions & 30 deletions auto_rx/autorx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,36 +1076,6 @@ def position_info(listener, balloon):
}


def peak_decimation(freq, power, factor):
""" Peak-preserving Decimation.
Args:
freq (list): Frequency Data.
power (list): Power data.
factor (int): Decimation factor.
Returns:
tuple: (freq, power)
"""

_out_len = len(freq) // factor

_freq_out = []
_power_out = []

try:
for i in range(_out_len):
_f_slice = freq[i * factor : i * factor + factor]
_p_slice = power[i * factor : i * factor + factor]

_freq_out.append(_f_slice[np.argmax(_p_slice)])
_power_out.append(_p_slice.max())
except:
pass

return (_freq_out, _power_out)


if __name__ == "__main__":
import sys

Expand Down

0 comments on commit 3ec9911

Please sign in to comment.