Zahner Analysis Software
Basic Informations
The Python library zahner_analysis itself does not perform any calculations with the measurement data. The library communicates with the Zahner Analysis Software via a REST interface.
The Python library is a client for the REST interface of the optional Zahner Analysis module Remote Evaluation.
A circuit model for an impedance measurement can be easily developed with the graphical interface of the Zahner Analysis Software. Likewise, suitable initial values for the fit can be determined with the Magic Wand Preset Element Tool.
With Python the models, which have been created with the GUI, can then be fitted to impedance spectra. The elements and parameters of the equivalent circuit model can be read and processed with python.
With the Python library thales_remote as a supplement, impedance measurements can be performed with a Zennium and immediately evaluated.
The Remote Evaluation module for the REST interface is optional and must be selected during installation.
Analysis Connection Management
- class AnalysisConnection(ip='127.0.0.1', port=8081, tryToConnect=True, tryToStart=True, onlineCheckUrl='/id', apiKey='PyAnalysis', buffer_size=32768, keep_jobs=3, timeToWaitForOnline=10, keepOpen=False)
Class which manages the connection to the Zahner Analysis Software.
The Zahner Analysis Software performs all calculations. The Python library communicates with the Zahner Analysis via a REST interface.
Various optional settings are possible. In the standard configuration it is checked if a Zahner Analysis with server is running, if this is not the case the Zahner Analysis is automatically started and automatically closed again.
- Parameters:
ip – IP address under which the server is found. 127.0.0.1 if it is running on the same computer.
port – Port of the server.
tryToConnect – True to test if the Zahner Analysis Server is reachable.
tryToStart – If tryToConnect is True and tryToStart is True, then the Zahner Analysis is tried to start under windows systems.
onlineCheckUrl – This URL is used to check if the Zahner Analysis can be reached.
apiKey – The key is used as a security feature to prevent others from accessing the Zahner Analysis.
buffer_size – Optimization parameter: The buffer for incomming file uploads. If too small the server has to reallocate bigger amounts of memory more often. Bigger amount means more memory allocation even if not needed.
keep_jobs – Number of finished fitting jobs to keep for the client to download results and check the status.
timeToWaitForOnline – This is the time for which is waited until the Zahner Analysis is online after it has been started. This time varies depending on the speed of the computer.
keepOpen – If this parameter is True, the Zahner Analysis will not be closed when it is no longer needed.
- tryToStartAnalysis(buffer_size=32768, keep_jobs=3, timeToWaitForCheck=10)
Function which tries to start the Zahner Analysis.
This function writes information with the logging module.
- Parameters:
buffer_size – Optimization parameter: The buffer for incomming file uploads. If too small the server has to reallocate bigger amounts of memory more often. Bigger amount means more memory allocation even if not needed.
keep_jobs – Number of finished fitting jobs to keep for the client to download results and check the status.
timeToWaitForOnline – This is the time for which is waited until the Zahner Analysis is online after it has been started. This time varies depending on the speed of the computer.
- isOnline(timeout=0.5)
Returns the online state
This function returns true if the Zahner Analysis can be reached. This function writes information with the logging module.
- Parameters:
timeout – Timeout, for the get command.
- Returns:
True if the Zahner Analysis is online.
- get(url=None, *args, **kwargs)
get request wrapper
This function wraps the get request. Only the relative URL path to the root must be specified. This function automatically adds ip, port and api key.
If a full path with http is specified, then this path will be used and will not be edited.
- Parameters:
url – url for request.
- Returns:
Reply from requests.get
- post(url=None, *args, **kwargs)
post request wrapper
This function wraps the post request. Only the relative URL path to the root must be specified. This function automatically adds ip, port and api key.
If a full path with http is specified, then this path will be used and will not be edited.
- Parameters:
url – URL for request.
- Returns:
Reply from requests.post
- _urlComposer(url)
Composition of the URL
This function composes the URL with IP, port and api key if there is no “http” in the url parameter.
- Parameters:
url – URL relative or absolute.
- Returns:
Composed URL.