# thiagofigueiroribeiro/esim_eventsimulator_python architecture

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

- Interactive diagram: https://gitdiagram.com/thiagofigueiroribeiro/esim_eventsimulator_python
- Repository: https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python

## Overview

ESIM is a Python event-camera simulator: timestamped grayscale images enter through the folder source, the CLI orchestrates event and optional blurred-frame simulation, then writes an event stream and frame sequence. Separate tools visualize/export event frames, demonstrate webcam-derived pseudo-events, and analyze propeller motion. The core call graph is supported by the CLI excerpt and README; unsampled webcam and analysis internals are represented only at their documented subsystem level.

Main entry points: [`esim/cli.py`](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/cli.py) (CLI runner), [`esim/writers.py`](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/writers.py) (Output writers), [`esim/event_frames.py`](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_frames.py) (Event-frame export), [`esim/data_provider.py`](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/data_provider.py) (Folder source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Image input"]
  node_source["Folder source<br/>[data_provider.py]"]
end

subgraph group_simulation["Simulation core"]
  node_cli["CLI runner<br/>[cli.py]"]
  node_config["Model config<br/>[types.py]"]
  node_event_sim["Event simulator<br/>[event_simulator.py]"]
  node_camera_sim["Camera simulator"]
end

subgraph group_outputs["Outputs and visualization"]
  node_writers["Output writers<br/>[writers.py]"]
  node_viz["Event visualization<br/>[viz.py]"]
end

subgraph group_analysis["Event utilities"]
  node_event_frames["Event-frame export<br/>[event_frames.py]"]
  node_camera_demo["Webcam pseudo-events"]
  node_propeller_analysis["Propeller analysis"]
end

node_user(("User"))
node_images["Stamped images"]
node_event_file["events.npz"]
node_blurred_frames["Blurred frames"]
node_event_frame_files["Event-frame PNGs"]
node_webcam(("Webcam"))

node_user -->|"runs"| node_cli
node_images -->|"provides"| node_source
node_cli -->|"iterates"| node_source
node_cli -->|"configures"| node_config
node_cli -->|"invokes"| node_event_sim
node_cli -->|"invokes"| node_camera_sim
node_cli -->|"writes via"| node_writers
node_writers -->|"writes"| node_event_file
node_writers -->|"writes"| node_blurred_frames
node_event_file -->|"loads events"| node_viz
node_event_file -->|"loads events"| node_event_frames
node_event_frames -->|"writes"| node_event_frame_files
node_webcam -->|"provides stream"| node_camera_demo
node_event_file -->|"analyzes"| node_propeller_analysis

click node_cli "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/cli.py"
click node_source "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/data_provider.py"
click node_config "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/types.py"
click node_event_sim "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_simulator.py"
click node_camera_sim "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/camera_simulator.py"
click node_writers "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/writers.py"
click node_viz "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/viz.py"
click node_event_frames "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_frames.py"
click node_camera_demo "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_frames_from_camera.py"
click node_propeller_analysis "https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/tools/calculate_angular_velocity_PCA.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_source,node_user toneBlue
class node_cli,node_config,node_event_sim,node_camera_sim toneAmber
class node_writers,node_viz toneMint
class node_event_frames,node_camera_demo,node_propeller_analysis toneRose
class node_images,node_event_file,node_blurred_frames,node_event_frame_files,node_webcam toneIndigo
```

## Components

### Image input

- [Folder source](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/data_provider.py): `esim/data_provider.py`

### Simulation core

- [CLI runner](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/cli.py): `esim/cli.py`
- [Model config](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/types.py): `esim/types.py`
- [Event simulator](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_simulator.py): `esim/event_simulator.py`
- [Camera simulator](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/camera_simulator.py): `esim/camera_simulator.py`

### Outputs and visualization

- [Output writers](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/writers.py): `esim/writers.py`
- [Event visualization](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/viz.py): `esim/viz.py`

### Event utilities

- [Event-frame export](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_frames.py): `esim/event_frames.py`
- [Webcam pseudo-events](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/esim/event_frames_from_camera.py): `esim/event_frames_from_camera.py`
- [Propeller analysis](https://github.com/thiagofigueiroribeiro/esim_eventsimulator_python/blob/main/tools/calculate_angular_velocity_PCA.py): `tools/calculate_angular_velocity_PCA.py`

### Other components

- **User**
- **Stamped images**
- **events.npz**
- **Blurred frames**
- **Event-frame PNGs**
- **Webcam**

## Connections

- User → CLI runner: runs (evidence: `README.md`)
- Stamped images → Folder source: provides (evidence: `README.md`)
- CLI runner → Folder source: iterates (evidence: `esim/cli.py`)
- CLI runner → Model config: configures (evidence: `esim/cli.py`)
- CLI runner → Event simulator: invokes (evidence: `esim/cli.py`)
- CLI runner → Camera simulator: invokes (evidence: `esim/cli.py`)
- CLI runner → Output writers: writes via (evidence: `esim/cli.py`)
- Output writers → events.npz: writes (evidence: `esim/writers.py`)
- Output writers → Blurred frames: writes (evidence: `esim/writers.py`)
- events.npz → Event visualization: loads events (evidence: `README.md`)
- events.npz → Event-frame export: loads events (evidence: `README.md`)
- Event-frame export → Event-frame PNGs: writes (evidence: `esim/event_frames.py`)
- Webcam → Webcam pseudo-events: provides stream (evidence: `README.md`)
- events.npz → Propeller analysis: analyzes (evidence: `README.md`)
