SolarViewer - A comprehensive tool for visualizing and analyzing solar radio images
Project description
๐ SolarViewer
A comprehensive Python toolkit for visualizing and analyzing solar radio images
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/datafolder 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.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solarviewer-1.2.3.tar.gz.
File metadata
- Download URL: solarviewer-1.2.3.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00599c65a9aad7f1aef6690a9f82d5325b78d80ed651667a467ce1fad468ba2b
|
|
| MD5 |
056495c9b3986dae563661135c56c396
|
|
| BLAKE2b-256 |
0bcc9509b5db6a1e777b2723d35308172957bab4c9676b01aa58dab7eae7104a
|
File details
Details for the file solarviewer-1.2.3-py3-none-any.whl.
File metadata
- Download URL: solarviewer-1.2.3-py3-none-any.whl
- Upload date:
- Size: 2.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70a82e249a8fdfaa3946a00ed5afe2cb3d793d651ae37fe30ce657a3e456c1b3
|
|
| MD5 |
3d9a7ac7b32740b68c62894c791a0d1f
|
|
| BLAKE2b-256 |
1071b12e2a00cc0fabc338ede9143c55bec42841477cc131c31fd70aa3e9a0d0
|