# suchismitasarker/qm2-detailed-dataanalysis architecture

> Architecture diagram of the GitHub repository suchismitasarker/qm2-detailed-dataanalysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suchismitasarker/qm2-detailed-dataanalysis
- Repository: https://github.com/suchismitasarker/qm2-detailed-dataanalysis

## Overview

QM2 Unified Data Analysis App is a single-file Flask application for browsing and analyzing CHESS X-ray scattering/diffraction data. The principal workflow is a browser request routed to an analysis view, which reads scan, NeXus, or detector-image data and presents plots or exports. The README documents the app’s major routes and integrations, but app.py was not included among the sampled source excerpts; component boundaries and internal call relationships therefore remain unverified.

Main entry points: [`app.py`](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask application<br/>[app.py]"]
  node_browse["Browse and help<br/>[app.py]"]
  node_sample["Sample search<br/>[app.py]"]
end

subgraph group_scans["Scan analysis"]
  node_scanplot["Scan plotting<br/>[app.py]"]
  node_scanexport["Scan CSV export<br/>[app.py]"]
  node_tempselect["Temperature selection<br/>[app.py]"]
  node_tempplot["Temperature plotting<br/>[app.py]"]
  node_tempcompare["Dataset comparison<br/>[app.py]"]
  node_tempexport["Temperature exports<br/>[app.py]"]
end

subgraph group_nexus["NeXus analysis"]
  node_nxprocess["NXprocess tools<br/>[app.py]"]
  node_slices["Slice analysis<br/>[app.py]"]
  node_thinfilm["Thin-film view<br/>[app.py]"]
  node_orderpar["Order-parameter view<br/>[app.py]"]
  node_lattice["Lattice view<br/>[app.py]"]
  node_linecut["1D linecut view<br/>[app.py]"]
  node_sliceexport["Slice exports<br/>[app.py]"]
end

subgraph group_detector["Detector analysis"]
  node_pyfai["Azimuthal integration<br/>[app.py]"]
end

node_user(("Browser user"))
node_scanfiles[("Scan data files")]
node_nexusfiles[("NeXus data files")]
node_imagefiles[("Detector images")]
node_pyfailibs["fabio / pyFAI"]

node_user -->|"requests pages"| node_app
node_app -->|"serves routes"| node_browse
node_app -->|"serves search"| node_sample
node_app -->|"serves plotting"| node_scanplot
node_app -->|"serves export"| node_scanexport
node_app -->|"serves selection"| node_tempselect
node_app -->|"serves plotting"| node_tempplot
node_app -->|"serves comparison"| node_tempcompare
node_app -->|"serves exports"| node_tempexport
node_app -->|"serves tools"| node_nxprocess
node_app -->|"serves analysis"| node_slices
node_app -->|"serves integration"| node_pyfai
node_scanplot -->|"reads scans"| node_scanfiles
node_scanexport -->|"exports data"| node_scanfiles
node_tempplot -->|"plots scan data"| node_scanfiles
node_tempcompare -->|"compares datasets"| node_scanfiles
node_sample -->|"searches samples"| node_scanfiles
node_slices -->|"offers view"| node_thinfilm
node_slices -->|"offers view"| node_orderpar
node_slices -->|"offers view"| node_lattice
node_slices -->|"offers view"| node_linecut
node_thinfilm -->|"analyzes slices"| node_nexusfiles
node_orderpar -->|"analyzes slices"| node_nexusfiles
node_lattice -->|"analyzes slices"| node_nexusfiles
node_linecut -->|"analyzes slices"| node_nexusfiles
node_slices -->|"provides exports"| node_sliceexport
node_pyfai -->|"integrates images"| node_imagefiles
node_pyfai -->|"uses libraries"| node_pyfailibs

click node_app "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_browse "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_sample "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_scanplot "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_scanexport "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_tempselect "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_tempplot "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_tempcompare "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_tempexport "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_nxprocess "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_slices "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_thinfilm "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_orderpar "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_lattice "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_linecut "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_sliceexport "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"
click node_pyfai "https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_browse,node_sample,node_user toneBlue
class node_scanplot,node_scanexport,node_tempselect,node_tempplot,node_tempcompare,node_tempexport,node_scanfiles,node_nexusfiles,node_imagefiles toneAmber
class node_nxprocess,node_slices,node_thinfilm,node_orderpar,node_lattice,node_linecut,node_sliceexport toneMint
class node_pyfai toneRose
class node_pyfailibs toneIndigo
```

## Components

### Web application

- [Flask application](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Browse and help](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Sample search](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`

### Scan analysis

- [Scan plotting](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Scan CSV export](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Temperature selection](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Temperature plotting](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Dataset comparison](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Temperature exports](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`

### NeXus analysis

- [NXprocess tools](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Slice analysis](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Thin-film view](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Order-parameter view](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Lattice view](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [1D linecut view](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`
- [Slice exports](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`

### Detector analysis

- [Azimuthal integration](https://github.com/suchismitasarker/qm2-detailed-dataanalysis/blob/main/app.py): `app.py`

### Other components

- **Browser user**
- **Scan data files**
- **NeXus data files**
- **Detector images**
- **fabio / pyFAI**

## Connections

- Browser user → Flask application: requests pages (evidence: `README.md`)
- Flask application → Browse and help: serves routes (evidence: `README.md`)
- Flask application → Sample search: serves search (evidence: `README.md`)
- Flask application → Scan plotting: serves plotting (evidence: `README.md`)
- Flask application → Scan CSV export: serves export (evidence: `README.md`)
- Flask application → Temperature selection: serves selection (evidence: `README.md`)
- Flask application → Temperature plotting: serves plotting (evidence: `README.md`)
- Flask application → Dataset comparison: serves comparison (evidence: `README.md`)
- Flask application → Temperature exports: serves exports (evidence: `README.md`)
- Flask application → NXprocess tools: serves tools (evidence: `README.md`)
- Flask application → Slice analysis: serves analysis (evidence: `README.md`)
- Flask application → Azimuthal integration: serves integration (evidence: `README.md`)
- Scan plotting → Scan data files: reads scans (evidence: `README.md`)
- Scan CSV export → Scan data files: exports data (evidence: `README.md`)
- Temperature plotting → Scan data files: plots scan data (evidence: `README.md`)
- Dataset comparison → Scan data files: compares datasets (evidence: `README.md`)
- Sample search → Scan data files: searches samples (evidence: `README.md`)
- Slice analysis → Thin-film view: offers view (evidence: `README.md`)
- Slice analysis → Order-parameter view: offers view (evidence: `README.md`)
- Slice analysis → Lattice view: offers view (evidence: `README.md`)
- Slice analysis → 1D linecut view: offers view (evidence: `README.md`)
- Thin-film view → NeXus data files: analyzes slices (evidence: `README.md`)
- Order-parameter view → NeXus data files: analyzes slices (evidence: `README.md`)
- Lattice view → NeXus data files: analyzes slices (evidence: `README.md`)
- 1D linecut view → NeXus data files: analyzes slices (evidence: `README.md`)
- Slice analysis → Slice exports: provides exports (evidence: `README.md`)
- Azimuthal integration → Detector images: integrates images (evidence: `README.md`)
- Azimuthal integration → fabio / pyFAI: uses libraries (evidence: `README.md`)
