suncasa / suncasa-src

Source code of the suncasa——CASA-based Python package for reducing, analyzing, and visualizing solar dynamic spectroscopic imaging data at radio wavelengths
BSD 2-Clause "Simplified" License
17 stars 23 forks source link

Add OVSAS Synoptic Spectrogram Plotting code #296

Closed sageyu123 closed 2 months ago

sageyu123 commented 3 months ago

This update add the function to plot the OVSAS synoptic spectrogram. It simplifies the plotting of OVRO-LWA and EOVSA spectrograms, alongside STIX and GOES light curves, for specific timestamps or time ranges. The implementation is designed to require minimal inputs, allowing users to specify just a timestamp. It also has an interactive mode if you set the interactive parameter to True, which allows you to zoom in and out of the plot. As a SoD this week, I found it useful when identifying flare/CME events.

Key Features

Usage Examples

Below are a few examples demonstrating how to use the updated plotting tool:

Example 1: Plotting Synoptic Spectrogram for July 31, 2024 and Save the Figure in /data1/workdir/

from suncasa.utils import ovsas_spectrogram as ovsp
from datetime import datetime
ovsp.plot(datetime(2024, 7, 31), figdir='/data1/workdir/')

fig-OVSAs_spec_20240731

Example 2: Plotting for a Specific Time Interval and Save the Figure in /data1/workdir/

ovsp.plot(timerange=[datetime(2024, 7, 31, 17, 20), datetime(2024, 7, 31, 20, 40)],
          figdir='/data1/workdir/', fast_plot=True)

fig-OVSAs_spec_20240731T172000-20240731T204000

Example 3: Plotting OVRO-LWA Spectrogram with full-Resolution

ovsp.plot(timerange=[datetime(2024, 7, 31, 18, 10), datetime(2024, 7, 31, 19, 0)],
          figdir='/data1/workdir/', fast_plot=False)

fig-OVSAs_spec_20240731T182000-20240731T184000