Skip to content

dey-soham/solarviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

198 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌞 SolarViewer

A comprehensive Python toolkit for visualizing and analyzing solar radio images

Python 3.10+ PyPI version License: MIT GitHub stars

Features β€’ Installation β€’ Quick Start β€’ CLI β€’ Documentation β€’ Contributing


✨ Features

SolarViewer is a feature-rich desktop application designed for solar physics research. It provides a full-featured multi-tab interface with comprehensive analysis tools, including helioprojective coordinate support for FITS and CASA image formats with specialized tools for radio astronomy.

πŸ“Š Analysis & Visualization

  • Statistical Analysis β€” Detailed statistics for images and selected regions
  • 2D Gaussian Fitting β€” Fit Gaussian profiles to radio sources
  • Elliptical Ring Fitting β€” Model ring-shaped emission features
  • Region Selection β€” Rectangle and ellipse tools for region-of-interest analysis
  • Multiple Colormaps β€” Choose from scientific colormaps with linear, log, sqrt, and custom stretches
  • Contour Overlays β€” Overlay multi-wavelength contours (e.g., radio on EUV) with automatic coordinate reprojection
  • Stokes Parameters β€” Full polarization support (I, Q, U, V, L, Lfrac, Vfrac, PANG)

🌐 Data Access & Downloads

  • Remote Access (SSH/SFTP) β€” Browse and open files directly from remote servers with local caching
  • Helioviewer Browser β€” Browse and download images from NASA's Helioviewer API with time-series playback
  • Solar Data Downloader β€” Download data from SDO/AIA, IRIS, SOHO, GOES SUVI, STEREO, and GONG
  • Radio Data Downloader β€” Access solar radio observation archives
  • Solar Activity Viewer β€” Browse solar events (flares, CMEs, active regions), view context images and radio spectra, and plot GOES X-ray light curves

🎬 Video Creation

  • Time-lapse Videos β€” Create MP4 videos from image sequences
  • Contour Overlays β€” Overlay radio contours on EUV/optical base images
  • Custom Annotations β€” Add timestamps, colorbars, and min/max plots
  • Preview Mode β€” Real-time preview before rendering

πŸ”§ Advanced Tools

  • Log Console β€” Internal console to view application logs and debugging information
  • Dynamic Spectra Viewer β€” Advanced viewer for radio spectra with RFI masking (ROI/Global), bandpass normalization, and cross-section analysis
  • LOFAR/SIMPL Support β€” Calibration table visualizer and pipeline log viewer
  • Coordinate Transformations β€” Convert between RA/Dec and helioprojective coordinates
  • Phase Center Tool β€” Shift image phase centers for radio interferometry data
  • Export Options β€” Export to FITS, CASA image, PNG, and region files

πŸ“¦ Installation

πŸ’‘ Facing issues? See the Troubleshooting Guide.

Prerequisites

  • Python 3.10 or higher
  • pip package manager
  • CASA data directory: The ~/.casa/data folder must exist for CASA to work properly. Create it with:
    mkdir -p ~/.casa/data

Note: No other manual installation is required β€” all dependencies are installed automatically via pip.

Recommended: Virtual Environment

It is highly recommended to install SolarViewer in a virtual environment to avoid conflicts with system packages.

# Create a virtual environment
python3 -m venv ~/.sv

# Using uv
# uv venv ~/.sv -p 3.13

# Using conda
# conda create -p ~/.sv python=3.13
# Activate the environment
source ~/.sv/bin/activate

# Using conda:
# conda activate ~/.sv

Once the virtual environment is active, proceed with the installation below.

πŸ’‘ After running sv --install (see Desktop Integration below), you won't need to manually activate the environment to launch the application!

Install from PyPI

pip install solarviewer

# Using uv
# uv pip install solarviewer

Install from Source

git clone https://github.com/dey-soham/solarviewer.git
cd solarviewer
pip install -e .

Desktop Integration

After installation, you can create a desktop entry and icon (Linux) or an application bundle (macOS) to launch SolarViewer from your application menu:

# Install desktop shortcuts and icons
solarviewer --install
# or
sv --install

To remove the desktop integration later:

solarviewer --uninstall

πŸ’‘ Optimal CASA Configuration

To prevent CASA from auto-updating and to disable telemetry, we recommend adding these configurations:

Click to view recommended settings

~/.casa/config.py

datapath=["~/.casa/data"]
measurespath="~/.casa/data"
measures_auto_update=False
data_auto_update=False
nologfile=True
telemetry_enabled = False
crashreporter_enabled = False

~/.casa/casainit.py

# CASA Initialization script to bypass updates
try:
    from casatasks.private.testmodes import bypass_casa_updates
    bypass_casa_updates(True)
    print("CASA auto-updates have been disabled via casainit.py")
except:
    pass

~/.casarc

logfile: /dev/null
EnableTelemetry: False

Dependencies

View core dependencies
Package Version Purpose
PyQt5 β‰₯5.15.0 GUI framework
matplotlib β‰₯3.5.0 Plotting and visualization
numpy β‰₯1.20.0 Numerical operations
astropy β‰₯5.0.0 FITS handling, coordinates
scipy β‰₯1.7.0 Scientific computing
sunpy β‰₯5.0.0 Solar physics tools
casatools β‰₯6.4.0 CASA image support
casatasks β‰₯6.4.0 CASA tasks

πŸš€ Quick Start

Launch SolarViewer

solarviewer
# or
sv

# Open a specific file
solarviewer path/to/image.fits

LOFAR Tools

viewcaltable       # Calibration table visualizer
viewlogs           # Pipeline log viewer

Other Tools

viewsolaractivity  # Solar events browser
heliobrowser       # Helioviewer browser
viewds             # Dynamic spectra viewer

πŸ’» Command Line Interface

Command Line Interface (solarviewer / sv)

solarviewer [OPTIONS] [IMAGEFILE]

Options:
  --install         Install desktop integration
  --uninstall       Uninstall desktop integration
  --light           Start with light theme
  -v, --version     Show version and exit
  -h, --help        Show help message

πŸ“š Documentation

User Interface Overview

SolarViewer Controls

File Controls

  • Open Directory β€” Load a folder of solar radio images
  • Open FITS File β€” Load a single FITS file
  • Export Figure β€” Save current view as image
  • Export as FITS β€” Export data as FITS file

Display Controls

  • Colormap β€” Choose visualization colormap
  • Stretch β€” Linear, log, sqrt, power-law options
  • Gamma β€” Adjust power-law exponent
  • Min/Max β€” Manual or auto display range

Region Tools

  • Rectangle/Ellipse Selection β€” Select regions for analysis
  • Export Region β€” Save as CASA region file
  • Export Sub-image β€” Extract region as new image

Analysis Tools

  • Fit 2D Gaussian β€” Gaussian source fitting
  • Fit Elliptical Ring β€” Ring model fitting
  • Image Statistics β€” Full image statistics
  • Region Statistics β€” Selected region statistics

πŸ—οΈ Project Structure

solarviewer/
β”œβ”€β”€ solar_radio_image_viewer/
β”‚   β”œβ”€β”€ main.py                 # Entry point
β”‚   β”œβ”€β”€ install_utils.py        # Desktop integration (install/uninstall)
β”‚   β”œβ”€β”€ viewer.py               # Standard viewer
β”‚   β”œβ”€β”€ assets/                 # Icons and resources
β”‚   β”œβ”€β”€ helioprojective.py      # Coordinate conversions
β”‚   β”œβ”€β”€ helioprojective_viewer.py
β”‚   β”œβ”€β”€ helioviewer_browser.py  # Helioviewer API browser
β”‚   β”œβ”€β”€ video_dialog.py         # Video creation UI
β”‚   β”œβ”€β”€ create_video.py         # Video rendering
β”‚   β”œβ”€β”€ video_utils.py          # Video utilities
β”‚   β”œβ”€β”€ noaa_events/            # Solar events browser
β”‚   β”œβ”€β”€ solar_data_downloader/  # SDO/AIA, IRIS, etc.
β”‚   β”œβ”€β”€ radio_data_downloader/  # Radio data archives
β”‚   β”œβ”€β”€ solar_context/          # Real-time solar data
β”‚   β”œβ”€β”€ remote/                 # Remote file access (SSH/SFTP)
β”‚   β”œβ”€β”€ from_simpl/             # LOFAR/SIMPL tools
β”‚   β”œβ”€β”€ learmonth-py/           # Learmonth data downloader
β”‚   β”œβ”€β”€ move_phasecenter.py     # Phase center correction tool
β”‚   β”œβ”€β”€ tutorial.py             # Tutorial
β”‚   β”œβ”€β”€ dialogs.py              # Application dialogs
β”‚   β”œβ”€β”€ splash.py               # Splash screen
β”‚   β”œβ”€β”€ log_console.py          # Internal log viewer
β”‚   β”œβ”€β”€ searchable_combobox.py  # Custom combobox widget
β”‚   β”œβ”€β”€ norms.py                # Image normalization
β”‚   β”œβ”€β”€ utils.py                # Utility functions
β”‚   β”œβ”€β”€ utils/                  # Additional utilities (updater, limiter)
β”‚   β”œβ”€β”€ version.py              # Version information
β”‚   └── styles.py               # UI themes (light/dark)
β”œβ”€β”€ resources/                  # Desktop integration resources
β”œβ”€β”€ setup.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── RELEASE_NOTES.md

🀝 Contributing

Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation, we appreciate your help.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ™ Acknowledgments

This project builds on the excellent work of the solar physics and radio astronomy communities:

Core Libraries

  • SunPy β€” Solar physics data analysis in Python
  • Astropy β€” Core astronomy library for FITS, coordinates, and units
  • CASA β€” Common Astronomy Software Applications for radio astronomy

GUI & Visualization

  • PyQt5 β€” Python bindings for Qt GUI framework
  • Matplotlib β€” Publication-quality plotting
  • NumPy β€” Fundamental package for scientific computing
  • SciPy β€” Scientific algorithms and mathematics

Data Sources & APIs

  • Helioviewer β€” NASA/ESA solar image browser and API
  • SolarMonitor β€” Real-time solar activity monitoring
  • NOAA SWPC β€” Space Weather Prediction Center solar event data
  • SDO/AIA β€” Solar Dynamics Observatory
  • JSOC β€” Joint Science Operations Center for SDO data
  • VSO β€” Virtual Solar Observatory

Community

  • The solar physics group at the National Centre for Radio Astrophysics for feedback and testing
  • Deepan Patra for designing app icon and logo
  • Atul Mohan for contributing to the download codebase and providing helpful feedback

πŸ‘¨β€πŸ’» Author

Soham Dey β€” sohamd943@gmail.com β€” @dey-soham


Built with ❀️ for solar physics research

About

A comprehensive tool for visualizing and analyzing solar radio images.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages