Portable PL Test Equipment: Keeping Sample IDs Attached to the Data
A folder with three files called reading_01.txt, reading_02.txt and reading_03.txt looks tidy enough. Now someone asks which one came from sample PV-017, whether it was taken at the center or the edge, and which settings were active. The filenames don't answer any of that. That is the small software problem I want to look at here. When portable test equipment is used across several samples, the…
A folder containing three files named reading_01.txt, reading_02.txt, and reading_03.txt appears orderly at first glance. However, when someone inquires about the specific sample each file originates from, the location where it was taken, and the settings used, the filenames offer no answers. This scenario highlights a small software issue I aim to address in this article.
When conducting portable test equipment measurements across multiple samples, the saved results should maintain a clear connection to the sample and the measurement setup. My work focuses on technical content for TDM Technology. The hardware example used here is the SE10 portable PL metrology instrument, which features local storage and a Bluetooth connection to a Windows PC.
It's important to note that this product description isn't an API specification; it doesn't define a file-export format or a Bluetooth protocol. The script below begins with an already completed computer file and involves obtaining the necessary files from the actual instrument software, which requires separate confirmation. Instead of starting with the filename, we should begin with the sample.
Each local file will receive a small JSON record, often referred to as a sidecar file, that contains the context without altering the original data. I will start with four references: the sample, the measurement position, the instrument, and the setup. The sample ID is PV-017, the position on a photo or drawing is P03, the instrument is identified as portable-demo-01, and the setup information is labeled as setup-v3.
These references require a place to point to. A setup name loses its value if the underlying settings are overwritten. Similarly, a position label needs a definition that others can follow. The code only records these labels; it cannot verify that the operator selected the correct sample or used the specified settings. To ensure a real workflow, confirmation should be part of the acquisition process rather than reconstructed from memory at the end of the day.
Here's a small Python script that adds metadata to a local file without connecting to the device. Save it as pl_record.py and run it using Python 3.10 or later.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.