diff --git a/scriptsapi/Readme.md b/scriptsapi/Readme.md index ed8dc7401..6d49000e3 100644 --- a/scriptsapi/Readme.md +++ b/scriptsapi/Readme.md @@ -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-lower` Level below which to exclude bin scan during PSD floor estimation - `-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` - `-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) - `-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` +

Configuration file

This file drives how channels in the connected SDRangel instance are managed. diff --git a/scriptsapi/superscanner.py b/scriptsapi/superscanner.py index 6620fef19..12eaaf68a 100644 --- a/scriptsapi/superscanner.py +++ b/scriptsapi/superscanner.py @@ -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("-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("-f", "--psd-level", dest="psd_fixed", help="Use a fixed PSD floor value.", metavar="FILE", 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-lower", dest="psd_exclude_lower", help="Level below which to exclude bin scan.", 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="DB", 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", "--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("-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 if (options.margin == None): options.margin = 3 + if (options.hotspots_noise == None): + options.hotspots_noise = 8 if (options.group_tolerance == None): options.group_tolerance = 1 if (options.freq_round == None): @@ -276,7 +279,7 @@ def get_hotspot_frequency(channel, hotspot): # ====================================================================== def process_hotspots(scanned_hotspots): global CONFIG - if len(scanned_hotspots) > 8: # burst noise TODO: parametrize + if len(scanned_hotspots) > OPTIONS.hotspots_noise return # calculate frequency for each hotspot and create list of valid hotspots hotspots = []