# thaza-kun/sarjana architecture

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

- Interactive diagram: https://gitdiagram.com/thaza-kun/sarjana
- Repository: https://github.com/thaza-kun/sarjana

## Overview

##### Main Components Identification

a) Core Processing Components:
- Rust-based computation engine (userust directory)
- Python analysis scripts (bin directory)
- CHIME FRB specific tools (subpackages/chimefrb)
- PRESTO integration (subpackages/use-presto)

b) Data Processing Pipeline Components:
- Periodogram analysis
- Ensemble processing
- Exposure calculation
- Phase folding
- Diagnostic tools

##### Specific Implementation Details

a) Core Processing Pipeline:
**Raw Data → Exposure Calculation → Periodogram Analysis → Ensemble Processing → Visualization**

b) Integration Points:
- How the Rust library (userust) interfaces with Python
- PRESTO tool integration
- CHIME FRB data flow

c) Key Features:
- Periodogram generation process
- Ensemble analysis workflow
- Diagnostic tool chain

##### Technical Details

Annotations for:
- Programming languages used (Rust, Python)
- Key libraries and dependencies
- Data formats and interfaces
- Processing algorithms (e.g., harmonic sum, phase folding)

- Data Sources  | --> | Core Processing | --> |    Analysis    |
- FRB data    |     | - Rust engine   |     | - Periodograms |
- Exposures   |     | - Python tools  |     | - Diagnostics  |

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        RawData["Raw FRB Data"]:::input
        ExpData["Exposure Data"]:::input
        Config["Configuration Files"]:::input
    end

    subgraph Core["Core Processing Layer"]
        RustEngine["Rust Computation Engine"]:::rust
        PythonScripts["Python Analysis Scripts"]:::python
        PRESTO["PRESTO Integration"]:::external
        CHIME["CHIME FRB Tools"]:::external
    end

    subgraph Processing["Processing Pipeline"]
        ExpCalc["Exposure Calculation"]:::process
        PeriodAnalysis["Periodogram Analysis"]:::process
        EnsembleProc["Ensemble Processing"]:::process
        PhaseFold["Phase Folding"]:::process
        HarmonicSum["Harmonic Sum Analysis"]:::process
        TransientAnalysis["Transient Analysis"]:::process
    end

    subgraph Output["Analysis Output"]
        Periodograms["Periodograms"]:::output
        Diagnostics["Diagnostics"]:::output
        Results["Analysis Results"]:::output
    end

    %% Data Flow
    RawData --> RustEngine
    ExpData --> ExpCalc
    Config --> Core

    RustEngine --> PeriodAnalysis
    RustEngine --> TransientAnalysis
    PythonScripts --> EnsembleProc
    PRESTO --> PeriodAnalysis
    CHIME --> HarmonicSum

    ExpCalc --> Processing
    PeriodAnalysis --> EnsembleProc
    EnsembleProc --> PhaseFold
    HarmonicSum --> Results
    TransientAnalysis --> Results

    PeriodAnalysis --> Periodograms
    PhaseFold --> Diagnostics
    EnsembleProc --> Results

    %% Click Events
    click RustEngine "https://github.com/Thaza-Kun/sarjana/blob/master/userust/src/lib.rs"
    click PythonScripts "https://github.com/Thaza-Kun/sarjana/tree/master/bin/"
    click CHIME "https://github.com/Thaza-Kun/sarjana/tree/master/subpackages/chimefrb/"
    click PRESTO "https://github.com/Thaza-Kun/sarjana/tree/master/subpackages/use-presto/"
    click PeriodAnalysis "https://github.com/Thaza-Kun/sarjana/blob/master/userust/src/periodogram.rs"
    click EnsembleProc "https://github.com/Thaza-Kun/sarjana/tree/master/userust/python/scripts/ensemble/"
    click ExpCalc "https://github.com/Thaza-Kun/sarjana/blob/master/userust/src/exposure.rs"
    click PhaseFold "https://github.com/Thaza-Kun/sarjana/blob/master/userust/python/scripts/diagnostics/phasefold.py"
    click Diagnostics "https://github.com/Thaza-Kun/sarjana/tree/master/userust/python/scripts/diagnostics/"
    click TransientAnalysis "https://github.com/Thaza-Kun/sarjana/tree/master/userust/src/transient/"
    click HarmonicSum "https://github.com/Thaza-Kun/sarjana/blob/master/subpackages/chimefrb/bin/harmonic_sum.py"

    %% Styling
    classDef input fill:#FFE5CC,stroke:#333,stroke-width:2px
    classDef rust fill:#B8D0E8,stroke:#333,stroke-width:2px
    classDef python fill:#98FB98,stroke:#333,stroke-width:2px
    classDef external fill:#FFA07A,stroke:#333,stroke-width:2px
    classDef process fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef output fill:#F0E68C,stroke:#333,stroke-width:2px
```
