1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-11-16 05:03:17 -05:00

Scripts API: SuperScanner: added hotspots numbr noise threshold option (-N)

This commit is contained in:
f4exb 2020-05-27 19:07:43 +02:00
parent 981c7129a3
commit 44d17e8bfc
2 changed files with 13 additions and 5 deletions

View File

@ -211,11 +211,16 @@ The script runs in daemon mode and is stopped using `Ctl-C`.
- `-X` or `--psd-exclude-higher` Level above which to exclude bin scan during PSD floor estimation - `-X` or `--psd-exclude-higher` Level above which to exclude bin scan during PSD floor estimation
- `-x` or `--psd-exclude-lower` Level below which to exclude bin scan during PSD floor estimation - `-x` or `--psd-exclude-lower` Level below which to exclude bin scan during PSD floor estimation
- `-G` or `--psd-graph` Show PSD floor graphs. Requires `matplotlib` - `-G` or `--psd-graph` Show PSD floor graphs. Requires `matplotlib`
- `-N` or `--hotspots-noise` Number of hotspots above which detection is considered as noise. Default `8`
- `-m` or `--margin` Margin in dB above PSD floor to detect acivity. Default: `3` - `-m` or `--margin` Margin in dB above PSD floor to detect acivity. Default: `3`
- `-g` or `--group-tolerance` Radius (1D) tolerance in points (bins) for hotspot aggregation. Default `1` - `-g` or `--group-tolerance` Radius (1D) tolerance in points (bins) for hotspot aggregation. Default `1`
- `-r` or `--freq-round` Frequency rounding value in Hz. Default: `1` (no rounding) - `-r` or `--freq-round` Frequency rounding value in Hz. Default: `1` (no rounding)
- `-o` or `--freq-offset` Frequency rounding offset in Hz. Default: `0` (no offset) - `-o` or `--freq-offset` Frequency rounding offset in Hz. Default: `0` (no offset)
Command examples:
- `python ./superscanner.py -a 127.0.0.1 -p 8889 -w 8886 -c 446M.json -g 10 -r 12500 -o 6250 -J psd_pmr.json`
- `python ./superscanner.py -a 192.168.0.3 -j psd.json -c 145M.json -g 10 -r 2500`
<h3>Configuration file</h3> <h3>Configuration file</h3>
This file drives how channels in the connected SDRangel instance are managed. This file drives how channels in the connected SDRangel instance are managed.

View File

@ -60,11 +60,12 @@ def get_input_options(args=None):
parser.add_option("-J", "--psd-out", dest="psd_output_file", help="Write PSD floor information to JSON file.", metavar="FILE", type="string") parser.add_option("-J", "--psd-out", dest="psd_output_file", help="Write PSD floor information to JSON file.", metavar="FILE", type="string")
parser.add_option("-n", "--nb-passes", dest="passes", help="Number of passes for PSD floor estimation. Default: 10", metavar="NUM", type="int") parser.add_option("-n", "--nb-passes", dest="passes", help="Number of passes for PSD floor estimation. Default: 10", metavar="NUM", type="int")
parser.add_option("-m", "--margin", dest="margin", help="Margin in dB above PSD floor to detect acivity. Default: 3", metavar="DB", type="int") parser.add_option("-m", "--margin", dest="margin", help="Margin in dB above PSD floor to detect acivity. Default: 3", metavar="DB", type="int")
parser.add_option("-f", "--psd-level", dest="psd_fixed", help="Use a fixed PSD floor value.", metavar="FILE", type="float") parser.add_option("-f", "--psd-level", dest="psd_fixed", help="Use a fixed PSD floor value.", metavar="DB", type="float")
parser.add_option("-X", "--psd-exclude-higher", dest="psd_exclude_higher", help="Level above which to exclude bin scan.", metavar="FILE", type="float") parser.add_option("-X", "--psd-exclude-higher", dest="psd_exclude_higher", help="Level above which to exclude bin scan.", metavar="DB", type="float")
parser.add_option("-x", "--psd-exclude-lower", dest="psd_exclude_lower", help="Level below which to exclude bin scan.", metavar="FILE", type="float") parser.add_option("-x", "--psd-exclude-lower", dest="psd_exclude_lower", help="Level below which to exclude bin scan.", metavar="DB", type="float")
parser.add_option("-N", "--hotspots-noise", dest="hotspots_noise", help="Number of hotspots above which detection is considered as noise. Default 8", metavar="NUM", type="int")
parser.add_option("-G", "--psd-graph", dest="psd_graph", help="Show PSD floor graphs. Requires matplotlib", action="store_true") parser.add_option("-G", "--psd-graph", dest="psd_graph", help="Show PSD floor graphs. Requires matplotlib", action="store_true")
parser.add_option("-g", "--group-tolerance", dest="group_tolerance", help="Radius (1D) tolerance in points (bins) for hotspots grouping. Default 1.", metavar="FILE", type="int") parser.add_option("-g", "--group-tolerance", dest="group_tolerance", help="Radius (1D) tolerance in points (bins) for hotspots grouping. Default 1.", metavar="NUM", type="int")
parser.add_option("-r", "--freq-round", dest="freq_round", help="Frequency rounding value in Hz. Default: 1 (no rounding)", metavar="NUM", type="int") parser.add_option("-r", "--freq-round", dest="freq_round", help="Frequency rounding value in Hz. Default: 1 (no rounding)", metavar="NUM", type="int")
parser.add_option("-o", "--freq-offset", dest="freq_offset", help="Frequency rounding offset in Hz. Default: 0 (no offset)", metavar="NUM", type="int") parser.add_option("-o", "--freq-offset", dest="freq_offset", help="Frequency rounding offset in Hz. Default: 0 (no offset)", metavar="NUM", type="int")
@ -85,6 +86,8 @@ def get_input_options(args=None):
options.passes = 1 options.passes = 1
if (options.margin == None): if (options.margin == None):
options.margin = 3 options.margin = 3
if (options.hotspots_noise == None):
options.hotspots_noise = 8
if (options.group_tolerance == None): if (options.group_tolerance == None):
options.group_tolerance = 1 options.group_tolerance = 1
if (options.freq_round == None): if (options.freq_round == None):
@ -276,7 +279,7 @@ def get_hotspot_frequency(channel, hotspot):
# ====================================================================== # ======================================================================
def process_hotspots(scanned_hotspots): def process_hotspots(scanned_hotspots):
global CONFIG global CONFIG
if len(scanned_hotspots) > 8: # burst noise TODO: parametrize if len(scanned_hotspots) > OPTIONS.hotspots_noise
return return
# calculate frequency for each hotspot and create list of valid hotspots # calculate frequency for each hotspot and create list of valid hotspots
hotspots = [] hotspots = []