# astrohuntsman/huntsman-pocs architecture

> Architecture diagram of the GitHub repository astrohuntsman/huntsman-pocs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/astrohuntsman/huntsman-pocs
- Repository: https://github.com/astrohuntsman/huntsman-pocs

## Overview

##### Main System Components

a. Hardware Control Layer
- Camera Systems (src/huntsman/pocs/camera/)
- Mount Control (src/huntsman/pocs/mount/)
- Dome Control (src/huntsman/pocs/dome/)
- Focus Control (src/huntsman/pocs/focuser/)
- Filter Wheel (src/huntsman/pocs/filterwheel/)
- Guide System (src/huntsman/pocs/guide/)

b. Core Control Layer
- Observatory Control (src/huntsman/pocs/observatory.py)
- State Machine (src/huntsman/pocs/states/huntsman/)
- Scheduler (src/huntsman/pocs/scheduler/)

c. Support Systems
- Archive System (src/huntsman/pocs/archive/)
- Weather Monitoring (src/huntsman/pocs/utils/weather.py)
- Safety Systems (src/huntsman/pocs/utils/safety.py)

##### Architecture Representation

a. Use a layered architecture approach:
**[Support Systems Layer]**
- ↕
**[Core Control Layer]**
- ↕
**[Hardware Control Layer]**
- ↕
**[Physical Hardware]**

b. Component Relationships:
- Observatory class as the central coordinator
- Distributed nature of the system using Pyro (Remote Objects)

##### Technical Details

- Hardware Controllers (Blue)
- Core Control Systems (Green)
- Support Services (Yellow)
- External Interfaces (Gray)

- Camera interfaces
- Mount control systems
- Weather monitoring
- Data storage
- Network communications

##### Implementation Notes

- The modular design allowing different hardware implementations
- The state-based control flow
- The distributed nature of the system
- Safety and monitoring systems integration

##### Specific Component Relationships

Key interactions:
**Observatory Controller**
- ↓
**State Machine → Scheduler**
- ↓
**Hardware Controllers (Camera, Mount, Dome, etc.)**
- ↓
**Physical Hardware**

##### Additional Elements

Include:
- Configuration management
- Error handling paths
- Data archiving flow
- Weather monitoring feedback loops
- Safety system override paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef hardware fill:#b3d9ff,stroke:#333
    classDef core fill:#90EE90,stroke:#333
    classDef support fill:#FFE5B4,stroke:#333
    classDef physical fill:#D3D3D3,stroke:#333

    %% Support Systems Layer
    subgraph SupportLayer
        Archive["Archive System"]:::support
        Weather["Weather Monitoring"]:::support
        Safety["Safety Systems"]:::support
    end

    %% Core Control Layer
    subgraph CoreLayer
        Observatory["Observatory Control"]:::core
        StateMachine["State Machine"]:::core
        Scheduler["Scheduler"]:::core
    end

    %% Hardware Control Layer
    subgraph HardwareLayer
        Camera["Camera Systems"]:::hardware
        Mount["Mount Control"]:::hardware
        Dome["Dome Control"]:::hardware
        Focus["Focus Control"]:::hardware
        Filter["Filter Wheel"]:::hardware
        Guide["Guide System"]:::hardware
    end

    %% Physical Hardware Layer
    subgraph PhysicalLayer
        PhysicalHW["Physical Hardware"]:::physical
    end

    %% Relationships
    Observatory --> StateMachine
    StateMachine --> Scheduler
    Scheduler --> Camera & Mount & Dome & Focus & Filter & Guide
    
    Weather --> Safety
    Safety --> Observatory
    Observatory --> Archive
    
    Camera & Mount & Dome & Focus & Filter & Guide --> PhysicalHW

    %% Click events
    click Camera "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/camera/"
    click Mount "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/mount/"
    click Dome "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/dome/"
    click Focus "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/focuser/"
    click Filter "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/filterwheel/"
    click Guide "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/guide/"
    click Observatory "https://github.com/AstroHuntsman/huntsman-pocs/blob/develop/src/huntsman/pocs/observatory.py"
    click StateMachine "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/states/huntsman/"
    click Scheduler "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/scheduler/"
    click Archive "https://github.com/AstroHuntsman/huntsman-pocs/tree/develop/src/huntsman/pocs/archive/"
    click Weather "https://github.com/AstroHuntsman/huntsman-pocs/blob/develop/src/huntsman/pocs/utils/weather.py"
    click Safety "https://github.com/AstroHuntsman/huntsman-pocs/blob/develop/src/huntsman/pocs/utils/safety.py"

    %% Legend
    subgraph Legend
        HardwareLegend["Hardware Controllers"]:::hardware
        CoreLegend["Core Systems"]:::core
        SupportLegend["Support Services"]:::support
        PhysicalLegend["Physical Hardware"]:::physical
    end
```
