# volcanotech-sw/pycampermanent architecture

> Architecture diagram of the GitHub repository volcanotech-sw/pycampermanent, 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/volcanotech-sw/pycampermanent
- Repository: https://github.com/volcanotech-sw/pycampermanent

## Overview

##### Main System Components

a) Core System Components:
- GUI Layer (/pycam/gui/)
- Controllers Layer (/pycam/controllers.py)
- Data Processing Layer (/pycam/doas/, /pycam/so2_camera_processor.py)
- Hardware Interface Layer (/pycam/scripts/)
- Networking Layer (/pycam/networking/)
- Storage Layer (/pycam/Data/)

b) External Components:
- Camera Hardware
- Spectrometer
- Cloud Storage (Dropbox/Google Drive)
- Remote Control Systems

##### Component Relationships

**[User Interface Layer]**
- ↕
**[Controllers Layer]**
- ↕
**┌─────────────────────┐**
- Processing Pipeline │
- ┘
- ↙     ↓      ↘
**[DOAS] [Camera] [iFit]**
- ↘     ↓      ↙
**[Hardware Interface Layer]**
- ↕
**[Physical Devices]**

##### Specific Implementation Details

a) Data Flow Paths:
- Image acquisition path
- Spectral data processing path
- Results storage path
- Cloud upload path

b) Key Processing Components:
- DOAS processing module
- SO2 camera processor
- iFit processing system
- Image calibration system

c) Configuration Management:
- How /pycam/conf/ affects various components
- Where configuration files are loaded

##### Important Architectural Patterns

- Worker Pattern (doas_worker.py, spec_worker.py)
- MVC-like structure (controllers.py, gui/, processing modules)
- Plugin architecture for different hardware interfaces

##### Integration Points

- Cloud service integration (Dropbox/Google Drive)
- Remote control interfaces
- Data storage systems
- Hardware communication protocols

**┌─────────── Main Application ──────────┐**
- ┌─────────┐ ┌─────────┐ ┌─────────┐  │
- GUI   │ │  DOAS  │ │ Camera  │  │
- ┘ └─────────┘ └─────────┘  │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef hardware fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef network fill:#9b59b6,stroke:#8e44ad,color:white
    classDef storage fill:#e74c3c,stroke:#c0392b,color:white
    classDef config fill:#1abc9c,stroke:#16a085,color:white

    %% Main Components
    UI[GUI Interface]:::ui
    CTRL[Controllers]:::ui
    CONF[Configuration Management]:::config
    
    subgraph ProcessingLayer[Processing Pipeline]
        DOAS[DOAS Processing]:::processing
        CAM_PROC[SO2 Camera Processor]:::processing
        IFIT[iFit Processing]:::processing
        
        subgraph Workers[Worker Components]
            DOAS_W[DOAS Worker]:::processing
            SPEC_W[Spectrometer Worker]:::processing
            IFIT_W[iFit Worker]:::processing
        end
    end
    
    subgraph HardwareInterface[Hardware Interface Layer]
        CAM_CTRL[Camera Control]:::hardware
        SPEC_CTRL[Spectrometer Control]:::hardware
    end
    
    subgraph NetworkStorage[Network & Storage]
        REMOTE[Remote Control Interface]:::network
        CLOUD[Cloud Integration]:::network
        STORAGE[Data Storage]:::storage
    end
    
    subgraph ExternalDevices[External Hardware]
        CAMERA[Camera Hardware]:::external
        SPEC[Spectrometer]:::external
        CLOUD_SERV[Cloud Services]:::external
    end

    %% Relationships
    UI --> CTRL
    CTRL --> ProcessingLayer
    CONF --> ProcessingLayer
    CONF --> HardwareInterface
    
    DOAS --> DOAS_W
    DOAS --> SPEC_W
    IFIT --> IFIT_W
    
    DOAS_W --> CAM_CTRL
    SPEC_W --> SPEC_CTRL
    CAM_PROC --> CAM_CTRL
    
    CAM_CTRL --> CAMERA
    SPEC_CTRL --> SPEC
    
    ProcessingLayer --> STORAGE
    STORAGE --> CLOUD
    CLOUD --> CLOUD_SERV
    REMOTE --> CTRL

    %% Click Events
    click UI "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/gui/"
    click CTRL "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/controllers.py"
    click DOAS "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/doas/"
    click CAM_PROC "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/so2_camera_processor.py"
    click IFIT "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/ifit_ld/"
    click CONF "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/conf/"
    click CLOUD "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/scripts/clouduploaders/"
    click STORAGE "https://github.com/volcanotech-sw/PyCamPermanent/tree/master//pycam/Data/"
    click DOAS_W "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/doas/doas_worker.py"
    click SPEC_W "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/doas/spec_worker.py"
    click IFIT_W "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/doas/ifit_worker.py"
    click CAM_CTRL "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/scripts/pycam_camera.py"
    click SPEC_CTRL "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/scripts/pycam_spectrometer.py"
    click REMOTE "https://github.com/volcanotech-sw/PyCamPermanent/blob/master//pycam/networking/commands.py"

    %% Legend
    subgraph Legend
        UI_L[User Interface]:::ui
        PROC_L[Processing]:::processing
        HW_L[Hardware Interface]:::hardware
        EXT_L[External Systems]:::external
        NET_L[Network Components]:::network
        STORE_L[Storage]:::storage
        CONF_L[Configuration]:::config
    end
```
