solarviewer 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. solar_radio_image_viewer/__init__.py +12 -0
  2. solar_radio_image_viewer/assets/add_tab_default.png +0 -0
  3. solar_radio_image_viewer/assets/add_tab_default_light.png +0 -0
  4. solar_radio_image_viewer/assets/add_tab_hover.png +0 -0
  5. solar_radio_image_viewer/assets/add_tab_hover_light.png +0 -0
  6. solar_radio_image_viewer/assets/browse.png +0 -0
  7. solar_radio_image_viewer/assets/browse_light.png +0 -0
  8. solar_radio_image_viewer/assets/close_tab_default.png +0 -0
  9. solar_radio_image_viewer/assets/close_tab_default_light.png +0 -0
  10. solar_radio_image_viewer/assets/close_tab_hover.png +0 -0
  11. solar_radio_image_viewer/assets/close_tab_hover_light.png +0 -0
  12. solar_radio_image_viewer/assets/ellipse_selection.png +0 -0
  13. solar_radio_image_viewer/assets/ellipse_selection_light.png +0 -0
  14. solar_radio_image_viewer/assets/icons8-ellipse-90.png +0 -0
  15. solar_radio_image_viewer/assets/icons8-ellipse-90_light.png +0 -0
  16. solar_radio_image_viewer/assets/icons8-info-90.png +0 -0
  17. solar_radio_image_viewer/assets/icons8-info-90_light.png +0 -0
  18. solar_radio_image_viewer/assets/profile.png +0 -0
  19. solar_radio_image_viewer/assets/profile_light.png +0 -0
  20. solar_radio_image_viewer/assets/rectangle_selection.png +0 -0
  21. solar_radio_image_viewer/assets/rectangle_selection_light.png +0 -0
  22. solar_radio_image_viewer/assets/reset.png +0 -0
  23. solar_radio_image_viewer/assets/reset_light.png +0 -0
  24. solar_radio_image_viewer/assets/ruler.png +0 -0
  25. solar_radio_image_viewer/assets/ruler_light.png +0 -0
  26. solar_radio_image_viewer/assets/search.png +0 -0
  27. solar_radio_image_viewer/assets/search_light.png +0 -0
  28. solar_radio_image_viewer/assets/settings.png +0 -0
  29. solar_radio_image_viewer/assets/settings_light.png +0 -0
  30. solar_radio_image_viewer/assets/splash.fits +0 -0
  31. solar_radio_image_viewer/assets/zoom_60arcmin.png +0 -0
  32. solar_radio_image_viewer/assets/zoom_60arcmin_light.png +0 -0
  33. solar_radio_image_viewer/assets/zoom_in.png +0 -0
  34. solar_radio_image_viewer/assets/zoom_in_light.png +0 -0
  35. solar_radio_image_viewer/assets/zoom_out.png +0 -0
  36. solar_radio_image_viewer/assets/zoom_out_light.png +0 -0
  37. solar_radio_image_viewer/create_video.py +1345 -0
  38. solar_radio_image_viewer/dialogs.py +2665 -0
  39. solar_radio_image_viewer/from_simpl/__init__.py +184 -0
  40. solar_radio_image_viewer/from_simpl/caltable_visualizer.py +1001 -0
  41. solar_radio_image_viewer/from_simpl/dynamic_spectra_dialog.py +332 -0
  42. solar_radio_image_viewer/from_simpl/make_dynamic_spectra.py +351 -0
  43. solar_radio_image_viewer/from_simpl/pipeline_logger_gui.py +1232 -0
  44. solar_radio_image_viewer/from_simpl/simpl_theme.py +352 -0
  45. solar_radio_image_viewer/from_simpl/utils.py +984 -0
  46. solar_radio_image_viewer/from_simpl/view_dynamic_spectra_GUI.py +1975 -0
  47. solar_radio_image_viewer/helioprojective.py +1916 -0
  48. solar_radio_image_viewer/helioprojective_viewer.py +817 -0
  49. solar_radio_image_viewer/helioviewer_browser.py +1514 -0
  50. solar_radio_image_viewer/main.py +148 -0
  51. solar_radio_image_viewer/move_phasecenter.py +1269 -0
  52. solar_radio_image_viewer/napari_viewer.py +368 -0
  53. solar_radio_image_viewer/noaa_events/__init__.py +32 -0
  54. solar_radio_image_viewer/noaa_events/noaa_events.py +430 -0
  55. solar_radio_image_viewer/noaa_events/noaa_events_gui.py +1922 -0
  56. solar_radio_image_viewer/norms.py +293 -0
  57. solar_radio_image_viewer/radio_data_downloader/__init__.py +25 -0
  58. solar_radio_image_viewer/radio_data_downloader/radio_data_downloader.py +756 -0
  59. solar_radio_image_viewer/radio_data_downloader/radio_data_downloader_gui.py +528 -0
  60. solar_radio_image_viewer/searchable_combobox.py +220 -0
  61. solar_radio_image_viewer/solar_context/__init__.py +41 -0
  62. solar_radio_image_viewer/solar_context/active_regions.py +371 -0
  63. solar_radio_image_viewer/solar_context/cme_alerts.py +234 -0
  64. solar_radio_image_viewer/solar_context/context_images.py +297 -0
  65. solar_radio_image_viewer/solar_context/realtime_data.py +528 -0
  66. solar_radio_image_viewer/solar_data_downloader/__init__.py +35 -0
  67. solar_radio_image_viewer/solar_data_downloader/solar_data_downloader.py +1667 -0
  68. solar_radio_image_viewer/solar_data_downloader/solar_data_downloader_cli.py +901 -0
  69. solar_radio_image_viewer/solar_data_downloader/solar_data_downloader_gui.py +1210 -0
  70. solar_radio_image_viewer/styles.py +643 -0
  71. solar_radio_image_viewer/utils/__init__.py +32 -0
  72. solar_radio_image_viewer/utils/rate_limiter.py +255 -0
  73. solar_radio_image_viewer/utils.py +952 -0
  74. solar_radio_image_viewer/video_dialog.py +2629 -0
  75. solar_radio_image_viewer/video_utils.py +656 -0
  76. solar_radio_image_viewer/viewer.py +11174 -0
  77. solarviewer-1.0.2.dist-info/METADATA +343 -0
  78. solarviewer-1.0.2.dist-info/RECORD +82 -0
  79. solarviewer-1.0.2.dist-info/WHEEL +5 -0
  80. solarviewer-1.0.2.dist-info/entry_points.txt +8 -0
  81. solarviewer-1.0.2.dist-info/licenses/LICENSE +21 -0
  82. solarviewer-1.0.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,184 @@
1
+ """
2
+ SIMPL GUI Tools for Solar Radio Image Viewer
3
+ =============================================
4
+
5
+ This module provides launcher functions for GUI tools originally developed
6
+ for the SIMPL LOFAR pipeline, adapted for use within Solar Radio Image Viewer.
7
+
8
+ Tools included:
9
+ - Dynamic Spectrum Viewer: View and clean dynamic spectra FITS files
10
+ - Calibration Table Visualizer: Visualize bandpass/selfcal/crossphase tables
11
+ - Dynamic Spectra Creator: Generate dynamic spectra from MS files
12
+ - Log Viewer: View and filter pipeline log files
13
+ """
14
+
15
+ # Track which tools are available based on dependencies
16
+ DYNAMIC_SPECTRUM_AVAILABLE = False
17
+ CALTABLE_VISUALIZER_AVAILABLE = False
18
+ DYNAMIC_SPECTRA_CREATOR_AVAILABLE = False
19
+ LOG_VIEWER_AVAILABLE = False
20
+
21
+ # Check dependencies for each tool
22
+ try:
23
+ import cv2
24
+ import numpy as np
25
+ from astropy.io import fits
26
+ DYNAMIC_SPECTRUM_AVAILABLE = True
27
+ except ImportError as e:
28
+ print(f"[from_simpl] Dynamic Spectrum Viewer not available: {e}")
29
+
30
+ try:
31
+ import seaborn
32
+ from casacore.tables import table
33
+ CALTABLE_VISUALIZER_AVAILABLE = True
34
+ except ImportError as e:
35
+ print(f"[from_simpl] Calibration Table Visualizer not available: {e}")
36
+ print(" Install with: pip install python-casacore seaborn")
37
+
38
+ try:
39
+ from casacore.tables import table
40
+ from astropy.io import fits
41
+ DYNAMIC_SPECTRA_CREATOR_AVAILABLE = True
42
+ except ImportError as e:
43
+ print(f"[from_simpl] Dynamic Spectra Creator not available: {e}")
44
+ print(" Install with: pip install python-casacore astropy")
45
+
46
+ # Log viewer just needs PyQt5 which is always available
47
+ LOG_VIEWER_AVAILABLE = True
48
+
49
+
50
+ def launch_dynamic_spectrum_viewer(parent=None, fits_file=None):
51
+ """
52
+ Launch the Dynamic Spectrum Viewer window.
53
+
54
+ Parameters
55
+ ----------
56
+ parent : QWidget, optional
57
+ Parent widget for the viewer window
58
+ fits_file : str, optional
59
+ Path to a FITS file to open automatically
60
+
61
+ Returns
62
+ -------
63
+ MainWindow
64
+ The viewer window instance
65
+ """
66
+ if not DYNAMIC_SPECTRUM_AVAILABLE:
67
+ from PyQt5.QtWidgets import QMessageBox
68
+ QMessageBox.warning(
69
+ parent, "Missing Dependencies",
70
+ "Dynamic Spectrum Viewer requires: opencv-python, numpy, astropy\n\n"
71
+ "Install with: pip install opencv-python astropy"
72
+ )
73
+ return None
74
+
75
+ from .view_dynamic_spectra_GUI import MainWindow
76
+ window = MainWindow()
77
+ window.show()
78
+
79
+ # Open file if provided
80
+ if fits_file:
81
+ # The MainWindow has an openFile method we can use
82
+ # But we need to load the file programmatically
83
+ window._load_fits_file(fits_file)
84
+
85
+ return window
86
+
87
+
88
+ def launch_caltable_visualizer(parent=None):
89
+ """
90
+ Launch the Calibration Table Visualizer window.
91
+
92
+ Parameters
93
+ ----------
94
+ parent : QWidget, optional
95
+ Parent widget for the viewer window
96
+
97
+ Returns
98
+ -------
99
+ VisualizationApp
100
+ The visualizer window instance
101
+ """
102
+ if not CALTABLE_VISUALIZER_AVAILABLE:
103
+ from PyQt5.QtWidgets import QMessageBox
104
+ QMessageBox.warning(
105
+ parent, "Missing Dependencies",
106
+ "Calibration Table Visualizer requires: casacore, seaborn\n\n"
107
+ "Install with: pip install python-casacore seaborn"
108
+ )
109
+ return None
110
+
111
+ from .caltable_visualizer import VisualizationApp
112
+ window = VisualizationApp()
113
+ window.show()
114
+ return window
115
+
116
+
117
+ def launch_log_viewer(parent=None, log_file=None):
118
+ """
119
+ Launch the Log Viewer window.
120
+
121
+ Parameters
122
+ ----------
123
+ parent : QWidget, optional
124
+ Parent widget for the viewer window
125
+ log_file : str, optional
126
+ Path to a log file to open automatically
127
+
128
+ Returns
129
+ -------
130
+ PipelineLoggerGUI
131
+ The log viewer window instance
132
+ """
133
+ from .pipeline_logger_gui import PipelineLoggerGUI
134
+ window = PipelineLoggerGUI()
135
+ window.show()
136
+
137
+ if log_file:
138
+ # Load the log file using the internal method pattern
139
+ window.log_monitor.set_log_file(log_file)
140
+ # Parse and load the log file
141
+ import os
142
+ from .pipeline_logger_gui import LogRecord
143
+ if os.path.exists(log_file):
144
+ with open(log_file, 'r') as f:
145
+ for line in f:
146
+ try:
147
+ parts = line.strip().split(' - ', 3)
148
+ if len(parts) >= 4:
149
+ timestamp, level, name, message = parts
150
+ log_record = LogRecord(level, name, message, timestamp)
151
+ window.log_model.add_log(log_record)
152
+ except Exception:
153
+ pass
154
+
155
+ return window
156
+
157
+
158
+ def launch_dynamic_spectra_dialog(parent=None):
159
+ """
160
+ Launch dialog to create dynamic spectra from MS files.
161
+
162
+ Parameters
163
+ ----------
164
+ parent : QWidget, optional
165
+ Parent widget for the dialog
166
+
167
+ Returns
168
+ -------
169
+ DynamicSpectraDialog
170
+ The dialog instance
171
+ """
172
+ if not DYNAMIC_SPECTRA_CREATOR_AVAILABLE:
173
+ from PyQt5.QtWidgets import QMessageBox
174
+ QMessageBox.warning(
175
+ parent, "Missing Dependencies",
176
+ "Dynamic Spectra Creator requires: casacore, astropy\n\n"
177
+ "Install with: pip install python-casacore astropy"
178
+ )
179
+ return None
180
+
181
+ from .dynamic_spectra_dialog import DynamicSpectraDialog
182
+ dialog = DynamicSpectraDialog(parent)
183
+ dialog.exec_()
184
+ return dialog