spectre-core 0.0.22__py3-none-any.whl → 0.0.23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. spectre_core/_file_io/__init__.py +4 -4
  2. spectre_core/_file_io/file_handlers.py +60 -106
  3. spectre_core/batches/__init__.py +20 -3
  4. spectre_core/batches/_base.py +85 -134
  5. spectre_core/batches/_batches.py +55 -99
  6. spectre_core/batches/_factory.py +21 -20
  7. spectre_core/batches/_register.py +8 -8
  8. spectre_core/batches/plugins/_batch_keys.py +7 -6
  9. spectre_core/batches/plugins/_callisto.py +65 -97
  10. spectre_core/batches/plugins/_iq_stream.py +105 -169
  11. spectre_core/capture_configs/__init__.py +46 -17
  12. spectre_core/capture_configs/_capture_config.py +25 -52
  13. spectre_core/capture_configs/_capture_modes.py +8 -6
  14. spectre_core/capture_configs/_capture_templates.py +50 -110
  15. spectre_core/capture_configs/_parameters.py +37 -74
  16. spectre_core/capture_configs/_pconstraints.py +40 -40
  17. spectre_core/capture_configs/_pnames.py +36 -34
  18. spectre_core/capture_configs/_ptemplates.py +260 -347
  19. spectre_core/capture_configs/_pvalidators.py +99 -102
  20. spectre_core/config/__init__.py +13 -8
  21. spectre_core/config/_paths.py +18 -35
  22. spectre_core/config/_time_formats.py +6 -5
  23. spectre_core/exceptions.py +38 -0
  24. spectre_core/jobs/__init__.py +3 -6
  25. spectre_core/jobs/_duration.py +12 -0
  26. spectre_core/jobs/_jobs.py +72 -43
  27. spectre_core/jobs/_workers.py +55 -105
  28. spectre_core/logs/__init__.py +7 -2
  29. spectre_core/logs/_configure.py +13 -17
  30. spectre_core/logs/_decorators.py +6 -4
  31. spectre_core/logs/_logs.py +37 -89
  32. spectre_core/logs/_process_types.py +5 -3
  33. spectre_core/plotting/__init__.py +13 -3
  34. spectre_core/plotting/_base.py +64 -138
  35. spectre_core/plotting/_format.py +10 -8
  36. spectre_core/plotting/_panel_names.py +7 -5
  37. spectre_core/plotting/_panel_stack.py +82 -115
  38. spectre_core/plotting/_panels.py +120 -155
  39. spectre_core/post_processing/__init__.py +6 -3
  40. spectre_core/post_processing/_base.py +41 -55
  41. spectre_core/post_processing/_factory.py +14 -11
  42. spectre_core/post_processing/_post_processor.py +16 -12
  43. spectre_core/post_processing/_register.py +10 -7
  44. spectre_core/post_processing/plugins/_event_handler_keys.py +4 -3
  45. spectre_core/post_processing/plugins/_fixed_center_frequency.py +54 -47
  46. spectre_core/post_processing/plugins/_swept_center_frequency.py +199 -174
  47. spectre_core/receivers/__init__.py +9 -2
  48. spectre_core/receivers/_base.py +82 -148
  49. spectre_core/receivers/_factory.py +20 -30
  50. spectre_core/receivers/_register.py +7 -10
  51. spectre_core/receivers/_spec_names.py +17 -15
  52. spectre_core/receivers/plugins/_b200mini.py +47 -60
  53. spectre_core/receivers/plugins/_receiver_names.py +8 -6
  54. spectre_core/receivers/plugins/_rsp1a.py +44 -40
  55. spectre_core/receivers/plugins/_rspduo.py +59 -44
  56. spectre_core/receivers/plugins/_sdrplay_receiver.py +67 -83
  57. spectre_core/receivers/plugins/_test.py +136 -129
  58. spectre_core/receivers/plugins/_usrp.py +93 -85
  59. spectre_core/receivers/plugins/gr/__init__.py +1 -1
  60. spectre_core/receivers/plugins/gr/_base.py +14 -22
  61. spectre_core/receivers/plugins/gr/_rsp1a.py +53 -60
  62. spectre_core/receivers/plugins/gr/_rspduo.py +77 -89
  63. spectre_core/receivers/plugins/gr/_test.py +49 -57
  64. spectre_core/receivers/plugins/gr/_usrp.py +61 -59
  65. spectre_core/spectrograms/__init__.py +21 -13
  66. spectre_core/spectrograms/_analytical.py +108 -99
  67. spectre_core/spectrograms/_array_operations.py +39 -46
  68. spectre_core/spectrograms/_spectrogram.py +289 -322
  69. spectre_core/spectrograms/_transform.py +106 -73
  70. spectre_core/wgetting/__init__.py +1 -3
  71. spectre_core/wgetting/_callisto.py +87 -93
  72. {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/METADATA +9 -23
  73. spectre_core-0.0.23.dist-info/RECORD +79 -0
  74. {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/WHEEL +1 -1
  75. spectre_core-0.0.22.dist-info/RECORD +0 -78
  76. {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/licenses/LICENSE +0 -0
  77. {spectre_core-0.0.22.dist-info → spectre_core-0.0.23.dist-info}/top_level.txt +0 -0
@@ -4,15 +4,17 @@
4
4
 
5
5
  from enum import Enum
6
6
 
7
- class ReceiverName(Enum):
7
+
8
+ class ReceiverName(Enum):
8
9
  """A `spectre` supported receiver.
9
-
10
+
10
11
  :ivar RSP1A: SDRPlay RSP1A
11
12
  :ivar RSPDUO: SDRPlay RSPduo
12
13
  :ivar TEST: `spectre` test receiver.
13
14
  :ivar B200MINI: USRP B200mini.
14
15
  """
15
- RSP1A = "rsp1a"
16
- RSPDUO = "rspduo"
17
- TEST = "test"
18
- B200MINI = "b200mini"
16
+
17
+ RSP1A = "rsp1a"
18
+ RSPDUO = "rspduo"
19
+ TEST = "test"
20
+ B200MINI = "b200mini"
@@ -7,59 +7,63 @@ from dataclasses import dataclass
7
7
  from ._receiver_names import ReceiverName
8
8
  from .gr._rsp1a import CaptureMethod
9
9
  from ._sdrplay_receiver import (
10
- get_pvalidator_fixed_center_frequency, get_pvalidator_swept_center_frequency,
11
- get_capture_template_fixed_center_frequency, get_capture_template_swept_center_frequency
10
+ get_pvalidator_fixed_center_frequency,
11
+ get_pvalidator_swept_center_frequency,
12
+ get_capture_template_fixed_center_frequency,
13
+ get_capture_template_swept_center_frequency,
12
14
  )
13
15
  from .._spec_names import SpecName
14
16
  from .._base import BaseReceiver
15
17
  from .._register import register_receiver
16
18
 
19
+
17
20
  @dataclass(frozen=True)
18
21
  class Mode:
19
22
  """An operating mode for the `RSP1A` receiver."""
20
- FIXED_CENTER_FREQUENCY = "fixed_center_frequency"
21
- SWEPT_CENTER_FREQUENCY = "swept_center_frequency"
23
+
24
+ FIXED_CENTER_FREQUENCY = "fixed_center_frequency"
25
+ SWEPT_CENTER_FREQUENCY = "swept_center_frequency"
22
26
 
23
27
 
24
28
  @register_receiver(ReceiverName.RSP1A)
25
29
  class RSP1A(BaseReceiver):
26
30
  """Receiver implementation for the SDRPlay RSP1A (https://www.sdrplay.com/rsp1a/)"""
27
- def _add_specs(
28
- self
29
- ) -> None:
30
- self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
31
- self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6 )
32
- self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , 1e3 )
33
- self.add_spec( SpecName.FREQUENCY_UPPER_BOUND , 2e9 )
34
- self.add_spec( SpecName.IF_GAIN_UPPER_BOUND , -20 )
35
- self.add_spec( SpecName.RF_GAIN_UPPER_BOUND , 0 )
36
- self.add_spec( SpecName.API_RETUNING_LATENCY , 50 * 1e-3 )
37
- self.add_spec( SpecName.BANDWIDTH_OPTIONS,
38
- [200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000])
39
31
 
32
+ def _add_specs(self) -> None:
33
+ self.add_spec(SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3)
34
+ self.add_spec(SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6)
35
+ self.add_spec(SpecName.FREQUENCY_LOWER_BOUND, 1e3)
36
+ self.add_spec(SpecName.FREQUENCY_UPPER_BOUND, 2e9)
37
+ self.add_spec(SpecName.IF_GAIN_UPPER_BOUND, -20)
38
+ self.add_spec(SpecName.RF_GAIN_UPPER_BOUND, 0)
39
+ self.add_spec(SpecName.API_RETUNING_LATENCY, 25 * 1e-3)
40
+ self.add_spec(
41
+ SpecName.BANDWIDTH_OPTIONS,
42
+ [200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000],
43
+ )
44
+
45
+ def _add_capture_methods(self) -> None:
46
+ self.add_capture_method(
47
+ Mode.FIXED_CENTER_FREQUENCY, CaptureMethod.fixed_center_frequency
48
+ )
49
+ self.add_capture_method(
50
+ Mode.SWEPT_CENTER_FREQUENCY, CaptureMethod.swept_center_frequency
51
+ )
40
52
 
41
- def _add_capture_methods(
42
- self
43
- ) -> None:
44
- self.add_capture_method(Mode.FIXED_CENTER_FREQUENCY,
45
- CaptureMethod.fixed_center_frequency)
46
- self.add_capture_method(Mode.SWEPT_CENTER_FREQUENCY,
47
- CaptureMethod.swept_center_frequency)
48
-
53
+ def _add_capture_templates(self) -> None:
54
+ self.add_capture_template(
55
+ Mode.FIXED_CENTER_FREQUENCY,
56
+ get_capture_template_fixed_center_frequency(self),
57
+ )
58
+ self.add_capture_template(
59
+ Mode.SWEPT_CENTER_FREQUENCY,
60
+ get_capture_template_swept_center_frequency(self),
61
+ )
49
62
 
50
- def _add_capture_templates(
51
- self
52
- ) -> None:
53
- self.add_capture_template(Mode.FIXED_CENTER_FREQUENCY,
54
- get_capture_template_fixed_center_frequency(self))
55
- self.add_capture_template(Mode.SWEPT_CENTER_FREQUENCY,
56
- get_capture_template_swept_center_frequency(self))
57
-
58
-
59
- def _add_pvalidators(
60
- self
61
- ) -> None:
62
- self.add_pvalidator(Mode.FIXED_CENTER_FREQUENCY,
63
- get_pvalidator_fixed_center_frequency(self))
64
- self.add_pvalidator(Mode.SWEPT_CENTER_FREQUENCY,
65
- get_pvalidator_swept_center_frequency(self))
63
+ def _add_pvalidators(self) -> None:
64
+ self.add_pvalidator(
65
+ Mode.FIXED_CENTER_FREQUENCY, get_pvalidator_fixed_center_frequency(self)
66
+ )
67
+ self.add_pvalidator(
68
+ Mode.SWEPT_CENTER_FREQUENCY, get_pvalidator_swept_center_frequency(self)
69
+ )
@@ -8,8 +8,10 @@ from ._receiver_names import ReceiverName
8
8
  from .gr._rspduo import CaptureMethod
9
9
  from .._spec_names import SpecName
10
10
  from ._sdrplay_receiver import (
11
- get_pvalidator_fixed_center_frequency, get_pvalidator_swept_center_frequency,
12
- get_capture_template_fixed_center_frequency, get_capture_template_swept_center_frequency
11
+ get_pvalidator_fixed_center_frequency,
12
+ get_pvalidator_swept_center_frequency,
13
+ get_capture_template_fixed_center_frequency,
14
+ get_capture_template_swept_center_frequency,
13
15
  )
14
16
  from .._base import BaseReceiver
15
17
  from .._register import register_receiver
@@ -18,54 +20,67 @@ from .._register import register_receiver
18
20
  @dataclass
19
21
  class Mode:
20
22
  """An operating mode for the `RSPduo` receiver."""
21
- TUNER_1_FIXED_CENTER_FREQUENCY = f"tuner_1_fixed_center_frequency"
22
- TUNER_2_FIXED_CENTER_FREQUENCY = f"tuner_2_fixed_center_frequency"
23
- TUNER_1_SWEPT_CENTER_FREQUENCY = f"tuner_1_swept_center_frequency"
23
+
24
+ TUNER_1_FIXED_CENTER_FREQUENCY = f"tuner_1_fixed_center_frequency"
25
+ TUNER_2_FIXED_CENTER_FREQUENCY = f"tuner_2_fixed_center_frequency"
26
+ TUNER_1_SWEPT_CENTER_FREQUENCY = f"tuner_1_swept_center_frequency"
24
27
 
25
28
 
26
29
  @register_receiver(ReceiverName.RSPDUO)
27
30
  class RSPduo(BaseReceiver):
28
31
  """Receiver implementation for the SDRPlay RSPduo (https://www.sdrplay.com/rspduo/)"""
32
+
29
33
  def _add_specs(self) -> None:
30
- self.add_spec( SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3 )
31
- self.add_spec( SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6 )
32
- self.add_spec( SpecName.FREQUENCY_LOWER_BOUND , 1e3 )
33
- self.add_spec( SpecName.FREQUENCY_UPPER_BOUND , 2e9 )
34
- self.add_spec( SpecName.IF_GAIN_UPPER_BOUND , -20 )
35
- self.add_spec( SpecName.RF_GAIN_UPPER_BOUND , 0 )
36
- self.add_spec( SpecName.API_RETUNING_LATENCY , 50 * 1e-3 )
37
- self.add_spec( SpecName.BANDWIDTH_OPTIONS,
38
- [200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000])
34
+ self.add_spec(SpecName.SAMPLE_RATE_LOWER_BOUND, 200e3)
35
+ self.add_spec(SpecName.SAMPLE_RATE_UPPER_BOUND, 10e6)
36
+ self.add_spec(SpecName.FREQUENCY_LOWER_BOUND, 1e3)
37
+ self.add_spec(SpecName.FREQUENCY_UPPER_BOUND, 2e9)
38
+ self.add_spec(SpecName.IF_GAIN_UPPER_BOUND, -20)
39
+ self.add_spec(SpecName.RF_GAIN_UPPER_BOUND, 0)
40
+ self.add_spec(SpecName.API_RETUNING_LATENCY, 50 * 1e-3)
41
+ self.add_spec(
42
+ SpecName.BANDWIDTH_OPTIONS,
43
+ [200000, 300000, 600000, 1536000, 5000000, 6000000, 7000000, 8000000],
44
+ )
39
45
 
46
+ def _add_capture_methods(self) -> None:
47
+ self.add_capture_method(
48
+ Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
49
+ CaptureMethod.tuner_1_fixed_center_frequency,
50
+ )
51
+ self.add_capture_method(
52
+ Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
53
+ CaptureMethod.tuner_2_fixed_center_frequency,
54
+ )
55
+ self.add_capture_method(
56
+ Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
57
+ CaptureMethod.tuner_1_swept_center_frequency,
58
+ )
40
59
 
41
- def _add_capture_methods(
42
- self
43
- ) -> None:
44
- self.add_capture_method(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
45
- CaptureMethod.tuner_1_fixed_center_frequency)
46
- self.add_capture_method(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
47
- CaptureMethod.tuner_2_fixed_center_frequency)
48
- self.add_capture_method(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
49
- CaptureMethod.tuner_1_swept_center_frequency)
50
-
60
+ def _add_capture_templates(self) -> None:
61
+ self.add_capture_template(
62
+ Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
63
+ get_capture_template_fixed_center_frequency(self),
64
+ )
65
+ self.add_capture_template(
66
+ Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
67
+ get_capture_template_fixed_center_frequency(self),
68
+ )
69
+ self.add_capture_template(
70
+ Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
71
+ get_capture_template_swept_center_frequency(self),
72
+ )
51
73
 
52
- def _add_capture_templates(
53
- self
54
- ) -> None:
55
- self.add_capture_template(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
56
- get_capture_template_fixed_center_frequency(self))
57
- self.add_capture_template(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
58
- get_capture_template_fixed_center_frequency(self))
59
- self.add_capture_template(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
60
- get_capture_template_swept_center_frequency(self))
61
-
62
-
63
- def _add_pvalidators(
64
- self
65
- ) -> None:
66
- self.add_pvalidator(Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
67
- get_pvalidator_fixed_center_frequency(self))
68
- self.add_pvalidator(Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
69
- get_pvalidator_fixed_center_frequency(self))
70
- self.add_pvalidator(Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
71
- get_pvalidator_swept_center_frequency(self))
74
+ def _add_pvalidators(self) -> None:
75
+ self.add_pvalidator(
76
+ Mode.TUNER_1_FIXED_CENTER_FREQUENCY,
77
+ get_pvalidator_fixed_center_frequency(self),
78
+ )
79
+ self.add_pvalidator(
80
+ Mode.TUNER_2_FIXED_CENTER_FREQUENCY,
81
+ get_pvalidator_fixed_center_frequency(self),
82
+ )
83
+ self.add_pvalidator(
84
+ Mode.TUNER_1_SWEPT_CENTER_FREQUENCY,
85
+ get_pvalidator_swept_center_frequency(self),
86
+ )
@@ -5,170 +5,154 @@
5
5
  from typing import Callable, overload
6
6
 
7
7
  from spectre_core.capture_configs import (
8
- CaptureTemplate, CaptureMode, Parameters, Bound, PName,
9
- get_base_capture_template, get_base_ptemplate, OneOf,
10
- validate_fixed_center_frequency, validate_swept_center_frequency
8
+ CaptureTemplate,
9
+ CaptureMode,
10
+ Parameters,
11
+ Bound,
12
+ PName,
13
+ get_base_capture_template,
14
+ get_base_ptemplate,
15
+ OneOf,
16
+ validate_fixed_center_frequency,
17
+ validate_swept_center_frequency,
11
18
  )
12
19
  from .._base import BaseReceiver
13
20
  from .._spec_names import SpecName
14
21
 
15
22
 
16
23
  def get_pvalidator_fixed_center_frequency(
17
- sdrplay_receiver: BaseReceiver
24
+ sdrplay_receiver: BaseReceiver,
18
25
  ) -> Callable[[Parameters], None]:
19
26
  def pvalidator(parameters: Parameters) -> None:
20
27
  validate_fixed_center_frequency(parameters)
28
+
21
29
  return pvalidator
22
30
 
23
31
 
24
32
  def get_pvalidator_swept_center_frequency(
25
- sdrplay_receiver: BaseReceiver
33
+ sdrplay_receiver: BaseReceiver,
26
34
  ) -> Callable[[Parameters], None]:
27
35
  def pvalidator(parameters: Parameters) -> None:
28
- validate_swept_center_frequency(parameters,
29
- sdrplay_receiver.get_spec(SpecName.API_RETUNING_LATENCY))
36
+ validate_swept_center_frequency(
37
+ parameters, sdrplay_receiver.get_spec(SpecName.API_RETUNING_LATENCY)
38
+ )
39
+
30
40
  return pvalidator
31
41
 
32
42
 
33
43
  def get_capture_template_fixed_center_frequency(
34
- sdrplay_receiver: BaseReceiver
44
+ sdrplay_receiver: BaseReceiver,
35
45
  ) -> CaptureTemplate:
36
-
37
- capture_template = get_base_capture_template( CaptureMode.FIXED_CENTER_FREQUENCY )
38
- capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
39
- capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
40
- capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
46
+
47
+ capture_template = get_base_capture_template(CaptureMode.FIXED_CENTER_FREQUENCY)
48
+ capture_template.add_ptemplate(get_base_ptemplate(PName.BANDWIDTH))
49
+ capture_template.add_ptemplate(get_base_ptemplate(PName.IF_GAIN))
50
+ capture_template.add_ptemplate(get_base_ptemplate(PName.RF_GAIN))
41
51
 
42
52
  capture_template.set_defaults(
43
- (PName.BATCH_SIZE, 3.0),
44
- (PName.CENTER_FREQUENCY, 95800000),
45
- (PName.SAMPLE_RATE, 600000),
46
- (PName.BANDWIDTH, 600000),
47
- (PName.WINDOW_HOP, 512),
48
- (PName.WINDOW_SIZE, 1024),
49
- (PName.WINDOW_TYPE, "blackman"),
50
- (PName.RF_GAIN, -30),
51
- (PName.IF_GAIN, -30)
52
- )
53
+ (PName.BATCH_SIZE, 3.0),
54
+ (PName.CENTER_FREQUENCY, 95800000),
55
+ (PName.SAMPLE_RATE, 600000),
56
+ (PName.BANDWIDTH, 600000),
57
+ (PName.WINDOW_HOP, 512),
58
+ (PName.WINDOW_SIZE, 1024),
59
+ (PName.WINDOW_TYPE, "blackman"),
60
+ (PName.RF_GAIN, -30),
61
+ (PName.IF_GAIN, -30),
62
+ )
53
63
 
54
64
  capture_template.add_pconstraint(
55
65
  PName.CENTER_FREQUENCY,
56
66
  [
57
67
  Bound(
58
68
  lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
59
- upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
69
+ upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
60
70
  )
61
- ]
71
+ ],
62
72
  )
63
73
  capture_template.add_pconstraint(
64
74
  PName.SAMPLE_RATE,
65
75
  [
66
76
  Bound(
67
77
  lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
68
- upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
78
+ upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND),
69
79
  )
70
- ]
80
+ ],
71
81
  )
72
82
  capture_template.add_pconstraint(
73
- PName.BANDWIDTH,
74
- [
75
- OneOf(
76
- sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
77
- )
78
- ]
83
+ PName.BANDWIDTH, [OneOf(sdrplay_receiver.get_spec(SpecName.BANDWIDTH_OPTIONS))]
79
84
  )
80
85
  capture_template.add_pconstraint(
81
86
  PName.IF_GAIN,
82
- [
83
- Bound(
84
- upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
85
- )
86
- ]
87
+ [Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND))],
87
88
  )
88
89
  capture_template.add_pconstraint(
89
90
  PName.RF_GAIN,
90
- [
91
- Bound(
92
- upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
93
- )
94
- ]
91
+ [Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND))],
95
92
  )
96
93
  return capture_template
97
94
 
98
95
 
99
96
  def get_capture_template_swept_center_frequency(
100
- sdrplay_receiver: BaseReceiver
97
+ sdrplay_receiver: BaseReceiver,
101
98
  ) -> CaptureTemplate:
102
99
 
103
- capture_template = get_base_capture_template( CaptureMode.SWEPT_CENTER_FREQUENCY )
104
- capture_template.add_ptemplate( get_base_ptemplate(PName.BANDWIDTH) )
105
- capture_template.add_ptemplate( get_base_ptemplate(PName.IF_GAIN) )
106
- capture_template.add_ptemplate( get_base_ptemplate(PName.RF_GAIN) )
100
+ capture_template = get_base_capture_template(CaptureMode.SWEPT_CENTER_FREQUENCY)
101
+ capture_template.add_ptemplate(get_base_ptemplate(PName.BANDWIDTH))
102
+ capture_template.add_ptemplate(get_base_ptemplate(PName.IF_GAIN))
103
+ capture_template.add_ptemplate(get_base_ptemplate(PName.RF_GAIN))
107
104
 
108
105
  capture_template.set_defaults(
109
- (PName.BATCH_SIZE, 4.0),
110
- (PName.MIN_FREQUENCY, 95000000),
111
- (PName.MAX_FREQUENCY, 100000000),
112
- (PName.SAMPLES_PER_STEP, 80000),
113
- (PName.FREQUENCY_STEP, 1536000),
114
- (PName.SAMPLE_RATE, 1536000),
115
- (PName.BANDWIDTH, 1536000),
116
- (PName.WINDOW_HOP, 512),
117
- (PName.WINDOW_SIZE, 1024),
118
- (PName.WINDOW_TYPE, "blackman"),
119
- (PName.RF_GAIN, -30),
120
- (PName.IF_GAIN, -30)
121
- )
106
+ (PName.BATCH_SIZE, 4.0),
107
+ (PName.MIN_FREQUENCY, 95000000),
108
+ (PName.MAX_FREQUENCY, 100000000),
109
+ (PName.SAMPLES_PER_STEP, 80000),
110
+ (PName.FREQUENCY_STEP, 1536000),
111
+ (PName.SAMPLE_RATE, 1536000),
112
+ (PName.BANDWIDTH, 1536000),
113
+ (PName.WINDOW_HOP, 512),
114
+ (PName.WINDOW_SIZE, 1024),
115
+ (PName.WINDOW_TYPE, "blackman"),
116
+ (PName.RF_GAIN, -30),
117
+ (PName.IF_GAIN, -30),
118
+ )
122
119
 
123
120
  capture_template.add_pconstraint(
124
121
  PName.MIN_FREQUENCY,
125
122
  [
126
123
  Bound(
127
124
  lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
128
- upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
125
+ upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
129
126
  )
130
- ]
127
+ ],
131
128
  )
132
129
  capture_template.add_pconstraint(
133
130
  PName.MAX_FREQUENCY,
134
131
  [
135
132
  Bound(
136
133
  lower_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_LOWER_BOUND),
137
- upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND)
134
+ upper_bound=sdrplay_receiver.get_spec(SpecName.FREQUENCY_UPPER_BOUND),
138
135
  )
139
- ]
136
+ ],
140
137
  )
141
138
  capture_template.add_pconstraint(
142
139
  PName.SAMPLE_RATE,
143
140
  [
144
141
  Bound(
145
142
  lower_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_LOWER_BOUND),
146
- upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND)
143
+ upper_bound=sdrplay_receiver.get_spec(SpecName.SAMPLE_RATE_UPPER_BOUND),
147
144
  )
148
- ]
145
+ ],
149
146
  )
150
147
  capture_template.add_pconstraint(
151
- PName.BANDWIDTH,
152
- [
153
- OneOf(
154
- sdrplay_receiver.get_spec( SpecName.BANDWIDTH_OPTIONS )
155
- )
156
- ]
148
+ PName.BANDWIDTH, [OneOf(sdrplay_receiver.get_spec(SpecName.BANDWIDTH_OPTIONS))]
157
149
  )
158
150
  capture_template.add_pconstraint(
159
151
  PName.IF_GAIN,
160
- [
161
- Bound(
162
- upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND)
163
- )
164
- ]
152
+ [Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.IF_GAIN_UPPER_BOUND))],
165
153
  )
166
154
  capture_template.add_pconstraint(
167
155
  PName.RF_GAIN,
168
- [
169
- Bound(
170
- upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND)
171
- )
172
- ]
156
+ [Bound(upper_bound=sdrplay_receiver.get_spec(SpecName.RF_GAIN_UPPER_BOUND))],
173
157
  )
174
158
  return capture_template