Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • software_public/passoft/sohstationviewer
1 result
Show changes
Commits on Source (2)
# Change TPS Color Range
<br />
<br />
<img alt="Change TPS Color Range" src="images/tps/tps_color_range.png" height="100" />
<br />
<br />
---------------------------
---------------------------
## TPS plot
The TPS plot shows the square root of the average of the sum of the squares of
the data amplitudes over each 5-minute period of each day covering the time
range of the data on the main display. Each horizontal line is one UT day.
Each 5-minute block is color-coded according to the average amplitude
during the period.
<br />
## Selecting Color Range
Select the desired color range from the dropdown list. There are 4 different
color ranges in the list: Antarctica, Low, Medium and High
<br />
**Antarctica**
* Dark Grey/Black: there was no data for that period or the average really
was 0.0 (not likely)
* Dark blue: the average was +/-10 counts
* Cyan: +/-100 counts
* Green: +/-1,000 counts
* Yellow: +/-10,000 counts
* Red: +/-100,000 counts
* Magenta: +/-1,000,000 counts
* Light Grey/White: > +/-1,000,000 counts
<br />
**Low**
* Dark Grey/Black: there was no data for that period or the average
really was 0.0 (not likely)
* Dark blue: the average was +/-20 counts
* Cyan: +/-200 counts
* Green: +/-2,000 counts
* Yellow: +/-20,000 counts
* Red: +/-200,000 counts
* Magenta: +/-2,000,000 counts
* Light Grey/White: > +/-2,000,000 counts
<br />
**Medium**
* Dark Grey/Black: there was no data for that period or the average really
was 0.0 (not likely)
* Dark blue: the average was +/-50 counts
* Cyan: +/-500 counts
* Green: +/-5,000 counts
* Yellow: +/-50,000 counts
* Red: +/-500,000 counts
* Magenta: +/-5,000,000 counts
* Light Grey/White: > +/-5,000,000 counts
<br />
**High**
* Dark Grey/Black: there was no data for that period or the average really
was 0.0 (not likely)
* Dark blue: the average was +/-80 counts
* Cyan: +/-800 counts
* Green: +/-8,000 counts
* Yellow: +/-80,000 counts
* Red: +/-800,000 counts
* Magenta: +/-8,000,000 counts
* Light Grey/White: > +/-8,000,000 counts
<br />
## Applying the selected Color Range
Click button "RePlot" to re-plot TPS with new selected color range.
<br />
documentation/images/tps/tps_color_range.png

17.9 KiB

No preview for this file type
......@@ -87,6 +87,7 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
:param end_tm: requested end time to read
"""
self.is_working = True
self.set_key = key
self.plotting_data1 = d_obj.waveform_data[key]
self.plotting_bot = const.BOTTOM
......@@ -458,13 +459,28 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
for processor in self.tps_processors:
processor.request_stop()
def replot(self):
"""
Reuse tps_data calculated in the first plotting to replot
with new color range selected.
"""
self.clear()
self.plotting_bot = const.BOTTOM
title = get_title(self.set_key, self.min_x, self.max_x, self.date_mode)
self.timestamp_bar_top = self.plotting_axes.add_timestamp_bar(0.)
self.plotting_axes.set_title(title, y=0, v_align='bottom')
for chan_id in self.plotting_data1:
c_data = self.plotting_data1[chan_id]
self.plot_channel(c_data, chan_id)
self.done()
class TimePowerSquaredDialog(QtWidgets.QWidget):
def __init__(self, parent):
"""
Dialog to display time power square data for waveform channels. Users
are allowed to select different Color Ranges (antarctica, low,
medium, high) for differences values vs. colors map to draw
are allowed to select different Color Ranges (Antarctica, Low,
Medium and High) for differences values vs. colors map to draw
time power square for each 5-minute data
:param parent: QMainWindow/QWidget - the parent widget
......@@ -503,8 +519,13 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
bottom_layout.addSpacing(20)
main_layout.addLayout(bottom_layout)
buttons_layout = QtWidgets.QVBoxLayout()
bottom_layout.addLayout(buttons_layout)
# ################ Color range #################
bottom_layout.addWidget(QtWidgets.QLabel("Color Range"))
color_layout = QtWidgets.QHBoxLayout()
buttons_layout.addLayout(color_layout)
color_layout.addWidget(QtWidgets.QLabel("Color Range"))
"""
color_def: [str,] - list of color codes in order of values to be
......@@ -521,7 +542,7 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
self.sel_col_labels = []
"""
color_ranges: [str,] - name of color:value map for user to choose
'antarctica'/'low'/'med'/'high'
'Antarctica'/'Low'/'Medium'/'High'
all_square_counts: [[int,],] - time-power-squared values
color_label: [str,] - labels that define count range for colors to show
in the legend of the tps plotting widget
......@@ -536,11 +557,15 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
"""
self.color_range_choice = QtWidgets.QComboBox(self)
self.color_range_choice.addItems(self.color_ranges)
self.color_range_choice.setCurrentText('high')
bottom_layout.addWidget(self.color_range_choice)
################################################
self.color_range_choice.setCurrentText('High')
color_layout.addWidget(self.color_range_choice)
# ##################### Replot button ########################
self.replot_button = QtWidgets.QPushButton("RePlot", self)
buttons_layout.addWidget(self.replot_button)
# ##################### Save button ##########################
self.save_button = QtWidgets.QPushButton('Save', self)
bottom_layout.addWidget(self.save_button)
buttons_layout.addWidget(self.save_button)
self.info_text_browser.setFixedHeight(60)
bottom_layout.addWidget(self.info_text_browser)
......@@ -574,6 +599,7 @@ class TimePowerSquaredDialog(QtWidgets.QWidget):
Connect functions to widgets
"""
self.save_button.clicked.connect(self.save)
self.replot_button.clicked.connect(self.plotting_widget.replot)
self.color_range_choice.currentTextChanged.connect(
self.color_range_changed)
......
......@@ -165,7 +165,7 @@ class TestExtractData(unittest.TestCase):
names, all_counts, all_display_strings = get_color_ranges()
num_color_def = 7
expected_names = ['antarctica', 'low', 'med', 'high']
expected_names = ['Antarctica', 'Low', 'Medium', 'High']
self.assertEqual(names, expected_names)
# Check that each name correspond to a list of counts and list of
......