Experiment Model

Experiment model

Building a model for the experiment allows developers to have a clear picture of the logic of their experiments. It allows to build simple GUIs around them and to easily share the code with other users.

class PFTL.model.experiment.Experiment(config_file)[source]

Experiment to measure the IV curve of a diode

Parameters:

config_file (str) – Path to the config file. Should be a YAML file, later used by load_daq()

do_scan()[source]

Does a scan. This method blocks. See start_scan() for threaded scans.

finalize()[source]

Finalize the experiment, closing the communication with the device and stopping the scan

load_config()[source]

Load the configuration file

load_daq()[source]

Load the DAQ. Works with DummyDaq or AnalogDaq

Note

The import of DummyDaq or AnalogDaq happen in this method. It is not best practice, but shows a pattern that is allowed by Python and exploited by many developers. It allows to dynamically load modules if we need them which opens interesting alternatives to having the full program developed.

save_data()[source]

Save data to the folder specified in the config file.

start_scan()[source]

Start a scan on a separate thread

stop_scan()[source]

Stops the scan.

Warning

It does not wait for the scan to actually finish. That behavior needs to be handled by the user.