spectre-core 0.0.20__tar.gz → 0.0.22__tar.gz
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-0.0.20 → spectre_core-0.0.22}/PKG-INFO +1 -2
- {spectre_core-0.0.20 → spectre_core-0.0.22}/pyproject.toml +1 -2
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/_file_io/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/_file_io/file_handlers.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/__init__.py +3 -3
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/_base.py +25 -3
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/_batches.py +4 -6
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/_factory.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/_register.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/plugins/_batch_keys.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/plugins/_callisto.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/batches/plugins/_iq_stream.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_capture_config.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_capture_modes.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_capture_templates.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_parameters.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_pconstraints.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_pnames.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_ptemplates.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/capture_configs/_pvalidators.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/config/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/config/_paths.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/config/_time_formats.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/exceptions.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/jobs/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/jobs/_jobs.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/jobs/_workers.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/logs/__init__.py +4 -4
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/logs/_configure.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/logs/_decorators.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/logs/_logs.py +17 -6
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/logs/_process_types.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/_base.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/_format.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/_panel_names.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/_panel_stack.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/plotting/_panels.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/_base.py +34 -20
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/_factory.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/_post_processor.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/_register.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/plugins/_event_handler_keys.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/plugins/_fixed_center_frequency.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/post_processing/plugins/_swept_center_frequency.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/_base.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/_factory.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/_register.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/_spec_names.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_b200mini.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_receiver_names.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_rsp1a.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_rspduo.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_sdrplay_receiver.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_test.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/_usrp.py +1 -1
- spectre_core-0.0.22/src/spectre_core/receivers/plugins/gr/__init__.py +3 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_base.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_rsp1a.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_rspduo.py +2 -2
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_test.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_usrp.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/spectrograms/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/spectrograms/_analytical.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/spectrograms/_array_operations.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/spectrograms/_spectrogram.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/spectrograms/_transform.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/wgetting/__init__.py +1 -1
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/wgetting/_callisto.py +6 -5
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core.egg-info/PKG-INFO +1 -2
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core.egg-info/requires.txt +0 -1
- spectre_core-0.0.20/src/spectre_core/receivers/plugins/gr/__init__.py +0 -3
- {spectre_core-0.0.20 → spectre_core-0.0.22}/LICENSE +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/README.md +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/setup.cfg +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/__init__.py +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/py.typed +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/__init__.py +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core.egg-info/SOURCES.txt +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core.egg-info/dependency_links.txt +0 -0
- {spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: spectre-core
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.22
|
4
4
|
Summary: The core Python package used by the spectre program.
|
5
5
|
Maintainer-email: Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -691,7 +691,6 @@ Requires-Dist: scipy==1.12.0
|
|
691
691
|
Requires-Dist: astropy==6.0.1
|
692
692
|
Requires-Dist: matplotlib==3.5.0
|
693
693
|
Requires-Dist: watchdog==4.0.0
|
694
|
-
Requires-Dist: mypy==1.14.1
|
695
694
|
Dynamic: license-file
|
696
695
|
|
697
696
|
# spectre-core
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "spectre-core"
|
7
|
-
version = "0.0.
|
7
|
+
version = "0.0.22"
|
8
8
|
maintainers = [
|
9
9
|
{ name="Jimmy Fitzpatrick", email="jcfitzpatrick12@gmail.com" },
|
10
10
|
]
|
@@ -22,7 +22,6 @@ dependencies = [
|
|
22
22
|
'astropy==6.0.1',
|
23
23
|
'matplotlib==3.5.0',
|
24
24
|
'watchdog==4.0.0',
|
25
|
-
'mypy==1.14.1',
|
26
25
|
]
|
27
26
|
license = { file = "LICENSE" }
|
28
27
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -10,12 +10,12 @@ from .plugins._batch_keys import BatchKey
|
|
10
10
|
from .plugins._iq_stream import IQStreamBatch, IQMetadata
|
11
11
|
from .plugins._callisto import CallistoBatch
|
12
12
|
|
13
|
-
from ._base import BaseBatch, BatchFile
|
13
|
+
from ._base import BaseBatch, BatchFile, parse_batch_base_file_name
|
14
14
|
from ._batches import Batches
|
15
15
|
from ._factory import get_batch_cls, get_batch_cls_from_tag
|
16
16
|
|
17
17
|
__all__ = [
|
18
18
|
"IQStreamBatch", "IQMetadata", "CallistoBatch", "BaseBatch", "BatchFile",
|
19
|
-
"Batches", "get_batch_cls", "BatchKey", "get_batch_cls_from_tag"
|
19
|
+
"Batches", "get_batch_cls", "BatchKey", "get_batch_cls_from_tag", "parse_batch_base_file_name"
|
20
20
|
]
|
21
21
|
|
@@ -1,21 +1,35 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
5
5
|
from datetime import datetime
|
6
|
-
from typing import TypeVar
|
6
|
+
from typing import TypeVar, Tuple
|
7
7
|
from base64 import b64encode
|
8
8
|
from functools import cached_property
|
9
9
|
from abc import ABC, abstractmethod
|
10
10
|
from dataclasses import dataclass
|
11
|
+
from os.path import splitext
|
11
12
|
|
12
13
|
from spectre_core._file_io import BaseFileHandler
|
13
14
|
from spectre_core.config import get_batches_dir_path, TimeFormat
|
14
15
|
from spectre_core.spectrograms import Spectrogram
|
15
16
|
|
16
17
|
|
18
|
+
def parse_batch_base_file_name(
|
19
|
+
base_file_name: str
|
20
|
+
) -> Tuple[str, str, str]:
|
21
|
+
"""Parse the base file name of a batch file into a start time, tag and extension.
|
22
|
+
"""
|
23
|
+
batch_name, extension = splitext(base_file_name)
|
24
|
+
# strip the dot from the extension
|
25
|
+
extension = extension.lstrip('.')
|
26
|
+
start_time, tag = batch_name.split("_", 1)
|
27
|
+
return start_time, tag, extension
|
28
|
+
|
29
|
+
|
17
30
|
T = TypeVar('T')
|
18
31
|
|
32
|
+
|
19
33
|
class BatchFile(BaseFileHandler[T]):
|
20
34
|
"""Abstract base class for files belonging to a batch, identified by their file extension.
|
21
35
|
|
@@ -283,4 +297,12 @@ class BaseBatch(ABC):
|
|
283
297
|
:return: The spectrogram stored by the batch `spectrogram_file`.
|
284
298
|
"""
|
285
299
|
return self.spectrogram_file.read()
|
286
|
-
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -13,7 +13,7 @@ from spectre_core.config import get_batches_dir_path
|
|
13
13
|
from spectre_core.exceptions import (
|
14
14
|
BatchNotFoundError
|
15
15
|
)
|
16
|
-
from ._base import BaseBatch
|
16
|
+
from ._base import BaseBatch, parse_batch_base_file_name
|
17
17
|
|
18
18
|
T = TypeVar('T', bound=BaseBatch)
|
19
19
|
class Batches(Generic[T]):
|
@@ -144,9 +144,7 @@ class Batches(Generic[T]):
|
|
144
144
|
# get a list of all batch file names in the batches directory path
|
145
145
|
batch_file_names = [f for (_, _, files) in os.walk(self.batches_dir_path) for f in files]
|
146
146
|
for batch_file_name in batch_file_names:
|
147
|
-
|
148
|
-
batch_name, _ = os.path.splitext(batch_file_name)
|
149
|
-
start_time, tag = batch_name.split("_", 1)
|
147
|
+
start_time, tag, _ = parse_batch_base_file_name(batch_file_name)
|
150
148
|
if tag == self._tag:
|
151
149
|
self._batch_map[start_time] = self.batch_cls(start_time, tag)
|
152
150
|
|
@@ -207,7 +205,7 @@ class Batches(Generic[T]):
|
|
207
205
|
return self._get_from_start_time(subscript)
|
208
206
|
elif isinstance(subscript, int):
|
209
207
|
return self._get_from_index(subscript)
|
210
|
-
|
208
|
+
|
211
209
|
|
212
210
|
def get_spectrogram(
|
213
211
|
self,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -8,10 +8,10 @@
|
|
8
8
|
from ._process_types import ProcessType
|
9
9
|
from ._decorators import log_call
|
10
10
|
from ._configure import configure_root_logger, get_root_logger_state
|
11
|
-
from ._logs import Log, Logs
|
11
|
+
from ._logs import Log, Logs, parse_log_base_file_name
|
12
12
|
|
13
13
|
|
14
14
|
__all__ = [
|
15
15
|
"log_call", "configure_root_logger", "Log", "Logs", "ProcessType",
|
16
|
-
"get_root_logger_state"
|
17
|
-
]
|
16
|
+
"get_root_logger_state", "parse_log_base_file_name"
|
17
|
+
]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -6,7 +6,7 @@ from logging import getLogger
|
|
6
6
|
_LOGGER = getLogger(__name__)
|
7
7
|
|
8
8
|
import os
|
9
|
-
from typing import Optional, Iterator
|
9
|
+
from typing import Optional, Iterator, Tuple
|
10
10
|
from collections import OrderedDict
|
11
11
|
from datetime import datetime
|
12
12
|
|
@@ -14,6 +14,17 @@ from spectre_core._file_io import TextHandler
|
|
14
14
|
from spectre_core.config import get_logs_dir_path, TimeFormat
|
15
15
|
from ._process_types import ProcessType
|
16
16
|
|
17
|
+
|
18
|
+
def parse_log_base_file_name(
|
19
|
+
base_file_name: str
|
20
|
+
) -> Tuple[str, str, str]:
|
21
|
+
"""Parse the base file name of a log into a start time, process ID and process type.
|
22
|
+
"""
|
23
|
+
file_name, _ = os.path.splitext(base_file_name)
|
24
|
+
log_start_time, pid, process_type = file_name.split("_")
|
25
|
+
return log_start_time, pid, process_type
|
26
|
+
|
27
|
+
|
17
28
|
class Log(TextHandler):
|
18
29
|
"""Interface to read log files generated by `spectre`."""
|
19
30
|
def __init__(
|
@@ -177,13 +188,13 @@ class Logs:
|
|
177
188
|
log_files = [f for (_, _, files) in os.walk(self.logs_dir_path) for f in files]
|
178
189
|
|
179
190
|
for log_file in log_files:
|
180
|
-
|
181
|
-
log_start_time, pid, process_type =
|
191
|
+
|
192
|
+
log_start_time, pid, process_type = parse_log_base_file_name(log_file)
|
182
193
|
|
183
194
|
if self.process_type and process_type != self.process_type:
|
184
195
|
continue
|
185
196
|
|
186
|
-
self._log_map[
|
197
|
+
self._log_map[log_file] = Log(log_start_time, pid, ProcessType(process_type))
|
187
198
|
|
188
199
|
self._log_map = OrderedDict(sorted(self._log_map.items()))
|
189
200
|
|
@@ -225,4 +236,4 @@ class Logs:
|
|
225
236
|
for log in self.log_list:
|
226
237
|
if log.pid == pid:
|
227
238
|
return log
|
228
|
-
raise FileNotFoundError(f"Log handler for PID '{pid}' not
|
239
|
+
raise FileNotFoundError(f"Log handler for PID '{pid}' could not be identified")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -84,29 +84,43 @@ class BaseEventHandler(ABC, FileSystemEventHandler):
|
|
84
84
|
|
85
85
|
:param event: The file system event containing the file details.
|
86
86
|
"""
|
87
|
-
#
|
87
|
+
# The `src_path`` attribute holds the absolute path of the freshly closed file
|
88
88
|
absolute_file_path = event.src_path
|
89
89
|
|
90
|
-
#
|
90
|
+
# Only process a file if:
|
91
|
+
#
|
92
|
+
# - It's extension matches the `watch_extension` as defined in the capture config.
|
93
|
+
# - It's tag matches the current sessions tag.
|
94
|
+
#
|
95
|
+
# This is important for two reasons.
|
96
|
+
#
|
97
|
+
# In the case of one session, the capture worker may write to two batch files simultaneously
|
98
|
+
# (e.g., raw data file + seperate metadata file). We want to process them together - but this method will get called
|
99
|
+
# seperately for both file creation events. So, we filter by extension to account for this.
|
100
|
+
#
|
101
|
+
# Additionally in the case of multiple sessions, the capture workers will create batch files in the same directory concurrently.
|
102
|
+
# This method is triggered for all file creation events, so we ensure the batch file tag matches the session tag and early return
|
103
|
+
# otherwise. This way, each post processor worker picks up the right files to process.
|
91
104
|
watch_extension = cast(str, self._capture_config.get_parameter_value(PName.WATCH_EXTENSION))
|
105
|
+
if not absolute_file_path.endswith(f"{self._tag}.{watch_extension}"):
|
106
|
+
return
|
92
107
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
self._queued_file = absolute_file_path
|
108
|
+
_LOGGER.info(f"Noticed {absolute_file_path}")
|
109
|
+
# If there exists a queued file, try and process it
|
110
|
+
if self._queued_file is not None:
|
111
|
+
try:
|
112
|
+
self.process(self._queued_file)
|
113
|
+
except Exception:
|
114
|
+
_LOGGER.error(f"An error has occured while processing {self._queued_file}",
|
115
|
+
exc_info=True)
|
116
|
+
# Flush any internally stored spectrogram on error to avoid lost data
|
117
|
+
self._flush_cache()
|
118
|
+
# re-raise the exception to the main thread
|
119
|
+
raise
|
120
|
+
|
121
|
+
# Queue the current file for processing next
|
122
|
+
_LOGGER.info(f"Queueing {absolute_file_path} for post processing")
|
123
|
+
self._queued_file = absolute_file_path
|
110
124
|
|
111
125
|
|
112
126
|
def _cache_spectrogram(
|
@@ -123,7 +123,7 @@ class _swept_center_frequency(spectre_top_block):
|
|
123
123
|
self.sdrplay3_rsp1a_0.set_show_gain_changes(False)
|
124
124
|
|
125
125
|
# Connections
|
126
|
-
self.msg_connect((self.spectre_sweep_driver_0, '
|
126
|
+
self.msg_connect((self.spectre_sweep_driver_0, 'retune_command'), (self.sdrplay3_rsp1a_0, 'command'))
|
127
127
|
self.connect((self.sdrplay3_rsp1a_0, 0), (self.spectre_batched_file_sink_0, 0))
|
128
128
|
self.connect((self.sdrplay3_rsp1a_0, 0), (self.spectre_sweep_driver_0, 0))
|
129
129
|
|
{spectre_core-0.0.20 → spectre_core-0.0.22}/src/spectre_core/receivers/plugins/gr/_rspduo.py
RENAMED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Title: Test receiver
|
9
9
|
# GNU Radio version: 3.10.1.1
|
10
10
|
|
11
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
11
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
12
12
|
# This file is part of SPECTRE
|
13
13
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
14
14
|
|
@@ -202,7 +202,7 @@ class _tuner_1_swept_center_frequency(spectre_top_block):
|
|
202
202
|
|
203
203
|
|
204
204
|
# Connections
|
205
|
-
self.msg_connect((self.spectre_sweep_driver_0, '
|
205
|
+
self.msg_connect((self.spectre_sweep_driver_0, 'retune_command'), (self.sdrplay3_rspduo_0, 'command'))
|
206
206
|
self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_batched_file_sink_0, 0))
|
207
207
|
self.connect((self.sdrplay3_rspduo_0, 0), (self.spectre_sweep_driver_0, 0))
|
208
208
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# Title: Test receiver
|
9
9
|
# GNU Radio version: 3.10.1.1
|
10
10
|
|
11
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
11
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
12
12
|
# This file is part of SPECTRE
|
13
13
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
14
14
|
|
@@ -128,7 +128,7 @@ class _swept_center_frequency(spectre_top_block):
|
|
128
128
|
min_frequency)
|
129
129
|
|
130
130
|
# Connections
|
131
|
-
self.msg_connect((self.spectre_sweep_driver_0, '
|
131
|
+
self.msg_connect((self.spectre_sweep_driver_0, 'retune_command'), (self.uhd_usrp_source_0, 'command'))
|
132
132
|
self.connect((self.uhd_usrp_source_0, 0), (self.spectre_batched_file_sink_0, 0))
|
133
133
|
self.connect((self.uhd_usrp_source_0, 0), (self.spectre_sweep_driver_0, 0))
|
134
134
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
1
|
+
# SPDX-FileCopyrightText: © 2024-2025 Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
2
2
|
# This file is part of SPECTRE
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
4
4
|
|
@@ -6,7 +6,8 @@ import os
|
|
6
6
|
import subprocess
|
7
7
|
import shutil
|
8
8
|
import gzip
|
9
|
-
from datetime import datetime
|
9
|
+
from datetime import datetime, date
|
10
|
+
from typing import Tuple
|
10
11
|
|
11
12
|
from spectre_core.config import (
|
12
13
|
get_spectre_data_dir_path, get_batches_dir_path, TimeFormat
|
@@ -195,7 +196,7 @@ def download_callisto_data(
|
|
195
196
|
year: int,
|
196
197
|
month: int,
|
197
198
|
day: int
|
198
|
-
) -> list[str]:
|
199
|
+
) -> Tuple[list[str], date]:
|
199
200
|
"""
|
200
201
|
Download and decompress e-Callisto FITS files, saving them as `spectre` batch files.
|
201
202
|
|
@@ -203,7 +204,7 @@ def download_callisto_data(
|
|
203
204
|
:param year: Year of the observation.
|
204
205
|
:param month: Month of the observation.
|
205
206
|
:param day: Day of the observation.
|
206
|
-
:return: A list of file names of all newly created batch files, as absolute paths within the container's file system.
|
207
|
+
:return: A list of file names of all newly created batch files, as absolute paths within the container's file system. Additionally, return the start date shared by all batch files.
|
207
208
|
"""
|
208
209
|
tmp_dir = os.path.join(get_spectre_data_dir_path(), "tmp")
|
209
210
|
# if there are any residual files in the temporary directory, remove them.
|
@@ -212,4 +213,4 @@ def download_callisto_data(
|
|
212
213
|
os.makedirs(tmp_dir, exist_ok=True)
|
213
214
|
|
214
215
|
_wget_callisto_data(instrument_code.value, year, month, day, tmp_dir)
|
215
|
-
return sorted( _unzip_to_batches(tmp_dir) )
|
216
|
+
return sorted( _unzip_to_batches(tmp_dir) ), date(year, month, day)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: spectre-core
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.22
|
4
4
|
Summary: The core Python package used by the spectre program.
|
5
5
|
Maintainer-email: Jimmy Fitzpatrick <jcfitzpatrick12@gmail.com>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -691,7 +691,6 @@ Requires-Dist: scipy==1.12.0
|
|
691
691
|
Requires-Dist: astropy==6.0.1
|
692
692
|
Requires-Dist: matplotlib==3.5.0
|
693
693
|
Requires-Dist: watchdog==4.0.0
|
694
|
-
Requires-Dist: mypy==1.14.1
|
695
694
|
Dynamic: license-file
|
696
695
|
|
697
696
|
# spectre-core
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|