spectre-core 0.0.12__py3-none-any.whl → 0.0.13__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.
- spectre_core/_file_io/__init__.py +1 -3
- spectre_core/_file_io/file_handlers.py +163 -58
- spectre_core/batches/__init__.py +10 -11
- spectre_core/batches/_base.py +170 -78
- spectre_core/batches/_batches.py +149 -99
- spectre_core/batches/_factory.py +56 -14
- spectre_core/batches/_register.py +23 -8
- spectre_core/batches/plugins/_batch_keys.py +16 -0
- spectre_core/batches/plugins/_callisto.py +183 -0
- spectre_core/batches/plugins/_iq_stream.py +354 -0
- spectre_core/capture_configs/__init__.py +17 -13
- spectre_core/capture_configs/_capture_config.py +93 -34
- spectre_core/capture_configs/_capture_modes.py +22 -0
- spectre_core/capture_configs/_capture_templates.py +207 -122
- spectre_core/capture_configs/_parameters.py +115 -42
- spectre_core/capture_configs/_pconstraints.py +86 -35
- spectre_core/capture_configs/_pnames.py +49 -0
- spectre_core/capture_configs/_ptemplates.py +389 -346
- spectre_core/capture_configs/_pvalidators.py +117 -73
- spectre_core/config/__init__.py +6 -8
- spectre_core/config/_paths.py +65 -25
- spectre_core/config/_time_formats.py +15 -10
- spectre_core/exceptions.py +2 -4
- spectre_core/jobs/__init__.py +14 -0
- spectre_core/jobs/_jobs.py +111 -0
- spectre_core/jobs/_workers.py +171 -0
- spectre_core/logs/__init__.py +17 -0
- spectre_core/logs/_configure.py +67 -0
- spectre_core/logs/_decorators.py +33 -0
- spectre_core/logs/_logs.py +228 -0
- spectre_core/logs/_process_types.py +14 -0
- spectre_core/plotting/__init__.py +4 -2
- spectre_core/plotting/_base.py +204 -102
- spectre_core/plotting/_format.py +17 -4
- spectre_core/plotting/_panel_names.py +18 -0
- spectre_core/plotting/_panel_stack.py +167 -53
- spectre_core/plotting/_panels.py +341 -141
- spectre_core/post_processing/__init__.py +8 -6
- spectre_core/post_processing/_base.py +70 -44
- spectre_core/post_processing/_factory.py +42 -12
- spectre_core/post_processing/_post_processor.py +24 -26
- spectre_core/post_processing/_register.py +22 -6
- spectre_core/post_processing/plugins/_event_handler_keys.py +16 -0
- spectre_core/post_processing/plugins/_fixed_center_frequency.py +129 -0
- spectre_core/post_processing/{library → plugins}/_swept_center_frequency.py +215 -143
- spectre_core/py.typed +0 -0
- spectre_core/receivers/__init__.py +10 -7
- spectre_core/receivers/_base.py +220 -69
- spectre_core/receivers/_factory.py +53 -7
- spectre_core/receivers/_register.py +30 -9
- spectre_core/receivers/_spec_names.py +26 -15
- spectre_core/receivers/plugins/__init__.py +0 -0
- spectre_core/receivers/plugins/_receiver_names.py +16 -0
- spectre_core/receivers/plugins/_rsp1a.py +59 -0
- spectre_core/receivers/plugins/_rspduo.py +67 -0
- spectre_core/receivers/plugins/_sdrplay_receiver.py +190 -0
- spectre_core/receivers/plugins/_test.py +218 -0
- spectre_core/receivers/plugins/gr/_base.py +80 -0
- spectre_core/receivers/{gr → plugins/gr}/_rsp1a.py +42 -52
- spectre_core/receivers/{gr → plugins/gr}/_rspduo.py +61 -74
- spectre_core/receivers/{gr → plugins/gr}/_test.py +33 -31
- spectre_core/spectrograms/__init__.py +5 -3
- spectre_core/spectrograms/_analytical.py +121 -66
- spectre_core/spectrograms/_array_operations.py +103 -36
- spectre_core/spectrograms/_spectrogram.py +380 -207
- spectre_core/spectrograms/_transform.py +197 -169
- spectre_core/wgetting/__init__.py +4 -2
- spectre_core/wgetting/_callisto.py +173 -118
- {spectre_core-0.0.12.dist-info → spectre_core-0.0.13.dist-info}/METADATA +14 -7
- spectre_core-0.0.13.dist-info/RECORD +75 -0
- {spectre_core-0.0.12.dist-info → spectre_core-0.0.13.dist-info}/WHEEL +1 -1
- spectre_core/batches/library/_callisto.py +0 -96
- spectre_core/batches/library/_fixed_center_frequency.py +0 -133
- spectre_core/batches/library/_swept_center_frequency.py +0 -105
- spectre_core/logging/__init__.py +0 -11
- spectre_core/logging/_configure.py +0 -35
- spectre_core/logging/_decorators.py +0 -19
- spectre_core/logging/_log_handlers.py +0 -176
- spectre_core/post_processing/library/_fixed_center_frequency.py +0 -114
- spectre_core/receivers/gr/_base.py +0 -33
- spectre_core/receivers/library/_rsp1a.py +0 -61
- spectre_core/receivers/library/_rspduo.py +0 -69
- spectre_core/receivers/library/_sdrplay_receiver.py +0 -185
- spectre_core/receivers/library/_test.py +0 -221
- spectre_core-0.0.12.dist-info/RECORD +0 -64
- /spectre_core/receivers/{gr → plugins/gr}/__init__.py +0 -0
- {spectre_core-0.0.12.dist-info → spectre_core-0.0.13.dist-info}/LICENSE +0 -0
- {spectre_core-0.0.12.dist-info → spectre_core-0.0.13.dist-info}/top_level.txt +0 -0
@@ -1,69 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
-
# This file is part of SPECTRE
|
3
|
-
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
-
|
5
|
-
from typing import Optional
|
6
|
-
from dataclasses import dataclass
|
7
|
-
from functools import partial
|
8
|
-
|
9
|
-
from spectre_core.capture_configs import (
|
10
|
-
CaptureModes
|
11
|
-
)
|
12
|
-
from ..gr._rspduo import CaptureMethods
|
13
|
-
from .._spec_names import SpecNames
|
14
|
-
from ._sdrplay_receiver import SDRPlayReceiver
|
15
|
-
from .._register import register_receiver
|
16
|
-
|
17
|
-
@dataclass
|
18
|
-
class Modes:
|
19
|
-
TUNER_1_FIXED_CENTER_FREQUENCY = f"tuner-1-{CaptureModes.FIXED_CENTER_FREQUENCY}"
|
20
|
-
TUNER_2_FIXED_CENTER_FREQUENCY = f"tuner-2-{CaptureModes.FIXED_CENTER_FREQUENCY}"
|
21
|
-
TUNER_1_SWEPT_CENTER_FREQUENCY = f"tuner-1-{CaptureModes.SWEPT_CENTER_FREQUENCY}"
|
22
|
-
|
23
|
-
|
24
|
-
@register_receiver("rspduo")
|
25
|
-
class _Receiver(SDRPlayReceiver):
|
26
|
-
def __init__(self,
|
27
|
-
name: str,
|
28
|
-
mode: Optional[str]):
|
29
|
-
super().__init__(name,
|
30
|
-
mode)
|
31
|
-
|
32
|
-
|
33
|
-
def _add_specs(self) -> None:
|
34
|
-
self.add_spec( SpecNames.SAMPLE_RATE_LOWER_BOUND, 200e3 ) # Hz
|
35
|
-
self.add_spec( SpecNames.SAMPLE_RATE_UPPER_BOUND, 10e6 ) # Hz
|
36
|
-
self.add_spec( SpecNames.FREQUENCY_LOWER_BOUND , 1e3 ) # Hz
|
37
|
-
self.add_spec( SpecNames.FREQUENCY_UPPER_BOUND , 2e9 ) # Hz
|
38
|
-
self.add_spec( SpecNames.IF_GAIN_UPPER_BOUND , -20 ) # dB
|
39
|
-
self.add_spec( SpecNames.RF_GAIN_UPPER_BOUND , 0 ) # dB
|
40
|
-
self.add_spec( SpecNames.API_RETUNING_LATENCY , 50 * 1e-3 ) # s
|
41
|
-
self.add_spec( SpecNames.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(Modes.TUNER_1_FIXED_CENTER_FREQUENCY,
|
47
|
-
CaptureMethods.tuner_1_fixed_center_frequency)
|
48
|
-
self.add_capture_method(Modes.TUNER_2_FIXED_CENTER_FREQUENCY,
|
49
|
-
CaptureMethods.tuner_2_fixed_center_frequency)
|
50
|
-
self.add_capture_method(Modes.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
51
|
-
CaptureMethods.tuner_1_swept_center_frequency)
|
52
|
-
|
53
|
-
|
54
|
-
def _add_capture_templates(self):
|
55
|
-
self.add_capture_template(Modes.TUNER_1_FIXED_CENTER_FREQUENCY,
|
56
|
-
self._get_capture_template_fixed_center_frequency())
|
57
|
-
self.add_capture_template(Modes.TUNER_2_FIXED_CENTER_FREQUENCY,
|
58
|
-
self._get_capture_template_fixed_center_frequency())
|
59
|
-
self.add_capture_template(Modes.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
60
|
-
self._get_capture_template_swept_center_frequency())
|
61
|
-
|
62
|
-
|
63
|
-
def _add_pvalidators(self):
|
64
|
-
self.add_pvalidator(Modes.TUNER_1_FIXED_CENTER_FREQUENCY,
|
65
|
-
self._get_pvalidator_fixed_center_frequency())
|
66
|
-
self.add_pvalidator(Modes.TUNER_2_FIXED_CENTER_FREQUENCY,
|
67
|
-
self._get_pvalidator_fixed_center_frequency())
|
68
|
-
self.add_pvalidator(Modes.TUNER_1_SWEPT_CENTER_FREQUENCY,
|
69
|
-
self._get_pvalidator_swept_center_frequency())
|
@@ -1,185 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
-
# This file is part of SPECTRE
|
3
|
-
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
-
|
5
|
-
from abc import ABC, abstractmethod
|
6
|
-
from typing import Callable, Optional
|
7
|
-
from numbers import Number
|
8
|
-
|
9
|
-
from spectre_core.capture_configs import (
|
10
|
-
CaptureTemplate, CaptureModes, Parameters, Bound, PValidators, PNames,
|
11
|
-
get_base_capture_template, get_base_ptemplate, OneOf, CaptureConfig
|
12
|
-
)
|
13
|
-
from .._base import BaseReceiver
|
14
|
-
from .._spec_names import SpecNames
|
15
|
-
|
16
|
-
class SDRPlayReceiver(BaseReceiver):
|
17
|
-
def _get_pvalidator_fixed_center_frequency(self) -> Callable:
|
18
|
-
def pvalidator(parameters: Parameters):
|
19
|
-
PValidators.fixed_center_frequency(parameters)
|
20
|
-
return pvalidator
|
21
|
-
|
22
|
-
|
23
|
-
def _get_pvalidator_swept_center_frequency(self) -> None:
|
24
|
-
def pvalidator(parameters: Parameters):
|
25
|
-
PValidators.swept_center_frequency(parameters,
|
26
|
-
self.get_spec(SpecNames.API_RETUNING_LATENCY))
|
27
|
-
return pvalidator
|
28
|
-
|
29
|
-
|
30
|
-
def _get_capture_template_fixed_center_frequency(self) -> CaptureTemplate:
|
31
|
-
#
|
32
|
-
# Create the base template
|
33
|
-
#
|
34
|
-
capture_template = get_base_capture_template( CaptureModes.FIXED_CENTER_FREQUENCY )
|
35
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.BANDWIDTH) )
|
36
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.IF_GAIN) )
|
37
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.RF_GAIN) )
|
38
|
-
|
39
|
-
#
|
40
|
-
# Update the defaults
|
41
|
-
#
|
42
|
-
capture_template.set_defaults(
|
43
|
-
(PNames.BATCH_SIZE, 3.0),
|
44
|
-
(PNames.CENTER_FREQUENCY, 95800000),
|
45
|
-
(PNames.SAMPLE_RATE, 600000),
|
46
|
-
(PNames.BANDWIDTH, 600000),
|
47
|
-
(PNames.WINDOW_HOP, 512),
|
48
|
-
(PNames.WINDOW_SIZE, 1024),
|
49
|
-
(PNames.WINDOW_TYPE, "blackman"),
|
50
|
-
(PNames.RF_GAIN, -30),
|
51
|
-
(PNames.IF_GAIN, -30)
|
52
|
-
)
|
53
|
-
|
54
|
-
#
|
55
|
-
# Adding pconstraints
|
56
|
-
#
|
57
|
-
capture_template.add_pconstraint(
|
58
|
-
PNames.CENTER_FREQUENCY,
|
59
|
-
[
|
60
|
-
Bound(
|
61
|
-
lower_bound=self.get_spec(SpecNames.FREQUENCY_LOWER_BOUND),
|
62
|
-
upper_bound=self.get_spec(SpecNames.FREQUENCY_UPPER_BOUND)
|
63
|
-
)
|
64
|
-
]
|
65
|
-
)
|
66
|
-
capture_template.add_pconstraint(
|
67
|
-
PNames.SAMPLE_RATE,
|
68
|
-
[
|
69
|
-
Bound(
|
70
|
-
lower_bound=self.get_spec(SpecNames.SAMPLE_RATE_LOWER_BOUND),
|
71
|
-
upper_bound=self.get_spec(SpecNames.SAMPLE_RATE_UPPER_BOUND)
|
72
|
-
)
|
73
|
-
]
|
74
|
-
)
|
75
|
-
capture_template.add_pconstraint(
|
76
|
-
PNames.BANDWIDTH,
|
77
|
-
[
|
78
|
-
OneOf(
|
79
|
-
self.get_spec( SpecNames.BANDWIDTH_OPTIONS )
|
80
|
-
)
|
81
|
-
]
|
82
|
-
)
|
83
|
-
capture_template.add_pconstraint(
|
84
|
-
PNames.IF_GAIN,
|
85
|
-
[
|
86
|
-
Bound(
|
87
|
-
upper_bound=self.get_spec(SpecNames.IF_GAIN_UPPER_BOUND)
|
88
|
-
)
|
89
|
-
]
|
90
|
-
)
|
91
|
-
capture_template.add_pconstraint(
|
92
|
-
PNames.RF_GAIN,
|
93
|
-
[
|
94
|
-
Bound(
|
95
|
-
upper_bound=self.get_spec(SpecNames.RF_GAIN_UPPER_BOUND)
|
96
|
-
)
|
97
|
-
]
|
98
|
-
)
|
99
|
-
return capture_template
|
100
|
-
|
101
|
-
|
102
|
-
def _get_capture_template_swept_center_frequency(self) -> CaptureTemplate:
|
103
|
-
#
|
104
|
-
# Create the base template
|
105
|
-
#
|
106
|
-
capture_template = get_base_capture_template( CaptureModes.SWEPT_CENTER_FREQUENCY )
|
107
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.BANDWIDTH) )
|
108
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.IF_GAIN) )
|
109
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.RF_GAIN) )
|
110
|
-
|
111
|
-
|
112
|
-
#
|
113
|
-
# Update the defaults
|
114
|
-
#
|
115
|
-
capture_template.set_defaults(
|
116
|
-
(PNames.BATCH_SIZE, 4.0),
|
117
|
-
(PNames.MIN_FREQUENCY, 95000000),
|
118
|
-
(PNames.MAX_FREQUENCY, 100000000),
|
119
|
-
(PNames.SAMPLES_PER_STEP, 80000),
|
120
|
-
(PNames.FREQUENCY_STEP, 1536000),
|
121
|
-
(PNames.SAMPLE_RATE, 1536000),
|
122
|
-
(PNames.BANDWIDTH, 1536000),
|
123
|
-
(PNames.WINDOW_HOP, 512),
|
124
|
-
(PNames.WINDOW_SIZE, 1024),
|
125
|
-
(PNames.WINDOW_TYPE, "blackman"),
|
126
|
-
(PNames.RF_GAIN, -30),
|
127
|
-
(PNames.IF_GAIN, -30)
|
128
|
-
)
|
129
|
-
|
130
|
-
|
131
|
-
#
|
132
|
-
# Adding pconstraints
|
133
|
-
#
|
134
|
-
capture_template.add_pconstraint(
|
135
|
-
PNames.MIN_FREQUENCY,
|
136
|
-
[
|
137
|
-
Bound(
|
138
|
-
lower_bound=self.get_spec(SpecNames.FREQUENCY_LOWER_BOUND),
|
139
|
-
upper_bound=self.get_spec(SpecNames.FREQUENCY_UPPER_BOUND)
|
140
|
-
)
|
141
|
-
]
|
142
|
-
)
|
143
|
-
capture_template.add_pconstraint(
|
144
|
-
PNames.MAX_FREQUENCY,
|
145
|
-
[
|
146
|
-
Bound(
|
147
|
-
lower_bound=self.get_spec(SpecNames.FREQUENCY_LOWER_BOUND),
|
148
|
-
upper_bound=self.get_spec(SpecNames.FREQUENCY_UPPER_BOUND)
|
149
|
-
)
|
150
|
-
]
|
151
|
-
)
|
152
|
-
capture_template.add_pconstraint(
|
153
|
-
PNames.SAMPLE_RATE,
|
154
|
-
[
|
155
|
-
Bound(
|
156
|
-
lower_bound=self.get_spec(SpecNames.SAMPLE_RATE_LOWER_BOUND),
|
157
|
-
upper_bound=self.get_spec(SpecNames.SAMPLE_RATE_UPPER_BOUND)
|
158
|
-
)
|
159
|
-
]
|
160
|
-
)
|
161
|
-
capture_template.add_pconstraint(
|
162
|
-
PNames.BANDWIDTH,
|
163
|
-
[
|
164
|
-
OneOf(
|
165
|
-
self.get_spec( SpecNames.BANDWIDTH_OPTIONS )
|
166
|
-
)
|
167
|
-
]
|
168
|
-
)
|
169
|
-
capture_template.add_pconstraint(
|
170
|
-
PNames.IF_GAIN,
|
171
|
-
[
|
172
|
-
Bound(
|
173
|
-
upper_bound=self.get_spec(SpecNames.IF_GAIN_UPPER_BOUND)
|
174
|
-
)
|
175
|
-
]
|
176
|
-
)
|
177
|
-
capture_template.add_pconstraint(
|
178
|
-
PNames.RF_GAIN,
|
179
|
-
[
|
180
|
-
Bound(
|
181
|
-
upper_bound=self.get_spec(SpecNames.RF_GAIN_UPPER_BOUND)
|
182
|
-
)
|
183
|
-
]
|
184
|
-
)
|
185
|
-
return capture_template
|
@@ -1,221 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
|
-
# This file is part of SPECTRE
|
3
|
-
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
|
-
|
5
|
-
from dataclasses import dataclass
|
6
|
-
from typing import Optional, Callable
|
7
|
-
|
8
|
-
from spectre_core.capture_configs import (
|
9
|
-
CaptureTemplate, CaptureModes, Parameters, Bound, PValidators, PNames,
|
10
|
-
get_base_capture_template, make_base_capture_template, get_base_ptemplate
|
11
|
-
)
|
12
|
-
from ..gr._test import CaptureMethods
|
13
|
-
from .._spec_names import SpecNames
|
14
|
-
from .._base import BaseReceiver
|
15
|
-
from .._register import register_receiver
|
16
|
-
|
17
|
-
|
18
|
-
@dataclass
|
19
|
-
class Modes:
|
20
|
-
COSINE_SIGNAL_1 = "cosine-signal-1"
|
21
|
-
TAGGED_STAIRCASE = "tagged-staircase"
|
22
|
-
|
23
|
-
|
24
|
-
@register_receiver("test")
|
25
|
-
class _Receiver(BaseReceiver):
|
26
|
-
def __init__(self,
|
27
|
-
name: str,
|
28
|
-
mode: Optional[str]):
|
29
|
-
super().__init__(name,
|
30
|
-
mode)
|
31
|
-
|
32
|
-
|
33
|
-
def _add_specs(self) -> None:
|
34
|
-
self.add_spec( SpecNames.SAMPLE_RATE_LOWER_BOUND, 64000 )
|
35
|
-
self.add_spec( SpecNames.SAMPLE_RATE_UPPER_BOUND, 640000 )
|
36
|
-
self.add_spec( SpecNames.FREQUENCY_LOWER_BOUND , 16000 )
|
37
|
-
self.add_spec( SpecNames.FREQUENCY_UPPER_BOUND , 160000 )
|
38
|
-
|
39
|
-
|
40
|
-
def _add_capture_methods(self) -> None:
|
41
|
-
self.add_capture_method( Modes.COSINE_SIGNAL_1 , CaptureMethods.cosine_signal_1 )
|
42
|
-
self.add_capture_method( Modes.TAGGED_STAIRCASE, CaptureMethods.tagged_staircase)
|
43
|
-
|
44
|
-
|
45
|
-
def _add_pvalidators(self) -> None:
|
46
|
-
self.add_pvalidator( Modes.COSINE_SIGNAL_1 , self.__get_pvalidator_cosine_signal_1() )
|
47
|
-
self.add_pvalidator( Modes.TAGGED_STAIRCASE, self.__get_pvalidator_tagged_staircase() )
|
48
|
-
|
49
|
-
|
50
|
-
def _add_capture_templates(self) -> None:
|
51
|
-
self.add_capture_template( Modes.COSINE_SIGNAL_1 , self.__get_capture_template_cosine_signal_1() )
|
52
|
-
self.add_capture_template( Modes.TAGGED_STAIRCASE, self.__get_capture_template_tagged_staircase() )
|
53
|
-
|
54
|
-
|
55
|
-
def __get_capture_template_cosine_signal_1(self) -> CaptureTemplate:
|
56
|
-
#
|
57
|
-
# Create the base template
|
58
|
-
#
|
59
|
-
capture_template = get_base_capture_template( CaptureModes.FIXED_CENTER_FREQUENCY )
|
60
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.AMPLITUDE) )
|
61
|
-
capture_template.add_ptemplate( get_base_ptemplate(PNames.FREQUENCY) )
|
62
|
-
|
63
|
-
#
|
64
|
-
# Update the defaults
|
65
|
-
#
|
66
|
-
capture_template.set_defaults(
|
67
|
-
(PNames.BATCH_SIZE, 3.0),
|
68
|
-
(PNames.CENTER_FREQUENCY, 16000),
|
69
|
-
(PNames.AMPLITUDE, 2.0),
|
70
|
-
(PNames.FREQUENCY, 32000),
|
71
|
-
(PNames.SAMPLE_RATE, 128000),
|
72
|
-
(PNames.WINDOW_HOP, 512),
|
73
|
-
(PNames.WINDOW_SIZE, 512),
|
74
|
-
(PNames.WINDOW_TYPE, "boxcar")
|
75
|
-
)
|
76
|
-
|
77
|
-
#
|
78
|
-
# Enforce defaults
|
79
|
-
#
|
80
|
-
capture_template.enforce_defaults(
|
81
|
-
PNames.TIME_RESOLUTION,
|
82
|
-
PNames.TIME_RANGE,
|
83
|
-
PNames.FREQUENCY_RESOLUTION,
|
84
|
-
PNames.WINDOW_TYPE
|
85
|
-
)
|
86
|
-
|
87
|
-
|
88
|
-
#
|
89
|
-
# Adding pconstraints
|
90
|
-
#
|
91
|
-
capture_template.add_pconstraint(
|
92
|
-
PNames.SAMPLE_RATE,
|
93
|
-
[
|
94
|
-
Bound(
|
95
|
-
lower_bound=self.get_spec(SpecNames.SAMPLE_RATE_LOWER_BOUND),
|
96
|
-
upper_bound=self.get_spec(SpecNames.SAMPLE_RATE_UPPER_BOUND)
|
97
|
-
)
|
98
|
-
]
|
99
|
-
)
|
100
|
-
capture_template.add_pconstraint(
|
101
|
-
PNames.FREQUENCY,
|
102
|
-
[
|
103
|
-
Bound(
|
104
|
-
lower_bound=self.get_spec(SpecNames.FREQUENCY_LOWER_BOUND),
|
105
|
-
upper_bound=self.get_spec(SpecNames.FREQUENCY_UPPER_BOUND)
|
106
|
-
)
|
107
|
-
]
|
108
|
-
)
|
109
|
-
return capture_template
|
110
|
-
|
111
|
-
|
112
|
-
def __get_capture_template_tagged_staircase(self) -> CaptureTemplate:
|
113
|
-
#
|
114
|
-
# Make the base template
|
115
|
-
#
|
116
|
-
capture_template = make_base_capture_template(
|
117
|
-
PNames.TIME_RESOLUTION,
|
118
|
-
PNames.FREQUENCY_RESOLUTION,
|
119
|
-
PNames.TIME_RANGE,
|
120
|
-
PNames.SAMPLE_RATE,
|
121
|
-
PNames.BATCH_SIZE,
|
122
|
-
PNames.WINDOW_TYPE,
|
123
|
-
PNames.WINDOW_HOP,
|
124
|
-
PNames.WINDOW_SIZE,
|
125
|
-
PNames.EVENT_HANDLER_KEY,
|
126
|
-
PNames.BATCH_KEY,
|
127
|
-
PNames.WATCH_EXTENSION,
|
128
|
-
PNames.MIN_SAMPLES_PER_STEP,
|
129
|
-
PNames.MAX_SAMPLES_PER_STEP,
|
130
|
-
PNames.FREQUENCY_STEP,
|
131
|
-
PNames.STEP_INCREMENT,
|
132
|
-
PNames.OBS_ALT,
|
133
|
-
PNames.OBS_LAT,
|
134
|
-
PNames.OBS_LON,
|
135
|
-
PNames.OBJECT,
|
136
|
-
PNames.ORIGIN,
|
137
|
-
PNames.TELESCOPE,
|
138
|
-
PNames.INSTRUMENT
|
139
|
-
)
|
140
|
-
|
141
|
-
#
|
142
|
-
# Update the defaults
|
143
|
-
#
|
144
|
-
capture_template.set_defaults(
|
145
|
-
(PNames.BATCH_SIZE, 3.0),
|
146
|
-
(PNames.FREQUENCY_STEP, 128000),
|
147
|
-
(PNames.MAX_SAMPLES_PER_STEP, 5000),
|
148
|
-
(PNames.MIN_SAMPLES_PER_STEP, 4000),
|
149
|
-
(PNames.SAMPLE_RATE, 128000),
|
150
|
-
(PNames.STEP_INCREMENT, 200),
|
151
|
-
(PNames.WINDOW_HOP, 512),
|
152
|
-
(PNames.WINDOW_SIZE, 512),
|
153
|
-
(PNames.WINDOW_TYPE, "boxcar"),
|
154
|
-
(PNames.EVENT_HANDLER_KEY, CaptureModes.SWEPT_CENTER_FREQUENCY),
|
155
|
-
(PNames.BATCH_KEY, CaptureModes.SWEPT_CENTER_FREQUENCY),
|
156
|
-
(PNames.WATCH_EXTENSION, "bin")
|
157
|
-
)
|
158
|
-
|
159
|
-
|
160
|
-
#
|
161
|
-
# Enforce defaults
|
162
|
-
#
|
163
|
-
capture_template.enforce_defaults(
|
164
|
-
PNames.TIME_RESOLUTION,
|
165
|
-
PNames.TIME_RANGE,
|
166
|
-
PNames.FREQUENCY_RESOLUTION,
|
167
|
-
PNames.WINDOW_TYPE,
|
168
|
-
PNames.EVENT_HANDLER_KEY,
|
169
|
-
PNames.BATCH_KEY,
|
170
|
-
PNames.WATCH_EXTENSION
|
171
|
-
)
|
172
|
-
|
173
|
-
return capture_template
|
174
|
-
|
175
|
-
|
176
|
-
def __get_pvalidator_cosine_signal_1(self) -> Callable:
|
177
|
-
def pvalidator(parameters: Parameters):
|
178
|
-
PValidators.window(parameters)
|
179
|
-
|
180
|
-
sample_rate = parameters.get_parameter_value(PNames.SAMPLE_RATE)
|
181
|
-
frequency = parameters.get_parameter_value(PNames.FREQUENCY)
|
182
|
-
window_size = parameters.get_parameter_value(PNames.WINDOW_SIZE)
|
183
|
-
|
184
|
-
# check that the sample rate is an integer multiple of the underlying signal frequency
|
185
|
-
if sample_rate % frequency != 0:
|
186
|
-
raise ValueError("The sampling rate must be some integer multiple of frequency")
|
187
|
-
|
188
|
-
a = sample_rate/frequency
|
189
|
-
if a < 2:
|
190
|
-
raise ValueError((f"The ratio of sampling rate over frequency must be greater than two. "
|
191
|
-
f"Got {a}"))
|
192
|
-
|
193
|
-
# analytical requirement
|
194
|
-
# if p is the number of sampled cycles, we can find that p = window_size / a
|
195
|
-
# the number of sampled cycles must be a positive natural number.
|
196
|
-
p = window_size / a
|
197
|
-
if window_size % a != 0:
|
198
|
-
raise ValueError((f"The number of sampled cycles must be a positive natural number. "
|
199
|
-
f"Computed that p={p}"))
|
200
|
-
return pvalidator
|
201
|
-
|
202
|
-
|
203
|
-
def __get_pvalidator_tagged_staircase(self) -> None:
|
204
|
-
def pvalidator(parameters: Parameters):
|
205
|
-
PValidators.window(parameters)
|
206
|
-
|
207
|
-
freq_step = parameters.get_parameter_value(PNames.FREQUENCY_STEP)
|
208
|
-
sample_rate = parameters.get_parameter_value(PNames.SAMPLE_RATE)
|
209
|
-
min_samples_per_step = parameters.get_parameter_value(PNames.MIN_SAMPLES_PER_STEP)
|
210
|
-
max_samples_per_step = parameters.get_parameter_value(PNames.MAX_SAMPLES_PER_STEP)
|
211
|
-
|
212
|
-
if freq_step != sample_rate:
|
213
|
-
raise ValueError(f"The frequency step must be equal to the sampling rate")
|
214
|
-
|
215
|
-
|
216
|
-
if min_samples_per_step > max_samples_per_step:
|
217
|
-
raise ValueError((f"Minimum samples per step cannot be greater than the maximum samples per step. "
|
218
|
-
f"Got {min_samples_per_step}, which is greater than {max_samples_per_step}"))
|
219
|
-
|
220
|
-
return pvalidator
|
221
|
-
|
@@ -1,64 +0,0 @@
|
|
1
|
-
spectre_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
spectre_core/exceptions.py,sha256=XYRvBwhL7UQ_VOk6eaC7xRYWxcB-BdMXY5ar9dev00c,566
|
3
|
-
spectre_core/_file_io/__init__.py,sha256=YlkTZsmzuvxYW4kbmzaOv4WcqhbyoV00D-V4mJyNfBQ,334
|
4
|
-
spectre_core/_file_io/file_handlers.py,sha256=gPI9YVhqyJH22m2Rma6yOrY6-eqqMEttAbwWVtRDP9U,3404
|
5
|
-
spectre_core/batches/__init__.py,sha256=2F187_EZ7rG36_mcVRzcZB74DRS_6lS_VMlZoT0WTKo,633
|
6
|
-
spectre_core/batches/_base.py,sha256=YZ9l7wRJzEQPnckq9SYQ-a4KK0TO7VIFzk_F0P1bdjw,4893
|
7
|
-
spectre_core/batches/_batches.py,sha256=6HT1CZ5TS8xxIiZyMUFcpa5I6Q_PbyDzETg5vz-eaMQ,7034
|
8
|
-
spectre_core/batches/_factory.py,sha256=oiUaqJ0wkUDG1l3HxAz0GayKuAPY71BSG1t2Nm_KEC0,1056
|
9
|
-
spectre_core/batches/_register.py,sha256=_T_e9QPgVkY0PtybwwWjYHkL1ovcB1w8MMKyZiv4q_0,435
|
10
|
-
spectre_core/batches/library/_callisto.py,sha256=nOLHjC-8xPUXst3ZwxqI6TlqB-w-EmKIrg1gb2KZgB8,3731
|
11
|
-
spectre_core/batches/library/_fixed_center_frequency.py,sha256=tMILhZPBBj_erF_XOBSXwf8g8_SmIcBD5sx1aNv7fvc,4770
|
12
|
-
spectre_core/batches/library/_swept_center_frequency.py,sha256=s_6OO7y_UC5_UVAxwgCrMQxs3c3rijBU-qqxkACXuZ4,4724
|
13
|
-
spectre_core/capture_configs/__init__.py,sha256=-OFfB1UMuKnfjq6UDYdEA8ihu5uObzv8FqxVMRUYpCU,973
|
14
|
-
spectre_core/capture_configs/_capture_config.py,sha256=An0B4sQ3OQPTIZrDwOY6mqLTQTQX8NvyYpS3tuHwv8w,2630
|
15
|
-
spectre_core/capture_configs/_capture_templates.py,sha256=3LtPR0hupHAbUJ4an-BCHWMKyAKkkl0YxdByOSeSzZo,7736
|
16
|
-
spectre_core/capture_configs/_parameters.py,sha256=HcbMklmBHW0SVP6joiPLVpE8wTl4EZlf6sBHoVCaML8,3498
|
17
|
-
spectre_core/capture_configs/_pconstraints.py,sha256=262ocQn11v3sJIiaQ-5Ihr4ZoLGTH2_pyFSA2dJb_pc,3241
|
18
|
-
spectre_core/capture_configs/_ptemplates.py,sha256=eDB2FGKpRUUVcxwZ85wha8wLoNjldqYjwiw571ALl1o,23578
|
19
|
-
spectre_core/capture_configs/_pvalidators.py,sha256=Or-eivBb505Ry0WqEqvjpKZgNZQ8r4pGGXqp7HMZwiA,7188
|
20
|
-
spectre_core/config/__init__.py,sha256=wvp2MoslBupWB0kfKEnuB6PAlqx_nGGZBRQgKnqOraU,532
|
21
|
-
spectre_core/config/_paths.py,sha256=n6ZUtQuRiDBb1Nw4LSNROlOlLTCheGaPzC40MChvXYI,2373
|
22
|
-
spectre_core/config/_time_formats.py,sha256=Z1kiVBViEY2hkFw1vf0jl0vQ7y-5EUKJIzqQsbeIboQ,474
|
23
|
-
spectre_core/logging/__init__.py,sha256=bdfcLby8VMDXI1aGg5VqJK7NPx20HIyMg5DUIVEYw80,370
|
24
|
-
spectre_core/logging/_configure.py,sha256=HCPgggYNsevGq2Tv5-tX7ufdezH-L3Sc0yxrnTpdpJ8,1252
|
25
|
-
spectre_core/logging/_decorators.py,sha256=89vJ_JZhfL7Azg2iFxMbj22c3Ajetgv6TOBkArTzx4A,639
|
26
|
-
spectre_core/logging/_log_handlers.py,sha256=0vmkH2ekUTiJMafTncGyaF3T3XXf7DLKcJDIsUYEkvY,4884
|
27
|
-
spectre_core/plotting/__init__.py,sha256=eYovaSQfdadspCTItTDyAhznLegXWifpki7c3RRjh3I,310
|
28
|
-
spectre_core/plotting/_base.py,sha256=cXHKk15NwWt0lJADwndxWM5mXUTMj23qzVIlEvpwA1E,5339
|
29
|
-
spectre_core/plotting/_format.py,sha256=3nB3xiiCjjerxkfMdhcOoeknLb2FimoN5sPPkrp1LQw,532
|
30
|
-
spectre_core/plotting/_panel_stack.py,sha256=T1aASyTJEeJcSzy3vkxLcrFg5SpyVnPjV_0mS5t1W8A,5023
|
31
|
-
spectre_core/plotting/_panels.py,sha256=isoh4AirGWT8wUFXiJ91NbqjzaVAK5iMI0ZUXoBlgWA,8658
|
32
|
-
spectre_core/post_processing/__init__.py,sha256=SjRDqFd5rON2SdV7IpwV7yBufJx38n1NPlyJDPHtVcE,494
|
33
|
-
spectre_core/post_processing/_base.py,sha256=--iWX86l2T6DmsQD4-UPfUIv494Y4QGDftzsuwdnudY,4932
|
34
|
-
spectre_core/post_processing/_factory.py,sha256=Bn9wZgyBIGIWyeV7RTS6zAHuDDtrc43InxjJrBi1urA,1131
|
35
|
-
spectre_core/post_processing/_post_processor.py,sha256=THIOtcm98GPTt-QSZ6kbgQDLFpeoaiNRuQpRLPjGTOA,1425
|
36
|
-
spectre_core/post_processing/_register.py,sha256=DwlkU92IFkZ1_qvGfhep_OfuqTOIR_efY5qFpn1perw,498
|
37
|
-
spectre_core/post_processing/library/_fixed_center_frequency.py,sha256=7HtkiwHbwGkYRYEsl0s4SVxi85-9rbmR3hdq1omESm8,4417
|
38
|
-
spectre_core/post_processing/library/_swept_center_frequency.py,sha256=kE1NqdwL0ynFPOBOJH9m4fjzGDt7Xm7B6EYvbptJwCo,18632
|
39
|
-
spectre_core/receivers/__init__.py,sha256=ZYoKKkv6ml8mOAYameUmuh2b6UESmnGeVMe8fR2wZHs,553
|
40
|
-
spectre_core/receivers/_base.py,sha256=hBNs0om8g7uaTNEOuSZE4OVCII8q37rwrmOBNHOKeCw,5011
|
41
|
-
spectre_core/receivers/_factory.py,sha256=3P1bxNnt4OxQS0tRNUEZ0Wc1iGc0hgjE9_qS8fGJPRM,822
|
42
|
-
spectre_core/receivers/_register.py,sha256=xHcRnT-3NQxyIWL3nyT3P9qT14Wl5liM9HbflOvOUAM,617
|
43
|
-
spectre_core/receivers/_spec_names.py,sha256=RlQzzD10V0-_ZyqaMUmG9LCoSLGAzyxmQ_eS7e6qvqY,936
|
44
|
-
spectre_core/receivers/gr/__init__.py,sha256=oFSWmGoXQLK5X5xHvWzTdNr9amuaiiGjZirXZVogACU,154
|
45
|
-
spectre_core/receivers/gr/_base.py,sha256=IcmiWOuUeSR2s4SoIbubHJGBTEQflawvMj2ivRT-pNY,883
|
46
|
-
spectre_core/receivers/gr/_rsp1a.py,sha256=axPq2WXsxXAttQ2iaK8b3EfuOs_PDBmdaytnbUrq7oY,7226
|
47
|
-
spectre_core/receivers/gr/_rspduo.py,sha256=bA3jBfZMxfmZE7oWaAKHI7O3jgvipN4kXW7yxfO0fXg,10856
|
48
|
-
spectre_core/receivers/gr/_test.py,sha256=RSbmgiAFkIjRSwxCBwYpRNFIw6lhF5iyWEul__g6qJo,5897
|
49
|
-
spectre_core/receivers/library/_rsp1a.py,sha256=a1BY27MzFgrSMH3zf2BbQxwYMRfcl1WZmX6FURe7-04,2533
|
50
|
-
spectre_core/receivers/library/_rspduo.py,sha256=T5NIOsyEO1eiS7V44L-GtZSLWp6B6me_7jtusyCX2YQ,3180
|
51
|
-
spectre_core/receivers/library/_sdrplay_receiver.py,sha256=br8uX_m-vpZB1Z-TZtSTHREoNm3YMhiL_Kx5BqU0LUM,6334
|
52
|
-
spectre_core/receivers/library/_test.py,sha256=hiF904yd6_A1xB9Hj9cARCXHWLrZYX6O9AIhl5ezTIk,8278
|
53
|
-
spectre_core/spectrograms/__init__.py,sha256=3_BmRi41isVW8oEM_-Ce61eg9kaF_WUZFNciITTDlhY,721
|
54
|
-
spectre_core/spectrograms/_analytical.py,sha256=MyJ1t4QRpbaF0RRvA8thc5SQHTRSKowOEe36uwmzasU,8958
|
55
|
-
spectre_core/spectrograms/_array_operations.py,sha256=H0TC2G_cos-LQ6_kqjJ9iIw7Kb9zXq9FQ46g2doISDs,4945
|
56
|
-
spectre_core/spectrograms/_spectrogram.py,sha256=gzda7NqlaIU1grocXY3dplQcJZoK15EHxKMFFFMufGo,21946
|
57
|
-
spectre_core/spectrograms/_transform.py,sha256=xTpuZ8-tXVfc_icQcpPfOLtt3wtuePiS4t97fWjZ4Oc,11373
|
58
|
-
spectre_core/wgetting/__init__.py,sha256=dP7qu__escq8w47x0fRCa4gd481f1Bv4drGTo8b7AEQ,301
|
59
|
-
spectre_core/wgetting/_callisto.py,sha256=8a0KGFr8BJVa0RhGd9w_NMzL2PulMbtBsBQKcCR4E9Q,4571
|
60
|
-
spectre_core-0.0.12.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
61
|
-
spectre_core-0.0.12.dist-info/METADATA,sha256=S7zzpU5aAoYjbE_G-RUf1pPLWZCf8GY_uW1ImnK3GxA,42151
|
62
|
-
spectre_core-0.0.12.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
63
|
-
spectre_core-0.0.12.dist-info/top_level.txt,sha256=-UsyjpFohXgZpgcZ9QbVeXhsIyF3Am8RxNFNDV_Ta2Y,13
|
64
|
-
spectre_core-0.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|