Tool for automatic analysis of multiple TGA results
Project description
Thermogravimetric Analysis in Python
The tga_data_analysis tool automates the typical analysis of thermogravimetric analysis (TGA) data, saving time, avoiding human error, and increasing comparability of results from different groups.
Framework
File
A .txt or .csv file located in the project folder that contains time, temperature, and mass loss information for a measure.
Depending on the instrument export parameter, the structure of Files can differ slightly. Project-Parameters ensure that the loading process can lead to the same data structure to allow to perform all downstream computations.
A good naming convention for Files consists in using _ to ONLY indicate replicates ("A_1", "A_2", or long-sample-name_1, not "name_with_underscores_1").
Sample
A collection of Files that replicate the same measure and ensure reproducibility.
If the Project-Parameters do not apply to a specific Sample, their values can be modified for a single Sample instance.
The Files in the Sample are identified by their names and loaded.
Each numerical (ex. ash) or array value (ex. the time vector) from each Files is stored as a replicate using the Measure class, which provides access to each replicate of the value but also to average and standard deviation for each value.
The mass loss profile for each replicate are projected on a common temperature vector thus avoiding asynchronies and artifact peaks in the average values due to instrumental micro-delays. The original temperature, time, and mass loss vector are stored for each File.
Single-sample Analyses methods are provided to perform common TGA data analysis at the Sample level:
-
Proximate Analysis: determines the moisture, volatile matter, and ash content from TGA data. -
Oxidation Analysis: Analyzes the oxidation behavior of materials. -
Solid-Distillation Analysis: Studies the thermal decomposition and distillation characteristics of solids. -
Peak Deconvolution Analysis: Resolves overlapping thermal decomposition events.
The Sample class can generate multi-replicate reports and multi-replicate plots for TG and DTG curves and for the results of any of the Single-sample Analyses.
Project
The folder path indicates where the Files are located and where the output folder will be created.
The Project-Parameters are valid for each Sample unless specified at the Sample initialization.
Samples can be added using the add_sample method or by specifying the Project to a new Sample instance during initialization.
The Project can generate reports and plots using the following methods:
-
multireport: Generate a multi-sample report based on the specified report type and style -
plot_multi_tg: Plot multiple thermogravimetric (TG) curves for the given samples. -
plot_multi_dtg: Plot multiple derivative thermogravimetric (DTG) curves for the given samples. -
plot_multi_soliddist: Plot multiple solid distribution curves for the given samples. -
plot_multireport: Plot the results for the multi-sample report
Multi-sample Analyses
For analysis that require data from multiple samples (ex. KAS kinetics), a multi-sample class that includes multiple Sample objects is defined (ex. KasSample).
Multi-sample classes provide the methods to perform the dedicated analysis and plot the results. The available ones are
KAS Kinetic Analysis: Applies the Kissinger-Akahira-Sunose method to determine kinetic parameters.
Project-Sample-Parameters
If specified at the Project level become the default for all Samples and therefore Files. They can be overwritten for each single Sample instance. The most important are described here, see the docs for the rest.
-
load_skiprowsan int that indicates the number of rows that must be skipped in the file at loading. The first valid row should be the one that contains the name of the columns ("time", "temperature", "tg"; these are just examples). -
column_name_mappinga dictionary used to specify how to rename the columns in theFileto the standard names that the software can reliably use. These names aret_min,T_C,m_p, andm_mgfor time, temperature, mass percentage, and mass in mg, respectively. At least the first three must be present (if m_mg is missing, it is assumed to be equal to m_p). -
time_moist: The time in minutes where the mass loss should be considered moisture. -
time_vm: The time in minutes where the mass loss should be considered volatile matter. -
temp_initial_celsius: The initial temperature where everyFileis going to start to ensure uniformity. -
temp_lim_dtg_celsius: The temperature limits for DTG analysis, in Celsius. It should exclude moisture and fixed carbon segments. -
temp_unit: The unit of temperature the project will convert everything to, not the unit in theFiles. -
dtg_basisandresolution_sec_deg_dtg: these parameters are no longer available and raise exceptions if specified. The dtg curve is now only computed as dTG/dtime (temperature is used for plotting), but replicates are not interpolated anymore so the resolution reflects the data resolution from the machine. -
dtg_window_filter: The window size for the Savitzky-Golay filter used to smooth the DTG curve. -
temp_i_temp_b_threshold: The fractional threshold for the detection of Ti (t_ignition) and Tb (burnout) calculation in DTG analysis.
Example
If files start with 10 method rows before the real data and the columns are names "time/minutes", "temp/C", and "m/%",
then the Project-Parameters should be:
load_skiprows=10
column_name_mapping={"time/minutes": "t_min", "temp/C": "T_C", "m/%": "m_p"}
Documentation
Check out the documentation.
Installation
You can install the package from PyPI:
pip install tga_data_analysis
Examples
Each example is available as a folder in the examples folder and contains the code and the necessary input data.
To run examples:
- Install
tga_data_analysisin your Python environment - Download the folder that contains the example
- Run the code
- If you run the scripts as Jupyter Notebooks, replace the relative path at the beginning of each example with the absolute path to the folder where the code is located
Nomenclature
- ar: as received
- db: dry basis
- daf: dry, ash-free
- vm: volatile matter
- fc: fixed carbon
Plotting with myfigure
Plots rely on the package myfigure, a package to simplify
Check out the documentation and
GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tga_data_analysis-2.2.0.tar.gz.
File metadata
- Download URL: tga_data_analysis-2.2.0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8c6376c598000d6f3ab2c78501a4c11cb0e5aac11ec83aee353dab2999d7920
|
|
| MD5 |
8df044b022117688d5157d1dc6fcc3c5
|
|
| BLAKE2b-256 |
a3e64162947cb37fc0a9c2f8b3868838a879f357c3344e923a8de90e6ff47f4b
|
File details
Details for the file tga_data_analysis-2.2.0-py3-none-any.whl.
File metadata
- Download URL: tga_data_analysis-2.2.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0bd0e87bd46fce4b620b8a9ca9822983545c924089f227f17936de17814d75b
|
|
| MD5 |
dddc72c9b0b59d9de2911e600a98cc87
|
|
| BLAKE2b-256 |
d9e596cf2e2d62ad5bd950ade39df1211eb4b330200770356367b92418f9e756
|