# ossian-malmborg/mnxb11-group3-project architecture

> Architecture diagram of the GitHub repository ossian-malmborg/mnxb11-group3-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ossian-malmborg/mnxb11-group3-project
- Repository: https://github.com/ossian-malmborg/mnxb11-group3-project

## Overview

##### Project type and purpose
- This is a scientific data‐analysis and visualization pipeline written in C++ and ROOT macros.
- It ingests raw CSV weather data for multiple stations (Falun, Falsterbo, Uppsala), cleans and processes it via command‐line C++ tools, then generates physics‐style plots in the ROOT framework.

##### File structure
Top level:
- C++ cleaning & analysis sources:
- cleaning_data_*.cxx (data cleansing per city)
- FalunVSFalsterbo.cxx (compute temperature difference)
- warmest_coldest.cxx (determine warmest/coldest days per year)
- temperature_given_day.cxx (per‐day extractor)
- ROOT plotting macros:
- FalunVSFalsterboPlot.C
- warmest_plot.C / plot_results.C
- Data:
- datasets/*.csv (raw inputs)
- Documentation:
- README.md, workplan.md, changelog.txt, LICENSE

##### README insights
- Describes the two analysis workflows (“FalunVSFalsterbo” and “Warmest_Coldest”)
- Shows build/run commands (g++ compile → executable → CSV output → ROOT .L macro → plot function)
- No service‐oriented architecture or external APIs—pure batch pipeline.

a. Main components
1. Raw Data Store
- datasets/*.csv
2. Data Cleaning Modules
- cleaning_data_Falun.cxx → clean_Falun.csv
- cleaning_data_Falsterbo.cxx → clean_Falsterbo.csv
- cleaning_data_Uppsala.cxx → clean_Uppsala.csv
3. Analysis Modules
- FalunVSFalsterbo.cxx → diff.csv
- warmest_coldest.cxx → warmest_coldest.csv
- temperature_given_day.cxx (optional extractor)
4. Visualization / Plotting
- FalunVSFalsterboPlot.C → PlotTemperatureDifference()
- warmest_plot.C → plot_results()
5. Tooling
- g++ (compiler)
- ROOT (plotting framework)

b. Relationships & data flow

c. Architectural patterns & design principles
- Linear batch‐pipeline: discrete stages, file‐based handoff
- Single responsibility per module: each .cxx does one transformation
- Convention over configuration: compile/run naming conventions
- Separation of concerns: cleaning vs analysis vs visualization

d. Key technologies & frameworks
- C++17 (g++)
- ROOT (CERN’s data‐analysis & plotting library)
- UNIX shell (compile & execute commands)
- CSV files as intermediate exchange format

##### Detail
- Branching: both Falun and Falsterbo cleaning feed into FalunVSFalsterbo analysis.
- Optional tools like temperature_given_day.cxx as side utilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Store"
        RawData["datasets/*.csv"]:::datastore
    end

    subgraph "Cleaning Stage"
        CFalun["cleaning_data_Falun.cxx"]:::processing
        CFlest["cleaning_data_Falsterbo.cxx"]:::processing
        CUpps["cleaning_data_Uppsala.cxx"]:::processing
    end

    subgraph "Analysis Stage"
        AFVsF["FalunVSFalsterbo.cxx"]:::processing
        AWCold["warmest_coldest.cxx"]:::processing
        ATGDay["temperature_given_day.cxx"]:::processing
    end

    subgraph "Visualization"
        VFVsF["FalunVSFalsterboPlot.C"]:::viz
        VWarm["warmest_plot.C"]:::viz
        VPlotRes["plot_results.C"]:::viz
    end

    subgraph "Tooling"
        GPP["g++"]:::tool
        ROOTF["ROOT"]:::tool
    end

    %% Data flow from raw data to cleaning
    RawData --> CFalun
    RawData --> CFlest
    RawData --> CUpps

    %% Compile step for cleaning
    GPP --> CFalun
    GPP --> CFlest
    GPP --> CUpps

    %% Cleaning output to analysis
    CFalun -->|"clean_Falun.csv"| AFVsF
    CFlest -->|"clean_Falsterbo.csv"| AFVsF
    CUpps -->|"clean_Uppsala.csv"| AWCold

    %% Compile step for analysis
    GPP --> AFVsF
    GPP --> AWCold
    GPP --> ATGDay

    %% Analysis to visualization
    AFVsF -->|"diff.csv"| VFVsF
    AWCold -->|"warmest_coldest.csv"| VWarm
    AWCold -->|"warmest_coldest.csv"| VPlotRes

    %% Optional utility
    RawData --> ATGDay

    %% ROOT loading for visualization
    ROOTF --> VFVsF
    ROOTF --> VWarm
    ROOTF --> VPlotRes

    %% Click Events
    click RawData "https://github.com/ossian-malmborg/mnxb11-group3-project/tree/main/datasets/"
    click CFalun "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/cleaning_data_Falun.cxx"
    click CFlest "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/cleaning_data_Falsterbo.cxx"
    click CUpps "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/cleaning_data_Uppsala.cxx"
    click AFVsF "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/FalunVSFalsterbo.cxx"
    click AWCold "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/warmest_coldest.cxx"
    click ATGDay "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/temperature_given_day.cxx"
    click VFVsF "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/FalunVSFalsterboPlot.C"
    click VWarm "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/warmest_plot.C"
    click VPlotRes "https://github.com/ossian-malmborg/mnxb11-group3-project/blob/main/plot_results.C"

    %% Styling
    classDef datastore fill:#BBE1FA,stroke:#333,stroke-width:1px;
    classDef processing fill:#B5E7A0,stroke:#333,stroke-width:1px;
    classDef viz fill:#FFCC80,stroke:#333,stroke-width:1px;
    classDef tool fill:#D3D3D3,stroke:#333,stroke-width:1px;
```
