# geraldmoesenlechner/stasis architecture

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

- Interactive diagram: https://gitdiagram.com/geraldmoesenlechner/stasis
- Repository: https://github.com/geraldmoesenlechner/stasis

## Overview

STASIS is presented as a Cython-based kinematic sky simulator for astronomical detectors, accepting a star-catalogue XML format. The sampled runtime code chiefly implements detector-image features—star masks and images, background, detector effects, and smearing—alongside numerical image and random-distribution utilities. The kinematics C file exposes only a trivial test function in the excerpt, so its substantive role is unclear. Python bindings and catalogue processing are present in the tree but were not sampled; their runtime connections are therefore not asserted.

Main entry points: [`STASIS/Detector_features/STASIS_detector.c`](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c) (Detector image features), [`STASIS/Utilities/STASIS_utility.c`](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c) (Image convolution), [`STASIS/Detector_features/_STASIS_detector.pyx`](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/_STASIS_detector.pyx) (Cython bindings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Python interface"]
  node_bindings["Cython bindings"]
  node_kinematics["Kinematics module<br/>[sc_kinematics.c]"]
end

subgraph group_simulation["Detector simulation"]
  node_detector["Detector image features<br/>[STASIS_detector.c]"]
  node_stars["Star image generation<br/>[STASIS_detector.c]"]
  node_detector_effects["Bias dark flat<br/>[STASIS_detector.c]"]
  node_background["Background and shot noise<br/>[STASIS_detector.c]"]
  node_smearing["Image smearing<br/>[STASIS_detector.c]"]
end

subgraph group_numerics["Numerical utilities"]
  node_random["Random distributions<br/>[STASIS_utility.c]"]
  node_image_ops["Image operations<br/>[STASIS_utility.c]"]
  node_convolution["Image convolution<br/>[STASIS_utility.c]"]
end

node_user(("Simulator user"))
node_xml["Star catalogue"]

node_user -.->|"uses simulator"| node_bindings
node_xml -.->|"provides catalogue"| node_user
node_detector -->|"generates"| node_stars
node_detector -->|"generates"| node_detector_effects
node_detector -->|"generates"| node_background
node_detector -->|"smears"| node_smearing
node_detector -->|"upsamples with"| node_image_ops
node_detector -->|"convolves with"| node_convolution
node_detector -->|"samples with"| node_random
node_smearing -->|"convolves with"| node_convolution

click node_bindings "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/_STASIS_detector.pyx"
click node_kinematics "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Sc_kinematics/sc_kinematics.c"
click node_detector "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c"
click node_stars "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c"
click node_detector_effects "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c"
click node_background "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c"
click node_smearing "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c"
click node_random "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c"
click node_image_ops "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c"
click node_convolution "https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c"

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_bindings,node_kinematics,node_user toneBlue
class node_detector,node_stars,node_detector_effects,node_background,node_smearing toneAmber
class node_random,node_image_ops,node_convolution toneMint
class node_xml toneIndigo
```

## Components

### Python interface

- [Cython bindings](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/_STASIS_detector.pyx): `STASIS/Detector_features/_STASIS_detector.pyx`
- [Kinematics module](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Sc_kinematics/sc_kinematics.c): `STASIS/Sc_kinematics/sc_kinematics.c`

### Detector simulation

- [Detector image features](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c): `STASIS/Detector_features/STASIS_detector.c`
- [Star image generation](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c): `STASIS/Detector_features/STASIS_detector.c`
- [Bias dark flat](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c): `STASIS/Detector_features/STASIS_detector.c`
- [Background and shot noise](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c): `STASIS/Detector_features/STASIS_detector.c`
- [Image smearing](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Detector_features/STASIS_detector.c): `STASIS/Detector_features/STASIS_detector.c`

### Numerical utilities

- [Random distributions](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c): `STASIS/Utilities/STASIS_utility.c`
- [Image operations](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c): `STASIS/Utilities/STASIS_utility.c`
- [Image convolution](https://github.com/geraldmoesenlechner/stasis/blob/main/STASIS/Utilities/STASIS_utility.c): `STASIS/Utilities/STASIS_utility.c`

### Other components

- **Simulator user**
- **Star catalogue**

## Connections

- Simulator user → Cython bindings: uses simulator (evidence: `README.md`)
- Star catalogue → Simulator user: provides catalogue (evidence: `README.md`)
- Detector image features → Star image generation: generates (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Bias dark flat: generates (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Background and shot noise: generates (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Image smearing: smears (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Image operations: upsamples with (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Image convolution: convolves with (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Detector image features → Random distributions: samples with (evidence: `STASIS/Detector_features/STASIS_detector.c`)
- Image smearing → Image convolution: convolves with (evidence: `STASIS/Detector_features/STASIS_detector.c`)
