# arya-02a/rfi_detection_pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/arya-02a/rfi_detection_pipeline
- Repository: https://github.com/arya-02a/rfi_detection_pipeline

## Overview

This is a research-prototype Streamlit application for inspecting GMRT radio-observation FITS files and detecting, classifying, and visualizing RFI. Its main workflow loads visibility data, converts it to a time–frequency power waterfall, creates a robust-statistics mask, builds labeled patches, trains a classifier, and displays results. A separate FITS explorer provides file metadata and signal summaries. The README documents additional dashboard views; source excerpts are partial, so uncertain internal wiring is omitted.

Main entry points: [`main.py`](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py) (Pipeline Dashboard), [`analysis.py`](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/analysis.py) (FITS Explorer), [`dataset_builder.py`](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/dataset_builder.py) (Patch Dataset Builder), [`model_training.py`](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py) (Random Forest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Pipeline Dashboard<br/>[main.py]"]
  node_pipeline_views["Pipeline Visualizations<br/>[main.py]"]
  node_inspection_views["Inspection Visualizations<br/>[main.py]"]
end

subgraph group_signal["Signal Processing"]
  node_waterfall["Power Waterfall<br/>[main.py]"]
  node_robust_mask["Robust RFI Mask<br/>[main.py]"]
  node_standalone_detector["Standalone Detector<br/>[detection.py]"]
end

subgraph group_ml["Patch Classification"]
  node_patch_builder["Patch Dataset Builder<br/>[dataset_builder.py]"]
  node_patch_split["Patch Split<br/>[dataset_builder.py]"]
  node_feature_extractor["Feature Extraction<br/>[model_training.py]"]
  node_heuristic_labels["Heuristic Classes<br/>[model_training.py]"]
  node_classifier["Random Forest<br/>[model_training.py]"]
  node_overlay["Overlay Map<br/>[model_training.py]"]
  node_model_store[("Saved Model")]
  node_dataset_store[("Generated Dataset")]
end

subgraph group_inspection["FITS Inspection"]
  node_fits_explorer["FITS Explorer<br/>[analysis.py]"]
  node_fits_summary["FITS Summaries<br/>[analysis.py]"]
end

node_researcher(("Researcher"))
node_fits_input["GMRT FITS"]

node_researcher -->|"uses"| node_dashboard_app
node_fits_input -->|"provides data"| node_dashboard_app
node_dashboard_app -->|"loads and converts"| node_waterfall
node_dashboard_app -->|"detects RFI"| node_robust_mask
node_waterfall -->|"provides power"| node_patch_builder
node_robust_mask -->|"provides mask"| node_patch_builder
node_patch_builder -->|"splits patches"| node_patch_split
node_patch_split -->|"saves arrays"| node_dataset_store
node_dashboard_app -->|"requests features"| node_feature_extractor
node_dashboard_app -->|"requests labels"| node_heuristic_labels
node_dashboard_app -->|"trains model"| node_classifier
node_classifier -->|"saves model"| node_model_store
node_dashboard_app -->|"builds overlay"| node_overlay
node_dashboard_app -->|"renders results"| node_pipeline_views
node_researcher -.->|"uses"| node_standalone_detector
node_fits_input -.->|"loads and detects"| node_standalone_detector
node_researcher -->|"requests inspection"| node_fits_explorer
node_fits_input -->|"reads structure"| node_fits_explorer
node_fits_explorer -->|"computes summaries"| node_fits_summary
node_dashboard_app -->|"runs analysis"| node_fits_explorer
node_dashboard_app -->|"renders analysis"| node_inspection_views
node_fits_summary -->|"supplies results"| node_inspection_views

click node_dashboard_app "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py"
click node_waterfall "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py"
click node_robust_mask "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py"
click node_standalone_detector "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/detection.py"
click node_patch_builder "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/dataset_builder.py"
click node_patch_split "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/dataset_builder.py"
click node_feature_extractor "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py"
click node_heuristic_labels "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py"
click node_classifier "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py"
click node_overlay "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py"
click node_model_store "https://github.com/arya-02a/rfi_detection_pipeline/tree/main/models"
click node_dataset_store "https://github.com/arya-02a/rfi_detection_pipeline/tree/main/dataset_ml"
click node_pipeline_views "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py"
click node_fits_explorer "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/analysis.py"
click node_fits_summary "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/analysis.py"
click node_inspection_views "https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.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_dashboard_app,node_pipeline_views,node_inspection_views toneBlue
class node_waterfall,node_robust_mask,node_standalone_detector toneAmber
class node_patch_builder,node_patch_split,node_feature_extractor,node_heuristic_labels,node_classifier,node_overlay,node_model_store,node_dataset_store toneMint
class node_fits_explorer,node_fits_summary toneRose
class node_researcher,node_fits_input toneIndigo
```

## Components

### Dashboard

- [Pipeline Dashboard](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py): `main.py`
- [Pipeline Visualizations](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py): `main.py`
- [Inspection Visualizations](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py): `main.py`

### Signal Processing

- [Power Waterfall](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py): `main.py`
- [Robust RFI Mask](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/main.py): `main.py`
- [Standalone Detector](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/detection.py): `detection.py`

### Patch Classification

- [Patch Dataset Builder](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/dataset_builder.py): `dataset_builder.py`
- [Patch Split](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/dataset_builder.py): `dataset_builder.py`
- [Feature Extraction](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py): `model_training.py`
- [Heuristic Classes](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py): `model_training.py`
- [Random Forest](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py): `model_training.py`
- [Overlay Map](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/model_training.py): `model_training.py`
- [Saved Model](https://github.com/arya-02a/rfi_detection_pipeline/tree/main/models): `models`
- [Generated Dataset](https://github.com/arya-02a/rfi_detection_pipeline/tree/main/dataset_ml): `dataset_ml`

### FITS Inspection

- [FITS Explorer](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/analysis.py): `analysis.py`
- [FITS Summaries](https://github.com/arya-02a/rfi_detection_pipeline/blob/main/analysis.py): `analysis.py`

### Other components

- **Researcher**
- **GMRT FITS**

## Connections

- Researcher → Pipeline Dashboard: uses
- GMRT FITS → Pipeline Dashboard: provides data
- Pipeline Dashboard → Power Waterfall: loads and converts
- Pipeline Dashboard → Robust RFI Mask: detects RFI
- Power Waterfall → Patch Dataset Builder: provides power
- Robust RFI Mask → Patch Dataset Builder: provides mask
- Patch Dataset Builder → Patch Split: splits patches
- Patch Split → Generated Dataset: saves arrays
- Pipeline Dashboard → Feature Extraction: requests features
- Pipeline Dashboard → Heuristic Classes: requests labels
- Pipeline Dashboard → Random Forest: trains model
- Random Forest → Saved Model: saves model
- Pipeline Dashboard → Overlay Map: builds overlay
- Pipeline Dashboard → Pipeline Visualizations: renders results
- Researcher → Standalone Detector: uses
- GMRT FITS → Standalone Detector: loads and detects
- Researcher → FITS Explorer: requests inspection
- GMRT FITS → FITS Explorer: reads structure
- FITS Explorer → FITS Summaries: computes summaries
- Pipeline Dashboard → FITS Explorer: runs analysis
- Pipeline Dashboard → Inspection Visualizations: renders analysis
- FITS Summaries → Inspection Visualizations: supplies results
