Skip to main content

Python library for processing Callisto solar radio spectrometer data

Project description

pyCallisto

What's New in Version 1.2.2

New Features

  • GOES X-ray Flux Overlay: New spectrogramWithGOES() function to overlay GOES satellite X-ray data on spectrograms
  • Enhanced Spectrogram Control: Added blevel (background level) and vmax (maximum value) parameters for better visualization control

Improvements

  • Added beautifulsoup4 and scipy to core dependencies for better out-of-the-box functionality
  • Comprehensive optional dependencies for GOES integration
  • Improved Windows compatibility

pyCallisto is an image processing and data analysis Python library developed for e-CALLISTO data (http://www.e-callisto.org/). This library can be used to process data obtained using various solar radio spectrometers available around the globe.

Installation

Basic Installation

For core functionality (spectrogram visualization, time/frequency slicing, light curves):

pip install pyCallisto

Installation with GOES Support

For GOES X-ray flux overlay capabilities:

pip install pyCallisto[goes]

Full Installation

For all features:

pip install pyCallisto[all]

⚠️ Important for Windows Users:

  • Python 3.9-3.11 recommended for best compatibility
  • Python 3.12+: Some dependencies may fail to compile. Use the basic installation and install optional dependencies individually if needed
  • If you encounter compilation errors, consider using a conda environment or installing Visual Studio Build Tools

Alternative: Manual Dependency Installation

If you encounter issues with optional dependencies:

pip install pyCallisto
# Then install only what you need:
pip install sunpy  # For GOES features

Prerequisites and Dependencies

Core Dependencies (automatically installed)

  • Python 3.7 or higher
  • numpy
  • matplotlib
  • astropy
  • beautifulsoup4
  • scipy

Optional Dependencies (for GOES integration)

Install with pip install pyCallisto[goes]:

  • sunpy
  • drms
  • zeep
  • lxml
  • h5netcdf
  • h5py
  • cdflib
  • reproject
  • mpl-animators

Quick Start

Basic Spectrogram

import pyCallisto as pyc
import matplotlib.pyplot as plt

# Load FITS file
callisto = pyc.readFits('your_file.fit')

# Create spectrogram
callisto.spectrogram()
plt.show()

Spectrogram with Custom Parameters

# Adjust background level and maximum value
callisto.spectrogram(blevel=3.5, vmax=10.0)
plt.show()

GOES X-ray Flux Overlay (New in v1.2.0!)

# Overlay GOES satellite data on spectrogram
joined_bg_subtracted.spectrogramWithGOES(
    tstart="2024-07-16 13:05",
    tend="2024-07-16 14:34",
    satellite_number=16,    
    xtick=5,
    save_path='spectrogram_with_goes_overlay_2024-07-16.png'
)
plt.show()

Note: GOES overlay requires optional dependencies. Install with pip install pyCallisto[goes]

Features

  • Spectrogram Visualization: Generate spectrograms from FITS files with customizable colormaps and parameters
  • Time and Frequency Slicing: Extract specific time ranges and frequency bands from observations
  • Light Curve Analysis: Create mean light curves by collapsing data along time axis
  • Spectrum Analysis: Generate frequency spectra for specific time instances
  • GOES Integration: Overlay GOES X-ray flux data on spectrograms for comprehensive solar event analysis
  • Background Subtraction: Automated background estimation and removal
  • Universal Plot: Combined visualization of spectrogram, light curve, and spectrum
  • File Concatenation: Merge multiple FITS files along time axis for extended observations

Troubleshooting

Module Not Found Error

If you get ModuleNotFoundError: No module named 'pyCallisto':

  1. Ensure you're using the correct Python environment
  2. Reinstall: pip uninstall pyCallisto && pip install pyCallisto

Import Errors for GOES Features

If you get import errors when using spectrogramWithGOES():

pip install pyCallisto[goes]

Compilation Errors on Windows (Python 3.12+)

  1. Use Python 3.9-3.11 instead, or
  2. Install basic version and skip optional dependencies:
    pip install pyCallisto
    

Visual Studio Build Tools Error

If you see "Microsoft Visual C++ 14.0 or greater is required":

  1. Download Build Tools for Visual Studio
  2. Install "Desktop development with C++"
  3. Retry installation

For more help, please open an issue on GitHub.

Quick Start

GOES Spectrogram Overlay

Overlay GOES X-ray flux data on your spectrogram:

import matplotlib.pyplot as plt

# After loading and processing your data use this function at the end

joined_bg_subtracted.spectrogramWithGOES(    #joined_bg_subtracted is just a variable name
    tstart="2024-07-16 13:05",
    tend="2024-07-16 14:34",
    satellite_number=16,    
    xtick=5,
    save_path='spectrogram_with_goes_overlay_2024-07-16.png'
)
plt.show()

Adjusting Spectrogram Parameters

Control dynamic range and background levels:

# Use blevel to adjust background level
# Use vmax to set maximum value for color scaling
obj.spectrogram(blevel=10, vmax=20) #Example

Contributors

Mr. Ravindra Pawase
Data Scientist
Cummins Inc.
Pune-411 004, India

Dr. K. Sasikumar Raja
Assistant Professor
Indian Institute of Astrophysics
II Block, Koramangala, Bengaluru-560 034, India

Mr. Mrutyunjaya Muduli
B.E. Computer Science and Engineering
Department of Computer Science and Engineering
HKBK College of Engineering
22/1, Opposite Manyata Tech Park, Nagavara, Bengaluru-560 045, India

Feedback

For feedback, queries, or feature requests, please contact:

Citation

If you find pyCallisto useful in your work, we appreciate acknowledgment. We recommend using the following citation:

"This work makes use of the pyCallisto library, which is available at https://github.com/ravipawase/pyCallisto"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycallisto-1.2.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycallisto-1.2.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file pycallisto-1.2.2.tar.gz.

File metadata

  • Download URL: pycallisto-1.2.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pycallisto-1.2.2.tar.gz
Algorithm Hash digest
SHA256 845a582aeb4f7a193824c4709b6ddc00cba259e3eaec01071977b6fdbf408b0a
MD5 db97275bbe1ccfd7e946910cf4027c18
BLAKE2b-256 9df7846a7df44ca14fa1041e0f16d244c69b5131571e075c5de471801ce17ea2

See more details on using hashes here.

File details

Details for the file pycallisto-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: pycallisto-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pycallisto-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c29c00e33f913e7a9ece7d1691e444385c6b5a94e179a7457a3dbc4a3a1647c
MD5 b8f6ffcd2eddaa6ba1486fcca079fa16
BLAKE2b-256 e85a2779601496a3524637e95352129b8bd86e1b672a77f2d6aaaf826a94bd35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page