# darshvn/radis architecture

> Architecture diagram of the GitHub repository darshvn/radis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darshvn/radis
- Repository: https://github.com/darshvn/radis

## Overview

##### Main Components Identification

The system can be broken down into these major components:

a) Core Calculation Engine:
- Line-by-line (LBL) module (/radis/lbl/)
- GPU acceleration module (/radis/gpu/)
- Physical calculations module (/radis/phys/)

b) Database Management:
- Database interfaces (/radis/api/)
- I/O handlers (/radis/io/)
- Local database storage (/radis/db/)

c) Spectrum Processing:
- Spectrum operations (/radis/spectrum/)
- Line-of-sight calculations (/radis/los/)
- Tools and utilities (/radis/tools/)

**[External Databases Layer]**
**HITRAN | HITEMP | ExoMol | GEISA | Kurucz**
- ↓
**[Database Interface Layer]**
**API Handlers | Database Manager | Cache System**
- ↓
**[Core Computation Layer]**
**LBL Calculator | GPU Accelerator | Physical Models**
- ↓
**[Spectrum Processing Layer]**
**Spectrum Operations | Post-processing | Comparison Tools**
- ↓
**[Output Layer]**
**Visualization | Export | Analysis**

##### Key Relationships to Highlight

a) Data Flow:
- Database fetching → Line-by-line calculations → Spectrum generation
- GPU acceleration parallel path for performance
- Post-processing operations on spectra

b) Integration Points:
- Database API interfaces
- GPU/CPU computation switching
- Experimental data comparison

##### Additional Details

- Version information
- Supported molecular species
- Supported temperature ranges
- Performance characteristics

##### Notes for Implementation

- Use consistent spacing and alignment
- Related components together
- Clear labels for all components
- Brief descriptions for main modules

The emphasis should be on showing how RADIS handles the complete workflow from database access through computation to final spectrum generation and analysis, with special attention to its high-performance computing capabilities and modular design.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef database fill:#3498db,stroke:#2980b9,color:white
    classDef computation fill:#e74c3c,stroke:#c0392b,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef io fill:#f1c40f,stroke:#f39c12,color:black

    %% External Databases Layer
    subgraph ExternalDB
        HITRAN["HITRAN"]:::database
        HITEMP["HITEMP"]:::database
        ExoMol["ExoMol"]:::database
        GEISA["GEISA"]:::database
        Kurucz["Kurucz"]:::database
    end

    %% Database Interface Layer
    subgraph DBInterface
        HITRANApi["HITRAN API"]:::database
        HITEMPApi["HITEMP API"]:::database
        ExoMolApi["ExoMol API"]:::database
        GEISAApi["GEISA API"]:::database
        KuruczApi["Kurucz API"]:::database
        DBManager["Database Manager"]:::database
        Cache["Cache System"]:::database
    end

    %% Core Computation Layer
    subgraph Computation
        LBLCalc["Line-by-line Calculator"]:::computation
        GPUAccel["GPU Accelerator"]:::computation
        CUDA["CUDA Implementation"]:::computation
        PhysModels["Physical Models"]:::computation
    end

    %% Spectrum Processing Layer
    subgraph Processing
        SpecOps["Spectrum Operations"]:::processing
        LOSCalc["Line-of-sight Calculator"]:::processing
        SpecProc["Spectrum Processing"]:::processing
        CompTools["Comparison Tools"]:::processing
    end

    %% Output Layer
    subgraph Output
        IOHandlers["I/O Handlers"]:::io
        LocalDB["Local Database"]:::io
        Config["Configuration Management"]:::io
    end

    %% Relationships
    HITRAN --> HITRANApi
    HITEMP --> HITEMPApi
    ExoMol --> ExoMolApi
    GEISA --> GEISAApi
    Kurucz --> KuruczApi

    HITRANApi & HITEMPApi & ExoMolApi & GEISAApi & KuruczApi --> DBManager
    DBManager --> Cache
    Cache --> LBLCalc
    
    LBLCalc --> GPUAccel
    GPUAccel --> CUDA
    PhysModels --> LBLCalc
    
    LBLCalc --> SpecOps
    SpecOps --> LOSCalc
    SpecOps --> SpecProc
    SpecProc --> CompTools
    
    CompTools & SpecProc --> IOHandlers
    IOHandlers --> LocalDB
    Config -.-> LBLCalc
    Config -.-> GPUAccel
    Config -.-> SpecOps

    %% Click Events
    click LBLCalc "https://github.com/darshvn/radis/blob/develop/radis/lbl/calc.py"
    click GPUAccel "https://github.com/darshvn/radis/blob/develop/radis/gpu/gpu.py"
    click PhysModels "https://github.com/darshvn/radis/tree/develop/radis/phys/"
    click HITRANApi "https://github.com/darshvn/radis/blob/develop/radis/api/hitranapi.py"
    click HITEMPApi "https://github.com/darshvn/radis/blob/develop/radis/api/hitempapi.py"
    click ExoMolApi "https://github.com/darshvn/radis/blob/develop/radis/api/exomolapi.py"
    click GEISAApi "https://github.com/darshvn/radis/blob/develop/radis/api/geisaapi.py"
    click KuruczApi "https://github.com/darshvn/radis/blob/develop/radis/api/kuruczapi.py"
    click IOHandlers "https://github.com/darshvn/radis/tree/develop/radis/io/"
    click LocalDB "https://github.com/darshvn/radis/tree/develop/radis/db/"
    click SpecOps "https://github.com/darshvn/radis/blob/develop/radis/spectrum/spectrum.py"
    click LOSCalc "https://github.com/darshvn/radis/blob/develop/radis/los/slabs.py"
    click DBManager "https://github.com/darshvn/radis/blob/develop/radis/api/dbmanager.py"
    click CompTools "https://github.com/darshvn/radis/blob/develop/radis/spectrum/compare.py"
    click Cache "https://github.com/darshvn/radis/blob/develop/radis/api/cache_files.py"
    click SpecProc "https://github.com/darshvn/radis/blob/develop/radis/spectrum/operations.py"
    click CUDA "https://github.com/darshvn/radis/tree/develop/radis/gpu/cuda/"
    click Config "https://github.com/darshvn/radis/blob/develop/radis/misc/config.py"
```
