Example data processing

class DataManager(dataReceiver)

Example class that shows how to get the data from the object structure and use it further.

This is not a ready-made optimization, just a simple example that needs to be adapted to your own use case.

In the future, methods will be added to save the data in Zahner formats, which Zahner Analysis can then open.

Parameters

dataReceiver (DataReceiver) – DataReceiver object with data from device.

plotTIUData(filename: Optional[str] = None, width: Optional[float] = None, height: Optional[float] = None) None

Plot data example.

This is an example to plot the data after the measurement. For plotting the data matplotlib is used. For this purpose a simple class DCPlot was implemented, with which current and voltage can be plotted over time.

If nothing is passed, only a window is opened and the data is plotted. If a filename is passed, the plot is saved under the filename. The documentation for saving must be taken from the documentation of savePlot().

Parameters
  • filename – The path, filename and filetype of the file if it should be saved, else None.

  • width – The width of the file to save in inch,

  • height – The height of the file to save in inch.

saveDataAsText(filename: str) None

Save data example.

This is an example to save the data after the measurement.

The data is stored with the standard python decimal separator. As separator ; and a tabulator is used, so the file is easily readable. It is deliberately not used a “,” as column separator, because this is for example in Germany the decimal separator.

It is only an example that needs to be adapted, Zahner does not want to implement all the different localizations in order to be able to open the csv file in all countries with Excel, for example. Since this repository is actually only a programming interface to the devices.

In the future, methods will be added to save the data in Zahner formats, which Zahner Analysis can then open.

Parameters

filename – The path, filename and filetype of the file if it should be saved.