basic

class pdsspect.basic.BasicHistogramModel(*args, **kwargs)[source]

Bases: pdsspect.histogram.HistogramModel

Model for the hhistograms in the Basic Widgets

connected_models

list – Other BasicHistogramModel for other histograms

bins

int The number of bins the histogram uses

Setting the bins will notify the views that the bins have changed

connect_model(model)[source]

Connect another model to this model

model

BasicHistogramModel – Connect the model to current model

Raises:ValueError – When model is not BasicHistogramModel
cut_high

float The higher cut level

Setting the high cut value will adjust the cut values in the image view and notify the views that the high cut value changed.

cut_low

float The lower cut level

Setting the low cut value will adjust the cut values in the image view and notify the views that the low cut value changed

cuts

tuple The lower and higher cut levels.

Setting the cuts will adjust the cut levels in the image viewer and notify the views that the cuts have changed. The low cut must be less than the high cut, otherwise they will be switched to satisfy that condition.

data

ndarray The current image data

disconnect_from_all_models()[source]

Disconnect all models from this model

disconnect_model(model)[source]

Disconnect another model from this model

model

BasicHistogramModel – Disconnect the model from current model

Raises:ValueError – When model is not BasicHistogramModel
image_view

ImageViewCanvas The image view canvas

Setting the image view will reset the data

register(view)

Register a view with the model

Parameters:view (QtWidgets.QWidget) – A view that utilizes this model
restore()

Restore the cut levels

set_data()

Set the data the histogram is to display

unregister(view)

Unregister a view with the model

Parameters:view (QtWidgets.QWidget) – A view that utilizes this model
view_cuts

tuple The image_view cut levels

warn(title, message)

Display a warning box

Each view must define a warn method that returns a boolean value: True when a warning box is displayed and False when a warning box not displayed. Only one display box will be displayed. This is because multiple views should not have different handling for the same errors.

class pdsspect.basic.BasicHistogramController(model, view)[source]

Bases: pdsspect.histogram.HistogramController

Controller for histogram views

Parameters:
model

BasicHistogramModel – histogram model

view

object – View with BasicHistogramModel as its model

restore()[source]

Restore the histogram

set_cut_high(cut_high)[source]

Set the high cut level to a new value

Parameters:cut_high (float) – New high cut value
set_cut_low(cut_low)[source]

Set the low cut level to a new value

Parameters:cut_low (float) – New low cut value
set_cuts(cut_low, cut_high)[source]

Set both the low and high cut levels

Parameters:
  • cut_low (float) – New low cut value
  • cut_high (float) – New high cut value
class pdsspect.basic.BasicHistogramWidget(*args, **kwargs)[source]

Bases: pdsspect.histogram.HistogramWidget

HistogramWidget in a different layout

class pdsspect.basic.BasicController(image_set, view)[source]

Bases: object

Controller for Basic window

Parameters:
image_set

PDSSpectImageSet – pdsspect model

view

Basic – View to control

change_current_image_index(new_index)[source]

Change the current image index to a new index

Parameters:new_index (int) – The new index for images to determine the current image
class pdsspect.basic.BasicWidget(image_set, view_canvas)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget to hold each basic window

Parameters:
image_set

PDSSpectImageSet – pdsspect model

basics

list of BasicBasic in the widget

add_basic(image_set, view_canvas)[source]

Add a Basic to the widget

Parameters:
connect_model(basic)[source]

Connect the models of other basic windows to the given window

The models are connected when they have the same current image

Parameters:basic (Basic) – Basic window connect/disconnect its histogram model to others
class pdsspect.basic.Basic(image_set, view_canvas, basic_widget)[source]

Bases: PyQt5.QtWidgets.QWidget, pdsspect.pdsspect_image_set.PDSSpectImageSetViewBase

Window to apply cut levels and choose the current image

Parameters:
image_set

PDSSpectImageSet – pdsspect model

view_canvas

PDSImageViewCanvas – Canvas to view the image

controller

BasicController – Controller for view

image_menu

QtWidgets.QComboBox – Drop down menu to pick the current image

histogram

HistogramModel – Model for the histogram_widget

histogram_widget

BasicHistogramWidget – The histogram widget to adjust the cut levels

layout

QtWidgets.QVBoxLayout – The main layout

change_image(new_index)[source]

Change the image when new image selected in image_menu

Parameters:new_index (int) – The new index to determine the current image
set_image()[source]

When the image is set, adjust the histogram