Sequential FBRM Total Counts onset detection using measured/interpolated temperature.
The tool is intended for FBRM Total Counts data aligned with measured/interpolated Tr (°C), typically in a file named ts-fbrm-tr.csv.
Tr_regularis not used.- Final FBRM onset temperatures are reported on the measured/interpolated
Tr (°C)axis. - The script writes standardized CSV, JSON, text report, and diagnostic PNG outputs.
- FBRM results should be checked visually, especially when the curve shape is ambiguous.
The script detects FBRM onsets sequentially from the start of the cooling period. It works on the original input order and does not sort the data by temperature.
The basic idea is:
-
Determine the start of the cooling region.
-
Estimate an initial clear-solution baseline from the early valid FBRM signal.
-
Smooth the FBRM Total Counts signal for robust onset detection.
-
Search for candidate points where the signal leaves the previous baseline or trend.
-
Test whether each candidate is physically meaningful:
- the signal must rise above the local baseline/trend,
- the rise must be sustained,
- a small local bump is not enough,
- a rejected T1-like candidate does not consume the T1 slot; the search continues to later candidates.
-
Accept at most the requested number of onsets.
-
Write accepted onsets, all candidates, rejection reasons, parameters, reports, and plots.
The detector is designed for FBRM Total Counts curves where the first crystallization-related change may be small or gradual, while later changes may be steeper. It does not force the requested number of onsets: the output may contain zero, one, or more accepted onsets depending on the data and parameters.
Run inside a directory containing ts-fbrm-tr.csv:
./fbrm-onsets.py
The default output directory is:
fbrm_onsets/
fbrm_onsets/fbrm-onsets.csv
fbrm_onsets/fbrm-onset-candidates.csv
fbrm_onsets/fbrm-onset-params.json
fbrm_onsets/fbrm-onset-report.txt
fbrm_onsets/fbrm-onset-publication.png
fbrm_onsets/fbrm-onset-diagnostic.png
fbrm_onsets/fbrm-onset-candidates.png
Accepted onset points. Each accepted onset includes its label, temperature, Total Counts value, acceptance mode, and related diagnostic values.
All detected candidate points, including accepted and rejected candidates. Rejected candidates include rejection reasons. This file is useful for visual quality control and troubleshooting.
Parameters and metadata used in the run. This file is intended to make the analysis reproducible.
Human-readable text summary of the run.
The script writes three plots:
fbrm-onset-publication.png
fbrm-onset-diagnostic.png
fbrm-onset-candidates.png
The publication plot shows the raw and smoothed Total Counts signal with accepted onsets. The diagnostic plot includes additional derivative panels. The candidates plot shows accepted and rejected candidate points.
By default, the script reports at most two accepted FBRM onsets:
./fbrm-onsets.py
More onsets can be requested explicitly:
./fbrm-onsets.py --onsets 3
This does not force three onsets. It reports 0..N accepted onsets, where N is the requested maximum.
The default input file is:
ts-fbrm-tr.csv
Expected default columns:
Tr (°C)
Total Counts
The column names can be changed with command-line options if needed.