Exemple #1
0
class SpectraSettingsController(DialogController):
    item_config = ItemConfig().setMenuPath("View/Plot Settings").setTitle(
        "Spectrogram Settings").addSupportedData(
            DataType.SPECTROGRAM).addSupportedViewer(ViewerType.MPL)

    def setupContent(self, content_widget: QWidget):
        self._ui = Ui_SpectraSettings()
        self._ui.setupUi(content_widget)

    def onDataChanged(self, viewer_ctrl: ViewerController):
        model: CallistoModel = viewer_ctrl.model

        self._ui.vmin_check.setChecked(model.vmin is not None)
        if model.vmin:
            self._ui.vmin_spin.setValue(model.vmin)
        self._ui.vmax_check.setChecked(model.vmax is not None)
        if model.vmax:
            self._ui.vmax_spin.setValue(model.vmax)
        self._ui.substract_background_check.setChecked(
            model.substract_background)
        self._ui.linear_check.setChecked(model.linear)
        self._ui.color_bar_check.setChecked(model.colorbar)

    def modifyData(self, data_model: CallistoModel) -> DataModel:
        data_model.vmin = self._ui.vmin_spin.value(
        ) if self._ui.vmin_check.isChecked() else None
        data_model.vmax = self._ui.vmax_spin.value(
        ) if self._ui.vmax_check.isChecked() else None
        data_model.substract_background = self._ui.substract_background_check.isChecked(
        )
        data_model.linear = self._ui.linear_check.isChecked()
        data_model.colorbar = self._ui.color_bar_check.isChecked()

        return data_model
Exemple #2
0
class QueryCallistoActionController(ActionController):
    item_config = ItemConfig().setMenuPath(
        "File/Open Spectrogram/Callisto/Query")
    content_ctrl: ContentController = RequiredFeature(ContentController.name)

    def onAction(self):
        dlg = QDialog()
        ui = Ui_QueryCallisto()
        ui.setupUi(dlg)

        now = QDateTime.currentDateTimeUtc()
        ui.start_time.setDateTime(now.addSecs(-2 * 60 * 60))
        ui.end_time.setDateTime(now.addSecs(-1.50 * 60 * 60))

        if dlg.exec_():
            start_time = ui.start_time.dateTime().toString(
                QtCore.Qt.ISODate).replace("T", " ")
            end_time = ui.end_time.dateTime().toString(
                QtCore.Qt.ISODate).replace("T", " ")

            executeLongRunningTask(
                CallistoSpectrogram.from_range,
                [ui.instrument.currentText(), start_time, end_time],
                "Downloading", self._openSpectrogram)

    def _openSpectrogram(self, spectrogram):
        viewer_ctrl = CallistoViewerController.fromSpectrogram(spectrogram)
        self.content_ctrl.addViewerController(viewer_ctrl)
Exemple #3
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("History").setMenuPath(
         "Edit/Undo").addSupportedData(DataType.ANY).addSupportedViewer(
             ViewerType.ANY).setShortcut(QtGui.QKeySequence("Ctrl+Z"))
Exemple #4
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Rotate").setMenuPath("Edit/Rotate").addSupportedViewer(
         ViewerType.ANY).addSupportedData(DataType.MAP)
Exemple #5
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Download Results").setOrientation(
         QtCore.Qt.BottomDockWidgetArea)
Exemple #6
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Change DB Settings")
Exemple #7
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Open SV Project")
Exemple #8
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Data Manager").setTitle(
         "Data Manager")
Exemple #9
0
 def item_config(self) -> ItemConfig:
     return ItemConfig()
Exemple #10
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath(
         "Help/Calculate SNR").addSupportedViewer(
             ViewerType.MPL).addSupportedData(DataType.MAP)
Exemple #11
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath(
         "Edit/Crop To Current View").addSupportedViewer(
             ViewerType.MPL).addSupportedData(DataType.MAP)
Exemple #12
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Wavelet Filter").setMenuPath("Tools/Wavelet Filter").addSupportedData(
         DataType.MAP).addSupportedData(DataType.PLAIN_2D).addSupportedViewer(ViewerType.ANY)
Exemple #13
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Highlight Values").setMenuPath(
         "Tools/Highlight Values").addSupportedData(
             DataType.MAP).addSupportedViewer(ViewerType.MPL)
Exemple #14
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("Help/Error Log").setTitle(
         "Error Log").setOrientation(QtCore.Qt.BottomDockWidgetArea)
Exemple #15
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Value Adjustment").setMenuPath(
         "Tools/Adjust Data").addSupportedData(
             DataType.MAP).addSupportedViewer(ViewerType.ANY)
Exemple #16
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("Edit/Composite Map/Coalign").addSupportedViewer(
         ViewerType.ANY).addSupportedData(DataType.MAP_COMPOSITE)
Exemple #17
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Open SunPy Composite Map/From Active")
Exemple #18
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().addSupportedViewer(
         ViewerType.MPL).addSupportedData(DataType.MAP)
Exemple #19
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Event Download Tool").setMenuPath("File/HEK")
Exemple #20
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Contrast Adjustment").setMenuPath("Tools/Contrast").addSupportedViewer(
         ViewerType.MPL).addSupportedData(DataType.MAP)
Exemple #21
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Save As..").addSupportedData(
         DataType.ANY).addSupportedViewer(ViewerType.ANY)
Exemple #22
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Profile").setMenuPath(
         "Tools/Profile").addSupportedData(DataType.MAP).addSupportedViewer(
             ViewerType.MPL)
Exemple #23
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setMenuPath("File/Export/FITS").addSupportedData(
         DataType.MAP).addSupportedViewer(ViewerType.ANY)
Exemple #24
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Select Coloramap").setMenuPath(
         "Edit/Change Colormap").addSupportedViewer(
             ViewerType.MPL).addSupportedData(
                 DataType.MAP).addSupportedData(DataType.PLAIN_2D)
Exemple #25
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().addSupportedData(DataType.ANY).addSupportedViewer(ViewerType.MPL).setMenuPath(
         "View/Plot Settings").setTitle("NDCube Plot Settings")
Exemple #26
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Download Tool").setMenuPath(
         "File/Download Data")
Exemple #27
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Normalization").setMenuPath(
         "Edit/Normalization").addSupportedViewer(
             ViewerType.MPL).addSupportedData(DataType.MAP)
Exemple #28
0
 def item_config(self) -> ItemConfig:
     return ItemConfig().setTitle("Composite Map Settings").setMenuPath(
         "View/Composite Map/Settings").addSupportedData(
             DataType.MAP_COMPOSITE).addSupportedViewer(ViewerType.ANY)