# cansud98/mie_scattering architecture

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

- Interactive diagram: https://gitdiagram.com/cansud98/mie_scattering
- Repository: https://github.com/cansud98/mie_scattering

## Overview

This repository provides water/ice refractive-index calculations, exposed through a command-line interface and a Python module. The CLI accepts wavelength or frequency, temperature, and material, then uses wavelength-based dispatch to compute the index; visible/infrared paths read tabulated optical constants. A modified implementation is also present but is not called by the CLI. The README points to a report and example plot, and the tree includes a Mie-scattering notebook; its runtime relationship to the calculator is not established by the available excerpts.

Main entry points: [`riwaterice.py`](https://github.com/cansud98/mie_scattering/blob/main/riwaterice.py) (Refractive indices), [`getm.py`](https://github.com/cansud98/mie_scattering/blob/main/getm.py) (Index CLI), [`WOP_1973_HaleQuerry_umkn.dat`](https://github.com/cansud98/mie_scattering/blob/main/WOP_1973_HaleQuerry_umkn.dat) (Water constants), [`IOP_2008_WarrenBrandt_umnk.dat`](https://github.com/cansud98/mie_scattering/blob/main/IOP_2008_WarrenBrandt_umnk.dat) (Ice constants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["Index CLI<br/>[getm.py]"]
end

subgraph group_models["Optical models"]
  node_refractive["Refractive indices<br/>[riwaterice.py]"]
  node_modified["Modified model"]
  node_waterdata["Water constants"]
  node_icedata["Ice constants"]
end

subgraph group_analysis["Scattering analysis"]
  node_mie["Mie-scattering analysis<br/>[mieSca.ipynb]"]
end

node_user(("User"))

node_user -->|"provides inputs"| node_cli
node_cli -->|"requests index"| node_refractive
node_refractive -->|"reads constants"| node_waterdata
node_refractive -->|"reads constants"| node_icedata

click node_cli "https://github.com/cansud98/mie_scattering/blob/main/getm.py"
click node_refractive "https://github.com/cansud98/mie_scattering/blob/main/riwaterice.py"
click node_modified "https://github.com/cansud98/mie_scattering/blob/main/riwaterice_modified.py"
click node_waterdata "https://github.com/cansud98/mie_scattering/blob/main/WOP_1973_HaleQuerry_umkn.dat"
click node_icedata "https://github.com/cansud98/mie_scattering/blob/main/IOP_2008_WarrenBrandt_umnk.dat"
click node_mie "https://github.com/cansud98/mie_scattering/blob/main/mieSca.ipynb"

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_cli,node_user toneBlue
class node_refractive,node_modified,node_waterdata,node_icedata toneAmber
class node_mie toneMint
```

## Components

### User interface

- [Index CLI](https://github.com/cansud98/mie_scattering/blob/main/getm.py): `getm.py`

### Optical models

- [Refractive indices](https://github.com/cansud98/mie_scattering/blob/main/riwaterice.py): `riwaterice.py`
- [Modified model](https://github.com/cansud98/mie_scattering/blob/main/riwaterice_modified.py): `riwaterice_modified.py`
- [Water constants](https://github.com/cansud98/mie_scattering/blob/main/WOP_1973_HaleQuerry_umkn.dat): `WOP_1973_HaleQuerry_umkn.dat`
- [Ice constants](https://github.com/cansud98/mie_scattering/blob/main/IOP_2008_WarrenBrandt_umnk.dat): `IOP_2008_WarrenBrandt_umnk.dat`

### Scattering analysis

- [Mie-scattering analysis](https://github.com/cansud98/mie_scattering/blob/main/mieSca.ipynb): `mieSca.ipynb`

### Other components

- **User**

## Connections

- User → Index CLI: provides inputs (evidence: `getm.py`)
- Index CLI → Refractive indices: requests index (evidence: `getm.py`)
- Refractive indices → Water constants: reads constants (evidence: `riwaterice.py`)
- Refractive indices → Ice constants: reads constants (evidence: `riwaterice.py`)
