sct_notch_analysis 1.0.0.dev0__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.
Files changed (22) hide show
  1. sct_notch_analysis-1.0.0.dev0/.gitignore +198 -0
  2. sct_notch_analysis-1.0.0.dev0/LICENSE.txt +21 -0
  3. sct_notch_analysis-1.0.0.dev0/PKG-INFO +103 -0
  4. sct_notch_analysis-1.0.0.dev0/README.md +36 -0
  5. sct_notch_analysis-1.0.0.dev0/pyproject.toml +113 -0
  6. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/__init__.py +9 -0
  7. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/cli.py +81 -0
  8. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/config.py +32 -0
  9. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/core/__init__.py +8 -0
  10. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/core/analysis.py +73 -0
  11. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/interface.py +56 -0
  12. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/main.py +70 -0
  13. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/resources/__init__.py +8 -0
  14. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/resources/config_schema.json +21 -0
  15. sct_notch_analysis-1.0.0.dev0/src/sct_notch_analysis/testing.py +146 -0
  16. sct_notch_analysis-1.0.0.dev0/tests/__init__.py +4 -0
  17. sct_notch_analysis-1.0.0.dev0/tests/unittest/__init__.py +4 -0
  18. sct_notch_analysis-1.0.0.dev0/tests/unittest/test_core_analysis.py +42 -0
  19. sct_notch_analysis-1.0.0.dev0/tests/unittest/test_notch_cli.py +75 -0
  20. sct_notch_analysis-1.0.0.dev0/tests/unittest/test_notch_config.py +169 -0
  21. sct_notch_analysis-1.0.0.dev0/tests/unittest/test_notch_testing.py +133 -0
  22. sct_notch_analysis-1.0.0.dev0/tests/unittest/test_plugin_interface.py +75 -0
@@ -0,0 +1,198 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm-project.org/#use-with-ide
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
163
+
164
+ # Distribution / packaging
165
+ build/
166
+ _build/
167
+ dist/
168
+ *.egg-info/
169
+ .ipynb_checkpoints/
170
+ .nox
171
+
172
+ # Pyenv
173
+ .python-version
174
+
175
+ # VS Code project settings
176
+ .vscode
177
+
178
+ # PyCharm project settings
179
+ .idea
180
+
181
+ # Spyder project settings
182
+ .spyproject
183
+
184
+ # Environments
185
+ venv*
186
+
187
+ # Docker
188
+ docker-compose.yml
189
+ Dockerfile
190
+ .devcontainer
191
+
192
+ # Other
193
+ *.bak
194
+ .coverage
195
+ htmlcov
196
+ *.svg
197
+
198
+ pdm.lock
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) Aresys S.r.l. <info@aresys.it>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.5
2
+ Name: sct_notch_analysis
3
+ Version: 1.0.0.dev0
4
+ Summary: SCT Plugin for Notch Analysis of L1 SAR Products.
5
+ Project-URL: Homepage, https://github.com/aresys-srl/sct_plugins_analyses
6
+ Project-URL: Repository, https://github.com/aresys-srl/sct_plugins_analyses
7
+ Project-URL: Documentation, https://opensource.aresys.it/sct_plugins_analyses
8
+ Author-email: "Aresys S.R.L." <info@aresys.it>
9
+ License: MIT License
10
+
11
+ Copyright (C) Aresys S.r.l. <info@aresys.it>
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE.txt
31
+ Classifier: Development Status :: 5 - Production/Stable
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: Intended Audience :: Education
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Natural Language :: English
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Programming Language :: Python :: 3.14
43
+ Classifier: Topic :: Scientific/Engineering
44
+ Classifier: Topic :: Software Development :: Libraries
45
+ Classifier: Topic :: Utilities
46
+ Classifier: Typing :: Typed
47
+ Requires-Python: >=3.11
48
+ Requires-Dist: jsonschema
49
+ Requires-Dist: netcdf4
50
+ Requires-Dist: numpy>2
51
+ Requires-Dist: perseo-core>=1.0.0
52
+ Requires-Dist: perseo-quality>=1.1.0
53
+ Requires-Dist: sct
54
+ Requires-Dist: typer>=0.24.1
55
+ Provides-Extra: dev
56
+ Requires-Dist: pylint; extra == 'dev'
57
+ Requires-Dist: ruff; extra == 'dev'
58
+ Provides-Extra: docs
59
+ Requires-Dist: mkdocstrings-python; extra == 'docs'
60
+ Requires-Dist: zensical; extra == 'docs'
61
+ Provides-Extra: test
62
+ Requires-Dist: pytest; extra == 'test'
63
+ Requires-Dist: pytest-cov; extra == 'test'
64
+ Requires-Dist: pytest-mock; extra == 'test'
65
+ Requires-Dist: sct[graphs]>=3.1.0; extra == 'test'
66
+ Description-Content-Type: text/markdown
67
+
68
+ # SCT Plugin: Elevation Notch Analysis
69
+
70
+ [![PyPI version](https://img.shields.io/pypi/v/sct-notch-analysis)](https://pypi.org/project/sct-notch-analysis/)
71
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://python.org)
72
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.txt)
73
+
74
+ [![CI](https://github.com/aresys-srl/sct_plugins_analyses/actions/workflows/notch.yml/badge.svg)](https://github.com/aresys-srl/sct_plugins_analyses/actions/workflows/notch.yml)
75
+
76
+ [SCT (SAR Calibration Toolbox)](https://github.com/aresys-srl/sct) plugin for performing
77
+ Elevation Notch Analysis on L1 SAR products. Enables antenna mispointing computation from dedicated notch products.
78
+
79
+ ## Installation
80
+
81
+ ``` bash
82
+ pip install sct-notch-analysis
83
+ ```
84
+
85
+ SCT is automatically installed as a dependency.
86
+
87
+ ## Compatibility
88
+
89
+ This plugin must be installed in the same Python environment as SCT. Once installed,
90
+ the plugin is automatically discovered and registered by SCT through its entry-point
91
+ based plugin system; no additional configuration is required.
92
+
93
+ ## Documentation
94
+
95
+ - [SCT documentation](https://opensource.aresys.it/sct/)
96
+ - [Quality Analysis documentation](https://opensource.aresys.it/perseo/documentation/quality/)
97
+ - [Analysis Plugins documentation](https://opensource.aresys.it/sct_plugins_analyses)
98
+
99
+ ## License
100
+
101
+ This project is licensed under the MIT License. See the [LICENSE.txt](LICENSE.txt) file for details.
102
+
103
+ Copyright &copy; 2026-present Aresys S.r.l. <info@aresys.it>
@@ -0,0 +1,36 @@
1
+ # SCT Plugin: Elevation Notch Analysis
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/sct-notch-analysis)](https://pypi.org/project/sct-notch-analysis/)
4
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://python.org)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.txt)
6
+
7
+ [![CI](https://github.com/aresys-srl/sct_plugins_analyses/actions/workflows/notch.yml/badge.svg)](https://github.com/aresys-srl/sct_plugins_analyses/actions/workflows/notch.yml)
8
+
9
+ [SCT (SAR Calibration Toolbox)](https://github.com/aresys-srl/sct) plugin for performing
10
+ Elevation Notch Analysis on L1 SAR products. Enables antenna mispointing computation from dedicated notch products.
11
+
12
+ ## Installation
13
+
14
+ ``` bash
15
+ pip install sct-notch-analysis
16
+ ```
17
+
18
+ SCT is automatically installed as a dependency.
19
+
20
+ ## Compatibility
21
+
22
+ This plugin must be installed in the same Python environment as SCT. Once installed,
23
+ the plugin is automatically discovered and registered by SCT through its entry-point
24
+ based plugin system; no additional configuration is required.
25
+
26
+ ## Documentation
27
+
28
+ - [SCT documentation](https://opensource.aresys.it/sct/)
29
+ - [Quality Analysis documentation](https://opensource.aresys.it/perseo/documentation/quality/)
30
+ - [Analysis Plugins documentation](https://opensource.aresys.it/sct_plugins_analyses)
31
+
32
+ ## License
33
+
34
+ This project is licensed under the MIT License. See the [LICENSE.txt](LICENSE.txt) file for details.
35
+
36
+ Copyright &copy; 2026-present Aresys S.r.l. <info@aresys.it>
@@ -0,0 +1,113 @@
1
+ [project]
2
+ name = "sct_notch_analysis"
3
+ description = "SCT Plugin for Notch Analysis of L1 SAR Products."
4
+ authors = [{ name = "Aresys S.R.L.", email = "info@aresys.it" }]
5
+ requires-python = ">=3.11"
6
+ readme = "README.md"
7
+ license = { file = "LICENSE.txt" }
8
+ dependencies = [
9
+ "numpy>2",
10
+ "netCDF4",
11
+ "jsonschema",
12
+ "typer>=0.24.1",
13
+ "perseo-core>=1.0.0",
14
+ "perseo-quality>=1.1.0",
15
+ "sct",
16
+ ]
17
+ dynamic = ["version"]
18
+ classifiers = [
19
+ "Development Status :: 5 - Production/Stable",
20
+ "Intended Audience :: Science/Research",
21
+ "Intended Audience :: Education",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Natural Language :: English",
25
+ "Programming Language :: Python",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Operating System :: OS Independent",
31
+ "Topic :: Software Development :: Libraries",
32
+ "Topic :: Utilities",
33
+ "Topic :: Scientific/Engineering",
34
+ "Typing :: Typed",
35
+ ]
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/aresys-srl/sct_plugins_analyses"
39
+ Repository = "https://github.com/aresys-srl/sct_plugins_analyses"
40
+ Documentation = "https://opensource.aresys.it/sct_plugins_analyses"
41
+
42
+ [project.optional-dependencies]
43
+ dev = ["ruff", "pylint"]
44
+ test = ["pytest", "pytest-cov", "pytest-mock", "sct[graphs]>=3.1.0"]
45
+ docs = ["zensical", "mkdocstrings-python"]
46
+
47
+ [project.entry-points."sct.analyses"]
48
+ elevation_notch = "sct_notch_analysis.interface:ElevationNotchAnalysisPlugin"
49
+
50
+ [build-system]
51
+ requires = ["hatchling"]
52
+ build-backend = "hatchling.build"
53
+
54
+ [tool.hatch.version]
55
+ path = "src/sct_notch_analysis/__init__.py"
56
+
57
+ [tool.hatch.build.targets.sdist]
58
+ only-include = ["src", "tests"]
59
+
60
+ [tool.hatch.metadata]
61
+ allow-direct-references = true
62
+
63
+ [tool.pytest.ini_options]
64
+ minversion = "8.0"
65
+ testpaths = ["tests"]
66
+ python_files = ["test_*.py"]
67
+ python_classes = ["Test*"]
68
+ python_functions = ["test_*"]
69
+ addopts = [
70
+ "-ra",
71
+ "--strict-markers",
72
+ "--strict-config",
73
+ "--tb=short",
74
+ "--cov=sct_notch_analysis",
75
+ "--cov-report=term-missing",
76
+ "--cov-report=html",
77
+ "--no-cov-on-fail",
78
+ ]
79
+
80
+ [tool.coverage.run]
81
+ branch = true
82
+ source = ["src"]
83
+
84
+ [tool.coverage.report]
85
+ skip_covered = true
86
+ show_missing = true
87
+ fail_under = 70
88
+
89
+ [tool.pylint.master]
90
+ fail-under = 8
91
+ fail-on = ["unused-import"]
92
+
93
+ [tool.pylint.message_control]
94
+ disable = ["import-error", "logging-fstring-interpolation", "logging-not-lazy"]
95
+
96
+ [tool.pylint.format]
97
+ max-line-length = 120
98
+
99
+ [tool.pdm]
100
+ distribution = true
101
+
102
+ [tool.pdm.resolution]
103
+ respect-source-order = true
104
+
105
+ [tool.pdm.scripts]
106
+ format_check = "ruff format --check"
107
+ format = "ruff format"
108
+ sort = "ruff check --select I --fix-only"
109
+ lint_check = "ruff check"
110
+ lint_fix = "ruff check --show-fixes --fix-only"
111
+ test = "python -m pytest ./tests -v"
112
+ check_code = { composite = ["format_check", "lint_check"] }
113
+ fix_format = { composite = ["format", "sort", "lint_fix"] }
@@ -0,0 +1,9 @@
1
+ # SPDX-FileCopyrightText: Aresys S.r.l. <info@aresys.it>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ """Elevation Notch Analysis on L1 SAR Products plugin for SCT.
5
+
6
+ Discovered by SCT via the ``sct.analyses`` entry-point namespace.
7
+ """
8
+
9
+ __version__ = "1.0.0.dev0"
@@ -0,0 +1,81 @@
1
+ # SPDX-FileCopyrightText: Aresys S.r.l. <info@aresys.it>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ """Command Line Interface for Elevation Notch Analysis."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from pathlib import Path
9
+
10
+ import typer
11
+ from sct.cli import common
12
+ from sct.configuration.config import GeneralConfiguration
13
+ from sct.configuration.logger import sct_logger
14
+
15
+ from sct_notch_analysis.config import SCTElevationNotchAnalysisConfig
16
+
17
+
18
+ def notch_analysis(
19
+ ctx: typer.Context,
20
+ product: common.InputProductOption,
21
+ output_directory: common.OutputDirectoryOption,
22
+ antenna_pattern: common.AntennaPatternInputOption = None,
23
+ graphs: common.GraphsOption = False,
24
+ ) -> None:
25
+ """Elevation Notch Analysis.
26
+
27
+ \b
28
+ Antenna pattern NetCDF file can be provided to estimate the elevation pointing offset with Least Square fitting
29
+ of the elevation profile of the focused data with a three parameters internal model.
30
+ """
31
+
32
+ config: GeneralConfiguration = ctx.obj
33
+
34
+ log_path = output_directory / "sct_notch_analysis.log" if config.save_log else None
35
+
36
+ with common.logging_to_file(log_path):
37
+ sct_logger.info(f"Product: {product}")
38
+ if antenna_pattern is not None:
39
+ sct_logger.info(f"Antenna pattern: {antenna_pattern}")
40
+ else:
41
+ sct_logger.warning("No antenna pattern provided, only parabolic fit around minimum will be performed.")
42
+ sct_logger.info(f"Output folder: {output_directory}")
43
+ sct_logger.info(f"Graphs generation {'enabled' if graphs else 'disabled'}")
44
+
45
+ common.display_title("Elevation Notch Analysis")
46
+
47
+ analysis_config = (
48
+ SCTElevationNotchAnalysisConfig.from_toml(config.toml_path)
49
+ if config.toml_path is not None
50
+ else SCTElevationNotchAnalysisConfig()
51
+ )
52
+ elevation_notch_analysis_implementation(
53
+ product=product,
54
+ antenna_pattern=antenna_pattern,
55
+ output_directory=output_directory,
56
+ config=analysis_config,
57
+ graphs=graphs,
58
+ dump_config=config.save_config_copy,
59
+ )
60
+
61
+
62
+ @common.log_elapsed_time("Elevation Notch Analysis")
63
+ @common.graceful_exit("Elevation Notch Analysis")
64
+ def elevation_notch_analysis_implementation(
65
+ product: Path,
66
+ antenna_pattern: Path | None,
67
+ output_directory: Path,
68
+ config: SCTElevationNotchAnalysisConfig,
69
+ graphs: bool,
70
+ dump_config: bool,
71
+ ) -> None:
72
+ """Implement the elevation notch analysis command."""
73
+ from sct_notch_analysis.main import full_elevation_notch_analysis
74
+
75
+ full_elevation_notch_analysis(
76
+ product=product,
77
+ antenna_pattern=antenna_pattern,
78
+ output_directory=output_directory,
79
+ config=config,
80
+ graphs=graphs,
81
+ )
@@ -0,0 +1,32 @@
1
+ # SPDX-FileCopyrightText: Aresys S.r.l. <info@aresys.it>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ """Elevation Notch Analysis Configuration."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from dataclasses import asdict, dataclass, field
9
+ from pathlib import Path
10
+
11
+ from perseo_quality.elevation_notch_analysis.config import ElevationNotchConfig
12
+ from sct.configuration.config_abc import AnalysisConfigABC
13
+
14
+ from sct_notch_analysis.resources import config_schema
15
+
16
+
17
+ @dataclass
18
+ class SCTElevationNotchAnalysisConfig(AnalysisConfigABC):
19
+ """SCT Elevation Notch Analysis configuration"""
20
+
21
+ base_config: ElevationNotchConfig = field(default_factory=ElevationNotchConfig)
22
+ config_group_name = "elevation_notch_analysis"
23
+ validation_schema = Path(config_schema)
24
+
25
+ @classmethod
26
+ def from_dict(cls, arg: dict) -> SCTElevationNotchAnalysisConfig:
27
+ """Convert from dict"""
28
+ return cls(base_config=ElevationNotchConfig.from_dict(arg))
29
+
30
+ def to_dict(self):
31
+ """Convert to dict"""
32
+ return {self.config_group_name: asdict(self.base_config)}
@@ -0,0 +1,8 @@
1
+ # SPDX-FileCopyrightText: Aresys S.r.l. <info@aresys.it>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ """Elevation Notch Analysis - Core implementation"""
5
+
6
+ from sct_notch_analysis.core.analysis import sct_elevation_notch_analysis
7
+
8
+ __all__ = ["sct_elevation_notch_analysis"]
@@ -0,0 +1,73 @@
1
+ # SPDX-FileCopyrightText: Aresys S.r.l. <info@aresys.it>
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ """Elevation Notch Analysis"""
5
+
6
+ from __future__ import annotations
7
+
8
+ from pathlib import Path
9
+
10
+ from perseo_quality.elevation_notch_analysis.analysis import elevation_notch_analysis
11
+ from perseo_quality.elevation_notch_analysis.custom_dataclasses import (
12
+ ElevationNotchOutput,
13
+ )
14
+ from sct.configuration.logger import sct_logger
15
+ from sct.io.antenna_pattern_manager import read_antenna_pattern_netcdf
16
+ from sct.io.io_manager import InvalidProductType, product_loader
17
+
18
+ from sct_notch_analysis.config import SCTElevationNotchAnalysisConfig
19
+
20
+
21
+ def sct_elevation_notch_analysis(
22
+ product_path: str | Path,
23
+ antenna_pattern_file: str | Path | None = None,
24
+ config: SCTElevationNotchAnalysisConfig | None = None,
25
+ ) -> list[ElevationNotchOutput]:
26
+ """Elevation Notch Analysis performed on the input product, taking into account the antenna pattern data, if
27
+ provided.
28
+
29
+ Parameters
30
+ ----------
31
+ product_path : str | Path
32
+ path to the product to be analyzed
33
+ antenna_pattern_file : str | Path | None, optional
34
+ path to the antenna pattern NetCDF file, if needed, by default None
35
+ config : SCTElevationNotchAnalysisConfig | None, optional
36
+ configuration parameters, by default None
37
+
38
+ Returns
39
+ -------
40
+ list[ElevationNotchOutput]
41
+ list of ElevationNotchOutput analysis output, one for each product channel
42
+ """
43
+ product_path = Path(product_path)
44
+ sct_logger.info(f"Input product: {product_path}")
45
+
46
+ config = config or SCTElevationNotchAnalysisConfig()
47
+
48
+ # LOADING PRODUCT
49
+ try:
50
+ product, _ = product_loader(
51
+ product_path=product_path,
52
+ )
53
+ except InvalidProductType as err:
54
+ sct_logger.critical(f"Unknown product type {product_path}.")
55
+ sct_logger.critical("Please check that the dedicated format plugin is installed.")
56
+ raise InvalidProductType from err
57
+
58
+ # LOADING ANTENNA PATTERN
59
+ antenna_pattern = None
60
+ if antenna_pattern_file is not None:
61
+ sct_logger.info(f"Antenna Pattern provided. Loading data from {antenna_pattern_file}")
62
+ try:
63
+ antenna_pattern = read_antenna_pattern_netcdf(antenna_pattern_file)
64
+ except Exception as err:
65
+ sct_logger.critical("Error while reading antenna pattern file")
66
+ sct_logger.critical(err)
67
+ raise RuntimeError from err
68
+
69
+ return elevation_notch_analysis(
70
+ product=product,
71
+ antenna_pattern=antenna_pattern,
72
+ config=config.base_config,
73
+ )