Process data exported from the C-Therm TCi thermal conductivity analyzer.
If you already have Python 3.11 and the Python launcher installed on Windows/Linux/MacOS, you may run process_data.py with pipx by first downloading it (or copy/pasting its contents into a locally-saved script) and running e.g.
py -3.11 -m pipx run process_data.pyIn this case, pipx knows what packages process_data.py needs from inline metadata specified in a comment. You may need to install pipx and ensure that its packages are available in your PATH with
py -3.11 -m pip install pipx
py -3.11 -m pipx ensurepathPython 3.11 or higher and the Python can be installed on Windows, Linux, or MacOS. If on Windows, install Python from here rather than from the more limited Microsoft Store install. If on MacOS or a UNIX-like system, install the Python Launcher or obtain different Python versions as needed from deadsnakes.
The structure of data.xml, exported from the C-Therm TCi instrument, is such that all data are contained within the NewDataSet node. Each test run is associated with a UserTest. This record stores the user, method, project, material group (indirectly), material, and lot. The relationships between nodes of interest are as follows:
- Each
UserTesthas aDataPool_id. - The
DataIntervals with matchingDataPool_idhave aDataInterval_id. - A
DataSamplewith matchingDataInterval_idhas the data for a single measurement.
This record stores the time, validity, ambient temperature, effusivity, and thermal conductivity. Additional fields may be obtained from the data by reference to this procedure.
If you'd like to run tests, modify this script in-place, or develop it further, you may want to follow developer setup steps. Clone or download this Gist and run setup.ps1 in cross-platform PowerShell terminal window. If you open the downloaded Gist folder in VSCode, open a new terminal (Ctrl+`) and run setup.ps1 there. If on Windows, you may need to complete Task 1 in this guide to allow scripts to run. The setup.ps1 script essentially does the following:
- Updates
.gitignore'd tooling from the template repo - Installs
uvif needed - Determines the Python version to install from
process_data.pyinline metadata - Synchronizes a virtual environment with the dependencies for
process_data.pyfrom its inline metadata
See a more in-depth guide for first-time setup instructions on a new machine, or if this is your first time using Python. Now you can run Python scripts in this Gist, in an activated terminal window, for example like python example.py. If you plan to modify this code or use it as a starting point for your own development, the template from which this Gist is derived details the additional VSCode tooling available.