# pnorena17/instrumentos-opticos architecture

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

- Interactive diagram: https://gitdiagram.com/pnorena17/instrumentos-opticos
- Repository: https://github.com/pnorena17/instrumentos-opticos

## Overview

##### Project Type and Purpose
- This is an academic / scientific Python project (“Instrumentos-opticos”) comprised of a series of optics exercises (“practica_1/punto1” through “punto4”).
- Each “punto” folder implements one optical algorithm or measurement technique (e.g., Transfer Function (TF), Point Spread Function (FTE), Ronchi test, fiber reconstructions) and generates results (plots or TIFF images).

##### File Structure
- Top-level:
– README.md (project title)
– practica_1/ (root of all exercises)
- Under practica_1/:
– punto1/ to punto4/ folders
– Each contains:
· Python scripts (.py) for algorithm implementations and validations
· A “Resultados” subfolder holding output files (PDF or TIFF)
- No centralized “src” or “lib” directory; each exercise is self-contained.

##### README
- Minimal information—only the project name—so we rely on file names and directory layout to infer architecture.

##### Main Components and Their Relationships
a. Data Inputs
– Static test data (images or parameters) implicitly read by each script
b. Processing Modules (one per punto)
– punto1: FTE_gausiana.py, TF_circulo.py, validation scripts
– punto2: Ronchi.py
– punto3: TFinversa.py, reconstruccionConFase.py
– punto4: “Primera aproximación Fibra.py”, “Ing Inversa Fibra.py”
c. Validation & Analysis
– Scripts named “validacion_…” or standalone Python files that compute error metrics, compare analytical vs numerical
d. Output Artifacts
– PDFs (plots of transfer functions) and TIFFs (reconstructed images) stored under each “Resultados” folder

##### Important Architectural Patterns
- Modular by exercise: each “punto” is an isolated pipeline
- Inputs → Algorithm → (Optional) Validation → Results
- No shared code library—each module implements or imports common Python scientific libraries (NumPy, SciPy, Matplotlib)

##### Technologies, Frameworks, and Libraries
- Python 3.x
- NumPy, SciPy for numerical computations
- Matplotlib or similar for plot generation (PDF)
- imageio or PIL for TIFF I/O

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Input and Documentation
    README["Project README"]:::doc
    DataInputs["Data Inputs"]:::input
    README --> DataInputs

    %% Pipelines
    subgraph "Punto1: FTE & TF Pipeline"
        direction TB
        P1_FTE["FTE_gausiana.py"]:::pipeline
        P1_TF["TF_circulo.py"]:::pipeline
        P1_VAL_FTE["validacion_FTE.py"]:::validation
        P1_VAL_TF["validacion_TF.py"]:::validation
        P1_RESULTS["Resultados (PDF/ TIFF)"]:::output
        DataInputs --> P1_FTE
        DataInputs --> P1_TF
        P1_FTE --> P1_VAL_FTE
        P1_TF --> P1_VAL_TF
        P1_VAL_FTE --> P1_RESULTS
        P1_VAL_TF --> P1_RESULTS
    end

    subgraph "Punto2: Ronchi Test Pipeline"
        direction TB
        P2_Ronchi["Ronchi.py"]:::pipeline
        P2_RESULTS["Resultados (PDF/ TIFF)"]:::output
        DataInputs --> P2_Ronchi
        P2_Ronchi --> P2_RESULTS
    end

    subgraph "Punto3: Inverse TF & Phase Reconstruction"
        direction TB
        P3_TFinv["TFinversa.py"]:::pipeline
        P3_ReconF["reconstruccionConFase.py"]:::pipeline
        P3_Pez["Pez.py"]:::pipeline
        P3_RESULTS["Resultados (TIFF)"]:::output
        DataInputs --> P3_TFinv
        DataInputs --> P3_ReconF
        DataInputs --> P3_Pez
        P3_TFinv --> P3_RESULTS
        P3_ReconF --> P3_RESULTS
        P3_Pez --> P3_RESULTS
    end

    subgraph "Punto4: Fiber Reconstruction"
        direction TB
        P4_Primera["Primera aproximación Fibra.py"]:::pipeline
        P4_IngInv["Ing Inversa Fibra.py"]:::pipeline
        P4_RESULTS["Resultados (TIFF)"]:::output
        DataInputs --> P4_Primera
        DataInputs --> P4_IngInv
        P4_Primera --> P4_RESULTS
        P4_IngInv --> P4_RESULTS
    end

    %% Click Events
    click README "https://github.com/pnorena17/instrumentos-opticos/blob/main/README.md"
    click DataInputs "https://github.com/pnorena17/instrumentos-opticos/tree/main/practica_1/images"
    click P1_FTE "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto1/punto1 FTE.py"
    click P1_TF "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto1/punto1 TF.py"
    click P1_VAL_FTE "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto1/validacion_FTE.py"
    click P1_VAL_TF "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto1/validacion_TF.py"
    click P1_RESULTS "https://github.com/pnorena17/instrumentos-opticos/tree/main/practica_1/punto1/Resultados"
    click P2_Ronchi "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto2/Ronchi.py"
    click P2_RESULTS "https://github.com/pnorena17/instrumentos-opticos/tree/main/practica_1/punto2/Resultados"
    click P3_TFinv "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto3/TFinversa.py"
    click P3_ReconF "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto3/reconstruccionConFase.py"
    click P3_Pez "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto3/Pez.py"
    click P3_RESULTS "https://github.com/pnorena17/instrumentos-opticos/tree/main/practica_1/punto3/Resultados"
    click P4_Primera "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto4/Primera aproximación Fibra.py"
    click P4_IngInv "https://github.com/pnorena17/instrumentos-opticos/blob/main/practica_1/punto4/Ing Inversa Fibra.py"
    click P4_RESULTS "https://github.com/pnorena17/instrumentos-opticos/tree/main/practica_1/punto4/Resultados"

    %% Styles
    classDef input fill:#c2f0c2,stroke:#2a7b2e,color:#000
    classDef pipeline fill:#add8e6,stroke:#036687,color:#000
    classDef validation fill:#e0b0ff,stroke:#7f2e83,color:#000
    classDef output fill:#ffd580,stroke:#b86f00,color:#000
    classDef doc fill:#fff2cc,stroke:#a07c00,color:#000
```
