# cea-metrocarac/raman_ampli architecture

> Architecture diagram of the GitHub repository cea-metrocarac/raman_ampli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cea-metrocarac/raman_ampli
- Repository: https://github.com/cea-metrocarac/raman_ampli

## Overview

Raman Amplification computes Raman intensity enhancement for ordered multilayer stacks. The main workflow accepts an Excel model (or a selected file), builds layers and a stack, evaluates enhancement while varying a chosen thickness, and writes a results workbook and chart. Python callers can also use the simulator directly; the documented non-Excel examples are included as a separate entry point. The graph shows the optical-factor calculation and material-index lookup as internal layers. Source excerpts establish the main call paths; unsampled example internals are not inferred.

Main entry points: [`raman_ampli/main.py`](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py) (Workbook processor), [`raman_ampli/layer.py`](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/layer.py) (Layer builder), [`raman_ampli/material.py`](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/material.py) (Material indices), [`raman_ampli/simulator.py`](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/simulator.py) (Enhancement simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Input and results"]
  node_input_workbook["Input workbook"]
  node_launcher["Launcher<br/>[main.py]"]
  node_file_picker["File picker<br/>[open_file.py]"]
  node_workbook_processor["Workbook processor<br/>[main.py]"]
  node_output_workbook["Results workbook<br/>[main.py]"]
  node_output_template["Output template<br/>[output_MODEL.xlsx]"]
  node_script_examples["Python examples"]
end

subgraph group_stack_model["Stack and materials"]
  node_layer_builder["Layer builder<br/>[layer.py]"]
  node_stack["Ordered stack<br/>[stack.py]"]
  node_material["Material indices<br/>[material.py]"]
  node_index_tables[("Index tables")]
end

subgraph group_optics["Optical simulation"]
  node_simulator["Enhancement simulator<br/>[simulator.py]"]
  node_optical_model["Optical factors<br/>[model.py]"]
  node_array_tools["Thickness discretization<br/>[array_def.py]"]
end

node_user(("User / caller"))

node_user -->|"runs"| node_launcher
node_launcher -->|"selects when unspecified"| node_file_picker
node_user -->|"provides"| node_input_workbook
node_launcher -->|"processes each file"| node_workbook_processor
node_workbook_processor -->|"reads"| node_input_workbook
node_workbook_processor -->|"creates layers"| node_layer_builder
node_workbook_processor -->|"appends layers"| node_stack
node_workbook_processor -->|"constructs"| node_simulator
node_workbook_processor -->|"copies template"| node_output_template
node_workbook_processor -->|"writes results and chart"| node_output_workbook
node_user -->|"uses without workbook"| node_script_examples
node_layer_builder -->|"constructs"| node_material
node_material -->|"loads index table"| node_index_tables
node_simulator -->|"calculates factors and intensity"| node_optical_model
node_optical_model -->|"discretizes thickness"| node_array_tools

click node_launcher "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py"
click node_file_picker "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/open_file.py"
click node_workbook_processor "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py"
click node_output_workbook "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py"
click node_output_template "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/assets/output_MODEL.xlsx"
click node_script_examples "https://github.com/cea-metrocarac/raman_ampli/tree/main/raman_ampli/examples"
click node_layer_builder "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/layer.py"
click node_stack "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/stack.py"
click node_material "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/material.py"
click node_index_tables "https://github.com/cea-metrocarac/raman_ampli/tree/main/raman_ampli/assets/data_indices"
click node_simulator "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/simulator.py"
click node_optical_model "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/model.py"
click node_array_tools "https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/array_def.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_input_workbook,node_launcher,node_file_picker,node_workbook_processor,node_output_workbook,node_output_template,node_script_examples,node_user toneBlue
class node_layer_builder,node_stack,node_material,node_index_tables toneAmber
class node_simulator,node_optical_model,node_array_tools toneMint
```

## Components

### Input and results

- **Input workbook**
- [Launcher](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py): `raman_ampli/main.py`
- [File picker](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/open_file.py): `raman_ampli/open_file.py`
- [Workbook processor](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py): `raman_ampli/main.py`
- [Results workbook](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/main.py): `raman_ampli/main.py`
- [Output template](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/assets/output_MODEL.xlsx): `raman_ampli/assets/output_MODEL.xlsx`
- [Python examples](https://github.com/cea-metrocarac/raman_ampli/tree/main/raman_ampli/examples): `raman_ampli/examples`

### Stack and materials

- [Layer builder](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/layer.py): `raman_ampli/layer.py`
- [Ordered stack](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/stack.py): `raman_ampli/stack.py`
- [Material indices](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/material.py): `raman_ampli/material.py`
- [Index tables](https://github.com/cea-metrocarac/raman_ampli/tree/main/raman_ampli/assets/data_indices): `raman_ampli/assets/data_indices`

### Optical simulation

- [Enhancement simulator](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/simulator.py): `raman_ampli/simulator.py`
- [Optical factors](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/model.py): `raman_ampli/model.py`
- [Thickness discretization](https://github.com/cea-metrocarac/raman_ampli/blob/main/raman_ampli/array_def.py): `raman_ampli/array_def.py`

### Other components

- **User / caller**

## Connections

- User / caller → Launcher: runs (evidence: `README.md`)
- Launcher → File picker: selects when unspecified (evidence: `raman_ampli/main.py`)
- User / caller → Input workbook: provides (evidence: `README.md`)
- Launcher → Workbook processor: processes each file (evidence: `raman_ampli/main.py`)
- Workbook processor → Input workbook: reads (evidence: `raman_ampli/main.py`)
- Workbook processor → Layer builder: creates layers (evidence: `raman_ampli/main.py`)
- Workbook processor → Ordered stack: appends layers (evidence: `raman_ampli/main.py`)
- Workbook processor → Enhancement simulator: constructs (evidence: `raman_ampli/main.py`)
- Workbook processor → Output template: copies template (evidence: `raman_ampli/main.py`)
- Workbook processor → Results workbook: writes results and chart (evidence: `raman_ampli/main.py`)
- User / caller → Python examples: uses without workbook (evidence: `README.md`)
- Layer builder → Material indices: constructs (evidence: `raman_ampli/layer.py`)
- Material indices → Index tables: loads index table (evidence: `raman_ampli/material.py`)
- Enhancement simulator → Optical factors: calculates factors and intensity (evidence: `raman_ampli/simulator.py`)
- Optical factors → Thickness discretization: discretizes thickness (evidence: `raman_ampli/model.py`)
