alpaca-simulators 1.0.0__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.
- alpaca_simulators-1.0.0/PKG-INFO +105 -0
- alpaca_simulators-1.0.0/README.md +83 -0
- alpaca_simulators-1.0.0/pyproject.toml +59 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/__init__.py +3 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/__init__.py +1 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/camera.py +1311 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/common.py +354 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/covercalibrator.py +191 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/dome.py +404 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/filterwheel.py +69 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/focuser.py +185 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/observingconditions.py +559 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/rotator.py +257 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/safetymonitor.py +57 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/switch.py +336 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/api/telescope.py +1560 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/config/template.yaml +273 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/config.py +82 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/endpoint_discovery.py +88 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/main.py +237 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/run_simulator.py +48 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/state.py +403 -0
- alpaca_simulators-1.0.0/src/alpaca_simulators/templates/index2.html.j2 +322 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alpaca-simulators
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python based ASCOM Alpaca simulators for Observatory Control Software testing
|
|
5
|
+
Keywords: astronomy,astrophysics,telescope
|
|
6
|
+
Author: Peter Pedersen, David Degen
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Requires-Dist: fastapi
|
|
9
|
+
Requires-Dist: uvicorn
|
|
10
|
+
Requires-Dist: pyyaml
|
|
11
|
+
Requires-Dist: cabaret
|
|
12
|
+
Requires-Dist: jinja2
|
|
13
|
+
Requires-Dist: python-multipart
|
|
14
|
+
Requires-Dist: pytest ; extra == 'test'
|
|
15
|
+
Requires-Dist: httpx ; extra == 'test'
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Project-URL: Bug Tracker, https://github.com/ppp-one/alpaca-simulators/issues
|
|
18
|
+
Project-URL: Homepage, https://github.com/ppp-one/alpaca-simulators
|
|
19
|
+
Project-URL: Source, https://github.com/ppp-one/alpaca-simulators
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# ASCOM Alpaca Simulators
|
|
24
|
+
|
|
25
|
+
A comprehensive simulator for ASCOM Alpaca devices that provides a RESTful API for testing and developing observatory control software.
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **Complete Device Simulation**: Supports all major ASCOM device types including:
|
|
30
|
+
|
|
31
|
+
- Camera
|
|
32
|
+
- Telescope
|
|
33
|
+
- Dome
|
|
34
|
+
- Focuser
|
|
35
|
+
- Filter Wheel
|
|
36
|
+
- Rotator
|
|
37
|
+
- Safety Monitor
|
|
38
|
+
- Switch
|
|
39
|
+
- Observing Conditions
|
|
40
|
+
- Cover Calibrator
|
|
41
|
+
|
|
42
|
+
- **Realistic Image Generation**: Uses [cabaret](https://github.com/ppp-one/cabaret) to generate authentic astronomical images for camera simulation
|
|
43
|
+
- **RESTful API**: Fully compliant with the ASCOM Alpaca Device API specification
|
|
44
|
+
- **Interactive Test Interface**: Web-based control panel for manual testing
|
|
45
|
+
- **Configurable Devices**: YAML-based configuration for all device properties
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
The fastest way to run the simulator is using [uv](https://docs.astral.sh/uv/).
|
|
50
|
+
|
|
51
|
+
1. **Clone the repository:**
|
|
52
|
+
```bash
|
|
53
|
+
git clone https://github.com/ppp-one/alpaca-simulators
|
|
54
|
+
cd alpaca-simulators
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2. **Run the simulator:**
|
|
58
|
+
```bash
|
|
59
|
+
uv run alpaca-simulators
|
|
60
|
+
```
|
|
61
|
+
*This will automatically install dependencies and start the server at `http://0.0.0.0:11111`.*
|
|
62
|
+
|
|
63
|
+
## Configuration & Options
|
|
64
|
+
|
|
65
|
+
The simulator supports several command-line arguments:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Run on a different port with auto-reload enabled
|
|
69
|
+
uv run alpaca-simulators --port 8080 --reload
|
|
70
|
+
|
|
71
|
+
# Use a specific configuration file
|
|
72
|
+
uv run alpaca-simulators --config my_custom_setup.yaml
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Test Interface
|
|
76
|
+
|
|
77
|
+
The simulator includes a web-based test UI at `http://localhost:11111/test_interface` that allows you to:
|
|
78
|
+
|
|
79
|
+
- **GET properties**: Retrieve current values from any device property
|
|
80
|
+
- **PUT operations**: Set values and trigger actions using form inputs
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Device Configuration
|
|
84
|
+
|
|
85
|
+
On first run, the simulator generates `src/alpaca_simulators/config/config.yaml` from a template. You can modify this file to set:
|
|
86
|
+
|
|
87
|
+
- Device names and descriptions
|
|
88
|
+
- Initial property values
|
|
89
|
+
- Capabilities and limits
|
|
90
|
+
- Available options (e.g., filter names, camera properties)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Example API Calls
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Get telescope position
|
|
97
|
+
curl http://localhost:11111/api/v1/telescope/0/rightascension
|
|
98
|
+
|
|
99
|
+
# Set camera exposure time
|
|
100
|
+
curl -X PUT http://localhost:11111/api/v1/camera/0/startexposure \
|
|
101
|
+
-d "Duration=5.0&Light=true"
|
|
102
|
+
|
|
103
|
+
# Check if dome is at home
|
|
104
|
+
curl http://localhost:11111/api/v1/dome/0/athome
|
|
105
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# ASCOM Alpaca Simulators
|
|
2
|
+
|
|
3
|
+
A comprehensive simulator for ASCOM Alpaca devices that provides a RESTful API for testing and developing observatory control software.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Complete Device Simulation**: Supports all major ASCOM device types including:
|
|
8
|
+
|
|
9
|
+
- Camera
|
|
10
|
+
- Telescope
|
|
11
|
+
- Dome
|
|
12
|
+
- Focuser
|
|
13
|
+
- Filter Wheel
|
|
14
|
+
- Rotator
|
|
15
|
+
- Safety Monitor
|
|
16
|
+
- Switch
|
|
17
|
+
- Observing Conditions
|
|
18
|
+
- Cover Calibrator
|
|
19
|
+
|
|
20
|
+
- **Realistic Image Generation**: Uses [cabaret](https://github.com/ppp-one/cabaret) to generate authentic astronomical images for camera simulation
|
|
21
|
+
- **RESTful API**: Fully compliant with the ASCOM Alpaca Device API specification
|
|
22
|
+
- **Interactive Test Interface**: Web-based control panel for manual testing
|
|
23
|
+
- **Configurable Devices**: YAML-based configuration for all device properties
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
The fastest way to run the simulator is using [uv](https://docs.astral.sh/uv/).
|
|
28
|
+
|
|
29
|
+
1. **Clone the repository:**
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/ppp-one/alpaca-simulators
|
|
32
|
+
cd alpaca-simulators
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. **Run the simulator:**
|
|
36
|
+
```bash
|
|
37
|
+
uv run alpaca-simulators
|
|
38
|
+
```
|
|
39
|
+
*This will automatically install dependencies and start the server at `http://0.0.0.0:11111`.*
|
|
40
|
+
|
|
41
|
+
## Configuration & Options
|
|
42
|
+
|
|
43
|
+
The simulator supports several command-line arguments:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Run on a different port with auto-reload enabled
|
|
47
|
+
uv run alpaca-simulators --port 8080 --reload
|
|
48
|
+
|
|
49
|
+
# Use a specific configuration file
|
|
50
|
+
uv run alpaca-simulators --config my_custom_setup.yaml
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Test Interface
|
|
54
|
+
|
|
55
|
+
The simulator includes a web-based test UI at `http://localhost:11111/test_interface` that allows you to:
|
|
56
|
+
|
|
57
|
+
- **GET properties**: Retrieve current values from any device property
|
|
58
|
+
- **PUT operations**: Set values and trigger actions using form inputs
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Device Configuration
|
|
62
|
+
|
|
63
|
+
On first run, the simulator generates `src/alpaca_simulators/config/config.yaml` from a template. You can modify this file to set:
|
|
64
|
+
|
|
65
|
+
- Device names and descriptions
|
|
66
|
+
- Initial property values
|
|
67
|
+
- Capabilities and limits
|
|
68
|
+
- Available options (e.g., filter names, camera properties)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Example API Calls
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Get telescope position
|
|
75
|
+
curl http://localhost:11111/api/v1/telescope/0/rightascension
|
|
76
|
+
|
|
77
|
+
# Set camera exposure time
|
|
78
|
+
curl -X PUT http://localhost:11111/api/v1/camera/0/startexposure \
|
|
79
|
+
-d "Duration=5.0&Light=true"
|
|
80
|
+
|
|
81
|
+
# Check if dome is at home
|
|
82
|
+
curl http://localhost:11111/api/v1/dome/0/athome
|
|
83
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "uv_build"
|
|
3
|
+
requires = ["uv_build>=0.8.14,<0.9.0"]
|
|
4
|
+
|
|
5
|
+
[dependency-groups]
|
|
6
|
+
dev = [
|
|
7
|
+
"ruff",
|
|
8
|
+
"pre-commit",
|
|
9
|
+
"pytest",
|
|
10
|
+
"httpx"
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[project]
|
|
14
|
+
authors = [
|
|
15
|
+
{name = "Peter Pedersen"},
|
|
16
|
+
{name = "David Degen"}
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"fastapi",
|
|
20
|
+
"uvicorn",
|
|
21
|
+
"pyyaml",
|
|
22
|
+
"cabaret",
|
|
23
|
+
"jinja2",
|
|
24
|
+
"python-multipart"
|
|
25
|
+
]
|
|
26
|
+
description = "Python based ASCOM Alpaca simulators for Observatory Control Software testing"
|
|
27
|
+
keywords = ["astronomy", "astrophysics", "telescope"]
|
|
28
|
+
license = "MIT"
|
|
29
|
+
name = "alpaca-simulators"
|
|
30
|
+
readme = "README.md"
|
|
31
|
+
requires-python = ">=3.10"
|
|
32
|
+
version = "1.0.0"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
test = ["pytest", "httpx"]
|
|
36
|
+
|
|
37
|
+
[project.scripts]
|
|
38
|
+
alpaca-simulators = "alpaca_simulators.run_simulator:main"
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
"Bug Tracker" = "https://github.com/ppp-one/alpaca-simulators/issues"
|
|
42
|
+
Homepage = "https://github.com/ppp-one/alpaca-simulators"
|
|
43
|
+
Source = "https://github.com/ppp-one/alpaca-simulators"
|
|
44
|
+
|
|
45
|
+
[tool.ruff]
|
|
46
|
+
exclude = ["uv.lock", "*.yaml"]
|
|
47
|
+
extend-include = ["*.ipynb"]
|
|
48
|
+
line-length = 99
|
|
49
|
+
|
|
50
|
+
[tool.ruff.lint]
|
|
51
|
+
fixable = ["ALL"]
|
|
52
|
+
select = ["E", "F", "I001", "UP"]
|
|
53
|
+
|
|
54
|
+
[tool.uv.build-backend]
|
|
55
|
+
data = [
|
|
56
|
+
"src/alpaca_simulators/config/"
|
|
57
|
+
]
|
|
58
|
+
module-name = "alpaca_simulators"
|
|
59
|
+
source-include = ["src/alpaca_simulators/config/default.yaml"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# API package init file
|