Data module

class lys.widgets.canvas.interface.Data.CanvasData(canvas)[source]

Bases: CanvasPart

Append(wave, axis='BottomLeft', appearance={}, offset=(0, 0, 0, 0), filter=None, contour=False, vector=False)[source]

Append Wave to graph.

Data type is determined by the shape and dtype of wave in addition to contour and vector.

When 1-dimensional data is added, line is added to the graph.

When 2-dimensional real data is added and contour is False, image is added.

When 2-dimensional real data is added and contour is True, contour is added.

When 2-dimensional complex data is added and vector is False, it is converted to RGB colormap data.

When 2-dimensional complex data is added and vector is True, it is added as vector map.

When 3-dimensional data is added and its shape[2] is 3 or 4, it is added as RGB(A) color map data.

See Line.LineData, Image.ImageData, Contour.ContourData, Vector.VectorData, RGB.RGBData for detail of each data type.

Parameters
  • wave (Wave) – The data to be added.

  • axis ('BottomLeft', 'BottomRight', 'TopLeft', or 'TopRight') – The axis to which the data is added.

  • appearance (dict) – The dictionary that determins appearance. See WaveData.saveAppearance() for detail.

  • offset (tuple of length 4) – See WaveData.setOffset()

  • filter (filter) – See WaveData.setFilter()

  • contour (bool) – See above description.

  • vector (bool) – See above description.

Clear()[source]

Remove all data from canvas.

Remove(obj)[source]

Remove data from canvas.

Parameters

obj (WaveData) – WaveData object to be removed.

dataChanged

pyqtSignal that is emittd when data is added/removed/changed.

getContours()[source]

Return all ContourData in the canvas.

getImages()[source]

Return all ImageData in the canvas.

getLines()[source]

Return all LineData in the canvas.

getRGBs()[source]

Return all RGBData in the canvas.

getVectorFields()[source]

Return all VectorData in the canvas.

getWaveData(type='all')[source]

Return list of WaveData object that is specified by type.

Parameters

type ('all', 'line', 'image', 'rgb', 'vector', or 'contour') – The data type to be returned.