# fuji-astronomy-club-coders/sun_watching architecture

> Architecture diagram of the GitHub repository fuji-astronomy-club-coders/sun_watching, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fuji-astronomy-club-coders/sun_watching
- Repository: https://github.com/fuji-astronomy-club-coders/sun_watching

## Overview

SUN Find West is a live solar-position and west-angle tracking application. Its main workflow validates YAML configuration, initializes a physical or video-backed camera, captures frames, estimates the solar disk and its motion, and presents alignment feedback; the main module also documents result saving. The sampled sources show the entry-point handoff and core analysis calls. The Matplotlib drawer is a distinct substantial visualization component, but its connection to the live workflow is not established by the excerpts.

Main entry points: [`sun_find_west_v2/main.py`](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py) (Tracking App), [`run.py`](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/run.py) (CLI Launcher), [`sun_find_west_v2/config/loader.py`](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/loader.py) (Config Loader), [`sun_find_west_v2/camera/controller.py`](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/camera/controller.py) (Camera Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup &amp; Config"]
  node_launcher["CLI Launcher<br/>[run.py]"]
  node_config_loader["Config Loader<br/>[loader.py]"]
  node_config_yaml["YAML Settings<br/>[config.yaml]"]
  node_config_schema["Config Schema<br/>[config_schema.json]"]
end

subgraph group_capture["Camera &amp; Capture"]
  node_app["Tracking App<br/>[main.py]"]
  node_camera_controller["Camera Controller<br/>[controller.py]"]
  node_dummy_camera["Video Camera<br/>[vid_dummy.py]"]
  node_frame_conversion["Frame Conversion<br/>[main.py]"]
end

subgraph group_analysis["Solar Analysis"]
  node_disk_estimator["Solar Disk Estimator<br/>[MIN2ver2.py]"]
  node_motion_estimator["Robust Motion Estimator<br/>[RANSAC.py]"]
end

subgraph group_presentation["Visualization &amp; Results"]
  node_qt_dashboard["Qt Dashboard<br/>[qt_visualizer.py]"]
  node_matplotlib_drawer["Matplotlib Drawer<br/>[drawer.py]"]
  node_result_files[("Saved Results<br/>[main.py]")]
end

node_operator(("Operator"))
node_asi_camera["ASI Camera"]

node_operator -->|"starts"| node_launcher
node_launcher -->|"loads config"| node_config_loader
node_config_loader -->|"reads settings"| node_config_yaml
node_config_loader -->|"validates against"| node_config_schema
node_launcher -->|"starts with config"| node_app
node_app -->|"connects camera"| node_camera_controller
node_camera_controller -->|"selects video mode"| node_dummy_camera
node_camera_controller -->|"initializes SDK"| node_asi_camera
node_app -->|"converts frames"| node_frame_conversion
node_app -->|"estimates disk"| node_disk_estimator
node_app -->|"estimates motion"| node_motion_estimator
node_app -->|"updates dashboard"| node_qt_dashboard
node_app -->|"saves results"| node_result_files

click node_launcher "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/run.py"
click node_config_loader "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/loader.py"
click node_config_yaml "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/config.yaml"
click node_config_schema "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/config_schema.json"
click node_app "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py"
click node_camera_controller "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/camera/controller.py"
click node_dummy_camera "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/camera/vid_dummy.py"
click node_frame_conversion "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py"
click node_disk_estimator "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/MIN2ver2.py"
click node_motion_estimator "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/RANSAC.py"
click node_qt_dashboard "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/qt_visualizer.py"
click node_matplotlib_drawer "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/drawer.py"
click node_result_files "https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_config_loader,node_config_yaml,node_config_schema toneBlue
class node_app,node_camera_controller,node_dummy_camera,node_frame_conversion toneAmber
class node_disk_estimator,node_motion_estimator toneMint
class node_qt_dashboard,node_matplotlib_drawer,node_result_files toneRose
class node_operator,node_asi_camera toneIndigo
```

## Components

### Startup & Config

- [CLI Launcher](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/run.py): `run.py`
- [Config Loader](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/loader.py): `sun_find_west_v2/config/loader.py`
- [YAML Settings](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/config.yaml): `sun_find_west_v2/config/config.yaml`
- [Config Schema](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/config/config_schema.json): `sun_find_west_v2/config/config_schema.json`

### Camera & Capture

- [Tracking App](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py): `sun_find_west_v2/main.py`
- [Camera Controller](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/camera/controller.py): `sun_find_west_v2/camera/controller.py`
- [Video Camera](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/camera/vid_dummy.py): `sun_find_west_v2/camera/vid_dummy.py`
- [Frame Conversion](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py): `sun_find_west_v2/main.py`

### Solar Analysis

- [Solar Disk Estimator](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/MIN2ver2.py): `sun_find_west_v2/core/MIN2ver2.py`
- [Robust Motion Estimator](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/RANSAC.py): `sun_find_west_v2/core/RANSAC.py`

### Visualization & Results

- [Qt Dashboard](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/qt_visualizer.py): `sun_find_west_v2/qt_visualizer.py`
- [Matplotlib Drawer](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/core/drawer.py): `sun_find_west_v2/core/drawer.py`
- [Saved Results](https://github.com/fuji-astronomy-club-coders/sun_watching/blob/sun_find_west_v2/sun_find_west_v2/main.py): `sun_find_west_v2/main.py`

### Other components

- **Operator**
- **ASI Camera**

## Connections

- Operator → CLI Launcher: starts (evidence: `run.py`)
- CLI Launcher → Config Loader: loads config (evidence: `run.py`)
- Config Loader → YAML Settings: reads settings (evidence: `sun_find_west_v2/config/loader.py`)
- Config Loader → Config Schema: validates against (evidence: `sun_find_west_v2/config/loader.py`)
- CLI Launcher → Tracking App: starts with config (evidence: `run.py`)
- Tracking App → Camera Controller: connects camera (evidence: `sun_find_west_v2/main.py`)
- Camera Controller → Video Camera: selects video mode (evidence: `sun_find_west_v2/camera/controller.py`)
- Camera Controller → ASI Camera: initializes SDK (evidence: `sun_find_west_v2/camera/controller.py`)
- Tracking App → Frame Conversion: converts frames (evidence: `sun_find_west_v2/main.py`)
- Tracking App → Solar Disk Estimator: estimates disk (evidence: `sun_find_west_v2/main.py`)
- Tracking App → Robust Motion Estimator: estimates motion (evidence: `sun_find_west_v2/main.py`)
- Tracking App → Qt Dashboard: updates dashboard (evidence: `sun_find_west_v2/main.py`)
- Tracking App → Saved Results: saves results (evidence: `sun_find_west_v2/main.py`)
