StatisticToolPython
A comprehensive statistics and antenna pattern analysis tool for radar systems, built with Python and PySide6.
Features
- Statistics Analysis: Process and analyze measurement data with statistical limits
- Antenna Pattern Processing: Handle antenna diagrams and patterns for various radar types
- GUI Interface: User-friendly Qt-based interface for data visualization
- Report Generation: Automated PowerPoint and PDF report creation
- Data Processing: Support for multiple data formats (JSON, YAML, protocol files)
Requirements
- Python 3.8+
- PySide6 for GUI
- matplotlib for plotting
- numpy for numerical operations
- PyYAML for configuration
- python-pptx for PowerPoint generation
Installation
From PyPI (recommended)
pip install calibration-statistics-tool
calibration-tool
From source
- Clone the repository:
git clone https://github.com/marjanstojchev/Calibration-Statistics-Tool.git
cd Calibration-Statistics-Tool
- Create a virtual environment:
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/Mac
- Install in editable mode:
pip install -e .
Configuration
On first launch the tool creates one visible data folder and fills it with everything it needs. No manual setup is required to start — but configuring the input directories makes file dialogs open directly in the right folder.
Data folder
| Platform | Default location |
|---|---|
| Windows | C:\Users\<you>\Documents\calibration-tool\ |
| Linux / macOS | ~/Documents/calibration-tool/ |
Set the CST_HOME environment variable to use a different folder. The data folder contains:
| Item | Contents |
|---|---|
paths.json |
Settings: output folder and default input folders (see below) |
config/ |
Editable measurement limits and diagram configs (seeded on first run, never overwritten on upgrade) |
templates/ |
PowerPoint report templates (seeded on first run, never overwritten on upgrade) |
logs/ |
Log files |
output*/ |
Generated reports and diagrams (see Output directories) |
Upgrading from 1.0.23 or earlier: these files used to live in
%APPDATA%\calibration-statistics-tool(Linux:~/.config/calibration-statistics-tool). On first start the settings and any edited config/templates are copied to the new data folder. The old folder is left untouched and can be deleted.
Configuration file (paths.json)
paths.json is created with defaults on first run. Edit it with any text editor:
{
"output_base": "C:\\Users\\you\\Documents\\calibration-tool",
"input_protocol_dir": "D:\\measurements\\protocol_files",
"input_ptu_dir": "D:\\measurements\\ptu_files",
"input_tx_ant_dir": "D:\\measurements\\tx_antenna_files"
}
| Key | Description |
|---|---|
output_base |
Root folder for all generated reports and diagrams. Defaults to the data folder. Created automatically if it does not exist. |
input_protocol_dir |
Folder containing protocol measurement files (.csv / text format). File dialogs open here. Leave empty to start at the home folder. |
input_ptu_dir |
Folder containing PTU-2 antenna measurement files (.ptu binary format). |
input_tx_ant_dir |
Folder containing Tx-antenna diagram input files. |
Output directories
All output is written under output_base. The tool creates these subdirectories automatically:
| Subdirectory | Contents |
|---|---|
output/ |
Antenna system diagram PPTX reports |
output_tx_diagrams/ |
Tx-antenna diagram PPTX reports |
output_antenna_patterns/ |
Antenna pattern YAML + plot exports |
output_huellkurven/ |
Hüllkurven (hull curve) PPTX reports |
output_certificates/ |
Calibration certificate exports |
output_setcurves/ |
Set-curves output and input config JSON |
output_statistic/ |
Statistics PPTX reports |
output_merge/ |
Merged PPTX output (combine.pptx) |
Input directory conventions
| Input folder | Expected file types | Used by tab |
|---|---|---|
protocol_files/ |
Protocol text/CSV files exported from the measurement system | Parse Protocols |
ptu_files/ |
PTU-2 binary files (*.ptu) |
Parse Protocols / System Diagrams |
tx_antenna_files/ |
Tx-antenna measurement files | Tx-Ant. Diagrams |
Configuration files
The package ships default files (shared/config/). On first run they are copied to <data folder>\config\, and the tool reads them from there. They define measurement limits and plot layouts:
| File | Purpose |
|---|---|
CalLimits.yaml |
Calibration measurement limits (gradient, curvilinearity, peak width, variation) |
CalLimGroups.yaml |
Grouping metadata for CalLimits — controls how limits are organised in the UI |
BurnInLimits.yaml |
Burn-in measurement limits (Doppler, speed, range, amplitude, cycle duration) |
BurnInLimGroups.yaml |
Grouping metadata for BurnInLimits |
StatisticsLimitsConfig.json |
Statistics plot setup — defines which measurements to plot and how slides are laid out |
AntennaSystemDiagramsConf.yaml |
System diagram computation config (plot/graph/chirp/diagram layouts) |
TxAntDiagramsConf.yaml |
Tx-antenna diagram computation config |
Note: Edit the copies in
<data folder>\config\to customise limits. Upgrades never overwrite them; to get a newer default, delete the file and restart the tool.
Log files
Logs are written to <data folder>\logs\. Unexpected errors in the GUI are also written to 0_main_loaddata.log.
Usage
After installing from PyPI:
calibration-tool
When running from source:
python -m calibration_statistics_tool.main
On startup, the console prints the location of paths.json and lists any input directories that have not been configured yet.
Project Structure
The application follows an MVC architecture split across several sub-packages:
calibration_statistics_tool/
main.py # Thin wiring file -- startup, DI, handler wiring
shared/ # Domain logic (controllers, parsers, models)
models.py # Data model classes
parse_controller.py # ParseController -- protocol/PTU2 business logic
plot_controller.py # PlotController -- diagram/plot state management
calcdiagram_functions.py # Vectorised diagram calculations (NumPy)
parsePTU2data.py # PTU2 file parser and data structures
parse_helpers.py # Protocol parsing helpers
loaddata.py # Data loading utilities
ui/
main_view.py # MainView -- owns QApplication and all widgets
pyside_qtgui.py # Backward-compat shim (delegates to MainView)
ui_constants.py # Pure-Python layout/size/style constants
widgets.py # Reusable Qt widget classes (PlotFrame, etc.)
handlers/ # Signal handler modules (one per tab)
app_context.py # AppContext -- dependency-injection container
parse_handlers.py # Parse Protocols tab handlers
sys_diag_handlers.py # System Diagrams tab handlers
tx_ant_diag_handlers.py # Tx-Antenna Diagrams tab handlers
ant_pat_handlers.py # Antenna Patterns tab handlers
tabs/ # Tab widget declarations (one file per tab)
parse_prot_tab.py
sys_diag_tab.py
tx_ant_diag_tab.py
ant_pat_tab.py
system_diagrams/ # AntennaSystemDiagrams computation module
antenna_patterns/ # Antenna pattern analysis (antpat_v5)
tx_diagrams/ # Tx-Antenna Diagrams computation module
tests/ # Pytest test suite (613 tests)
conftest.py # Shared fixtures and Qt session setup
integration/ # Real-Qt integration tests
docs/ # Architecture documentation
Development
Install development dependencies:
pip install -e ".[dev]"
Run tests:
pytest
Run benchmarks (local only, informational):
pytest --benchmark-only
Lint code:
ruff check .
Architecture
Detailed architecture documentation is in docs/:
docs/mvc_architecture.md— MVC design, dependency injection, layer boundaries
Test Writer Agent (Jira Zephyr)
The calibration_statistics_tool/agents/zephyr package analyses the Python source tree and generates
manual test cases as a CSV file that can be imported directly into
Jira Zephyr Scale (Test Cases → Import → CSV).
Quick start
# Generate Unit + Integration test cases for the shared/ module
python -m calibration_statistics_tool.agents.zephyr.mcp_server \
--source calibration_statistics_tool/shared/ \
--level Unit \
--level Integration \
--output zephyr_tests.csv
Or from Python:
from test_writer import TestWriterAgent
agent = TestWriterAgent(
source_paths=["shared/", "ui/handlers/"],
levels=["Unit", "Integration", "System"],
output_csv="zephyr_tests.csv",
)
path = agent.run()
print(f"Generated: {path}")
CLI reference
| Option | Default | Description |
|---|---|---|
--source PATH |
. |
Directory or .py file to scan. Repeatable. |
--level LEVEL |
Unit, Integration |
Testing level: Unit, Integration, System, Smoke, Regression, Acceptance. Repeatable. |
--output FILE |
zephyr_tests.csv |
Output CSV path. |
--root DIR |
cwd |
Repo root for module-name resolution. |
--prefix PREFIX |
Calibration-Statistics-Tool |
Jira component prefix. |
--skip-dir NAME |
— | Directory name to skip. Repeatable. |
CSV format
The generated file follows the Zephyr Scale CSV import schema:
| Column | Description |
|---|---|
| Name | Test case name (e.g. [Unit] shared.models — MyClass) |
| Status | Draft / Approved / Deprecated |
| Priority | High / Medium / Low |
| Component | Jira component (<prefix>/<top-level-package>) |
| Labels | Comma-separated: level, symbol kind, package |
| Precondition | Environment prerequisites |
| Objective | One-sentence description of what is verified |
| Folder | Zephyr folder path (/<Level>/<module/path>) |
| Test Script (Step) | Step action text |
| Test Script (Step Data) | Input data for the step |
| Test Script (Expected Result) | Expected outcome |
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Metadata
Release files for calibration-statistics-tool 1.0.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| calibration_statistics_tool-1.0.27.tar.gz | 1.9 MB | Without provenance | Details for calibration_statistics_tool-1.0.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| calibration_statistics_tool-1.0.27-py3-none-any.whl | Python 3 | none | any | Details for calibration_statistics_tool-1.0.27-py3-none-any.whl |
Total release size: 3.8 MB
Release files / calibration_statistics_tool-1.0.27.tar.gz
| Download URL | calibration_statistics_tool-1.0.27.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5de575f2473583451716adb131222c0d5dffd3bfbcdef25d95227b07c510811d
|
|
BLAKE2b-256 checksum How to use checksums |
ceb9245ed787353597dc849ad337d849bf5a4211e93dfe819fc5d3174bb02fc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.18
|
Release files / calibration_statistics_tool-1.0.27-py3-none-any.whl
| Download URL | calibration_statistics_tool-1.0.27-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fcbe6e39de28dde10945a178bbf705762c7c831ef6d84ae13c51110477d9ff8
|
|
BLAKE2b-256 checksum How to use checksums |
aa75023fc84ad837082df8af15da39d94fce9a86d86c54b397bf6feb78e29328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.18
|
Security for calibration-statistics-tool 1.0.27
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.