An Adaptive Energy Calibration Method for Timepix3 Detectors
By using an adaptive energy calibration method, the distortion and peak shift problems of the Timepix3 detector in energy spectrum calibration were solved, achieving more efficient and accurate energy calibration, simplifying the experimental process and improving data processing speed.
Patent Information
- Application Number
- CN202511264603.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-09-05
AI Technical Summary
In soft X-ray energy spectrum calibration, the Timepix3 detector suffers from energy spectrum distortion and energy peak position shift due to charge sharing effect, excessive exposure time, and inappropriate threshold settings, which existing methods cannot effectively solve.
An adaptive energy calibration method is adopted. Photon event data is collected, sorted and mapped to an empty matrix, pixel clusters are searched, area and count value are recorded, the sum of count values is compensated, energy spectrum is plotted, Gaussian fitting and linear fitting are performed, and the relationship between pixel cluster volume and energy is established.
The optimized energy calibration method improves operational robustness, reduces the requirements for radiation source intensity and detector parameter settings, accurately restores the location and size of photon energy deposition, and improves data processing speed and energy peak identification accuracy.
Smart Images

Figure CN120762086B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of plasma diagnostic technology, and particularly relates to an adaptive energy calibration method for a Timepix3 detector. Background Technology
[0002] In magnetic confinement fusion research, the interaction between fast particles and magnetohydrodynamic (MHD) instability is a key physical process affecting the plasma confinement performance and particle loss of tokamaks. This interaction can be directly observed through high-precision soft X-ray radiation diagnostics. The Timepix3 detector can acquire information such as the energy, arrival time, and coordinates of individual X-ray photon events. Therefore, accurate energy calibration of the detector is essential.
[0003] The Timepix3 detector boasts excellent spectral resolution, enabling the detection of photons across diverse energy ranges. In the detector's over-threshold time (TOT) mode, photons interact with detector pixels, recording their energy as a single-photon event. However, due to charge-sharing effects, photon energy may be absorbed by adjacent pixels, leading to pixel clusters—the energy of a single photon deposited across multiple neighboring pixels. Furthermore, if the radiation source intensity is too high and the exposure time too long, the energy information from photons arriving at the same pixel from different points in time can overlap, resulting in a decrease in the number of photon events and an increase in energy. During energy calibration, setting the detector threshold too high can cause the loss of energy information deposited in adjacent pixels, resulting in spectral distortion.
[0004] In the energy calibration of traditional photon counting detectors, a weak radiation source is typically used, and the energy spectrum of a single pixel is obtained by reducing exposure time and setting the smallest possible threshold. Some detectors can operate in special modes; for example, the Medipix3 detector has a charge summation mode that dynamically examines the charges generated in any four-pixel matrix. The charges are allocated to the pixel with the highest signal intensity, reducing the impact of charge sharing effects to some extent. Current methods cannot effectively solve the energy spectrum distortion problems caused by charge sharing effects, excessively long exposure times, and inappropriate threshold settings during the energy calibration of the Timepix3 detector. Summary of the Invention
[0005] This invention proposes an adaptive energy calibration method for the Timepix3 detector to address systematic errors caused by charge sharing, excessive exposure time, and threshold settings in soft X-ray energy spectrum calibration of the Timepix3 detector. It eliminates spectral distortion and energy peak position shifts caused by non-ideal physical processes within the detector itself, thereby improving the accuracy of energy calibration.
[0006] The specific technical solution of this invention is as follows:
[0007] An adaptive energy calibration method for a Timepix3 detector includes the following steps:
[0008] Step 1: Collect photon event data using the Timepix3 detector. The photon event data includes arrival time, coordinates, and energy information.
[0009] Step 2: Sort the photon events containing coordinate and energy information according to their arrival time to obtain a photon event sequence;
[0010] Step 3: Map the sorted photon event sequence to an empty matrix using a time window sliding method, search and record the area and count value of pixel clusters, i.e., the sum of energy information, and then compensate the count value according to a set threshold.
[0011] Step 4: Classify by pixel cluster area, sum the pixel count values within each pixel cluster to obtain the pixel cluster volume, and draw a statistical histogram of the pixel cluster volume to form an energy spectrum;
[0012] Step 5: Identify the energy peaks of each energy spectrum and perform Gaussian fitting. Calculate the peak abscissa based on the linear weighting of the pixel cluster proportions of different areas to establish the correspondence between pixel cluster volume and actual energy.
[0013] Step 6: Perform energy calibration by linearly fitting multiple sets of pixel cluster volume and actual energy data.
[0014] The present invention has the following beneficial effects:
[0015] 1. The energy calibration method for the Timepix3 detector has been optimized, improving operational robustness and adapting to complex environmental conditions. In traditional photon-counting detector energy calibration experiments, it is necessary not only to find a weak radiation source but also to adjust parameters such as detector threshold and exposure time to obtain a sufficient number of non-overlapping pixel clusters. This invention utilizes the raw photon event data collected by the detector to reconstruct pixel clusters from photon events within a defined time window, and compensates for the sum of pixel cluster counts based on the detector's set threshold. This effectively avoids pixel cluster stacking, reduces the requirements for setting parameters such as radiation source intensity, detector threshold, and exposure time, and simplifies the experimental procedure.
[0016] 2. Effectively alleviates the problems of photon energy loss and inaccurate energy deposition location caused by charge sharing effect. By restoring photon events into pixel clusters and compensating for the sum of pixel cluster counts according to the detector's set threshold, the energy deposition location and energy magnitude of a single X-ray photon are accurately restored.
[0017] 3. Increase data processing speed. By using translation mapping transformation to reduce the 512×512 matrix to a 256×256 or smaller matrix, this processing method effectively preserves the positional relationships between photon events and significantly improves the search efficiency of pixel clusters.
[0018] 4. Energy peak identification and energy peak position offset calibration. Discard inaccurate points in the low-energy part on the left side of the energy spectrum that are affected by noise and threshold settings, perform Gaussian fitting to obtain the abscissa (pixel cluster volume) corresponding to the energy peak of pixel clusters of different areas, and finally use linear weighting to calibrate the offset peak. Attached Figure Description
[0019] Figure 1 Experimental setup diagram;
[0020] Figure 2 : Schematic diagram of pixel clusters;
[0021] Figure 3 : Pixel cluster recovery flowchart;
[0022] Figure 4 : Schematic diagram of translation mapping;
[0023] Figure 5 Schematic diagram of the characteristic X-ray fluorescence spectrum of metallic zirconium;
[0024] Figure 6 Energy peak identification, Gaussian fitting, peak horizontal axis plot. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above objectives, this invention adopts the following technical solution.
[0026] This invention proposes an adaptive energy calibration method for the Timepix3 detector, comprising the following steps:
[0027] Step 1. Data Acquisition. The radiation source is selected from the characteristic X-ray fluorescence of metallic materials excited by a synchrotron radiation source. A sufficiently long exposure time is set in the overthreshold time mode of the Timepix3 detector to ensure a sufficient number of photon events are acquired.
[0028] Step 2. Data Preprocessing. After acquiring data, the Timepix3 detector saves it in both image and raw data formats. The Timepix3 detector has event-driven capabilities, and the saved raw data contains the arrival time, coordinates, and energy information of photon events. The arrival time, coordinates, and energy information of each photon event are extracted from the raw data, and the sequence containing photon event coordinates and energy information is sorted according to the arrival time of the photon events.
[0029] Step 3. Pixel Cluster Recovery. Initialize an empty matrix based on the size of the Timepix3 detector pixel array and set an appropriate time window. Extract photon event information, including coordinates and energy, sequentially from the sequence according to the set time window. Fill in the corresponding position in the empty matrix with the energy information of each photon event based on its x and y coordinates. After the photon event information within the current time window has been extracted, search for pixel clusters in the matrix and classify them according to their area. Record the count value of each pixel cluster. A pixel cluster consists of one or more pixels, and the total count value of a pixel cluster is obtained by summing the count values of all pixels constituting that cluster. The count value of each pixel represents the energy of the photon event, which is the total recorded energy information (pixel cluster volume). After all pixel clusters within the current time window have been recorded, slide the time window and clear the matrix. Repeat the above process of extracting, searching, and recording pixel clusters until all photon events have been recovered into pixel clusters.
[0030] An inappropriate threshold setting may lead to energy loss deposited in adjacent pixels. After obtaining the recovered pixel clusters, the threshold set during acquisition needs to be adjusted based on the noise generated by the detector itself and the noise level of the current experimental environment to ensure that data acquisition is not affected by noise and that a sufficient number of photon events can be collected. A threshold set too low will be subject to noise interference, while a threshold set too high will fail to effectively acquire photon events. The sum of the count values for the pixel clusters is then compensated based on the number of pixels in the cluster and the currently set threshold. Let the sum of the compensated count values be... The sum of the count values before compensation is If the number of pixels in a pixel cluster is n, and the compensation coefficient is k, which is determined by the set threshold, then... .
[0031] It is important to note that the time window length needs to be set reasonably. The time window length should ensure that photon events belonging to the same pixel cluster are included within the same time window, while preventing pixel clusters from stacking. In actual data processing, the time window size is set to 1000ns to 10000ns. A longer time window can increase data processing speed, but it increases the probability of different pixel clusters stacking, making it impossible to accurately separate each pixel cluster. If the time window is set too short, it may divide large pixel clusters into several smaller pixel clusters, causing tailing effects in the low-energy band of the spectrum, and also increasing data processing time.
[0032] Step 4. Energy Spectrum Plotting. Plot the energy spectrum according to the area of each pixel cluster. Sum the count values of each pixel within the pixel cluster to obtain a value, called the pixel cluster volume. Plot statistical histograms of the pixel cluster volumes for pixel clusters of different areas; these statistical histograms are the pixel cluster energy spectra.
[0033] Step 5. Energy Peak Identification. Identify energy peaks from all pixel cluster energy spectra and perform Gaussian fitting. The intensity and location of peaks differ for pixel cluster energy spectra of different areas. Calculate the proportion of pixel clusters of different areas and use linear weighting to obtain the x-coordinate of the peak position. The x-coordinate of the peak position (pixel cluster volume) corresponds to the actual energy of the peak, thus obtaining a set of pixel cluster volumes and corresponding energies.
[0034] Step 6. Complete energy calibration. Based on the input data, obtain multiple sets of pixel cluster volumes and corresponding energies. Use linear fitting to obtain the relationship between pixel cluster volume and energy information, and complete the energy calibration.
[0035] In step 1, the radiation source utilizes the characteristic X-ray fluorescence of metallic materials. Specifically, as follows: Figure 1 As shown, different metal foils are irradiated using a synchrotron radiation source to excite their characteristic X-rays. The detector is set to a sufficient exposure time to obtain a sufficient number of photon events.
[0036] In step 2, pixel cluster recovery, searching, and recording are specifically as follows:
[0037] If a pixel is the center of a larger pixel, and there are count values among the eight neighboring pixels around that pixel, then all pixels with count values belong to the same pixel cluster. Figure 2 It is represented as a pixel cluster, and the numerical value represents the pixel count, i.e., energy information.
[0038] Pixel cluster recovery process, such as Figure 3As shown. Sort all photon events by arrival time and set a time window of appropriate length. Initialize an empty matrix of size 512×512, and fill the corresponding positions in the matrix with the energy information of each photon event within the window according to their x and y coordinates. Compensate the sum of pixel cluster counts based on the threshold set during data acquisition. Search for pixel clusters in the matrix and record the area and sum of counts for each pixel cluster. After the pixel clusters in the current time window have been searched and recorded, slide the time window and clear the matrix. Repeat the above operations until all photon events have been recovered into pixel clusters and each pixel cluster has been recorded. To reduce data processing time and increase pixel cluster search efficiency, a smaller empty matrix is constructed during pixel cluster recovery. At this point, the coordinates of the photon events need to be mapped from the original large matrix (512×512) to a smaller matrix (256×256). Translation mapping is used because when performing pixel cluster search, the absolute coordinates of each photon event are not important; only the positional relationships between photon events need to be obtained.
[0039] like Figure 4 As shown, the dashed part represents a 256×256 matrix, and the solid part represents a 512×512 matrix.
[0040] x and y represent the row and column positions of a pixel in the matrix. Let the number of pixels in the original matrix be... The elements in the reconstructed small matrix are , The mapping relationship is as follows:
[0041] if , ;
[0042] if , ;
[0043] if , ;
[0044] if , .
[0045] In step 5, energy peak identification is performed. Energy peaks are identified from all pixel energy spectra, and Gaussian fitting is applied. The proportion of pixel clusters with different areas is calculated, and the x-coordinate of the peak position is calibrated using linear weighting.
[0046] Let the peak position after calibration be y, and the proportion of pixel clusters with different areas be... The peak positions of pixel clusters of different sizes are ;
[0047] but .
[0048] like Figure 5 The image shows the histogram of pixel cluster volumes for characteristic X-rays of zirconium, i.e., the pixel cluster energy spectrum. Different pixel cluster areas correspond to different energy spectra. Larger pixel cluster volumes indicate higher detected photon energies.
[0049] like Figure 6 The figure shows the Gaussian fitting results for the energy peak. These represent the horizontal coordinates corresponding to the energy peak values of the first, second, third, and fourth area pixel clusters, respectively.
Claims
1. An adaptive energy calibration method for a Timepix3 detector, characterized in that, Includes the following steps: Step 1: Collect photon event data using the Timepix3 detector. The photon event data includes arrival time, coordinates, and energy information. Step 2: Sort the photon events containing coordinate and energy information according to their arrival time to obtain a photon event sequence; Step 3: Map the sorted photon event sequence to an empty matrix using a time window sliding method, search and record the area and count value of pixel clusters, i.e., the sum of energy information, and then compensate the count value according to a set threshold. Step 4: Classify by pixel cluster area, sum the pixel count values within each pixel cluster to obtain the pixel cluster volume, and draw a statistical histogram of the pixel cluster volume to form an energy spectrum; Step 5: Identify the energy peaks of each energy spectrum and perform Gaussian fitting. Calculate the peak abscissa based on the linear weighting of the pixel cluster proportions of different areas to establish the correspondence between pixel cluster volume and actual energy. Step 6: Perform energy calibration by linearly fitting multiple sets of pixel cluster volume and actual energy data.
2. The adaptive energy calibration method for the Timepix3 detector according to claim 1, characterized in that, In step 1, the metal foil is excited by synchrotron radiation to generate characteristic X-ray fluorescence, and the Timepix3 detector detects the X-ray fluorescence to obtain photon events.
3. The adaptive energy calibration method for the Timepix3 detector according to claim 1, characterized in that, Step 3 specifically involves: initializing an empty matrix based on the size of the detector pixel array, setting a time window of appropriate length, extracting photon event information sequentially from the information sequence according to the set time window, filling in the energy information of the photon event at the corresponding position in the empty matrix based on the x and y coordinates of each photon event, waiting for the photon event information in the current time window to be extracted, searching for pixel clusters in the matrix, classifying them according to the area size of the pixel clusters, and recording the total count value of each pixel cluster, i.e., the pixel cluster volume. After all the pixel clusters in the current time window have been recorded, sliding the time window and clearing the matrix, repeating the above process of extracting, searching, and recording pixel clusters until all photon events have been restored into pixel clusters.
4. The adaptive energy calibration method for the Timepix3 detector according to claim 3, characterized in that, The pixel cluster search in step 3 is as follows: taking any pixel as the center, if there are count values in the 8 neighboring pixels around it, then all pixels with count values belong to the same pixel cluster.
5. The adaptive energy calibration method for the Timepix3 detector according to claim 3, characterized in that, In step 3, during the pixel cluster recovery stage, the 512×512 matrix coordinates are transformed into 256×256 matrix coordinates through translation mapping.
6. The adaptive energy calibration method for the Timepix3 detector according to claim 1, characterized in that, The formula for calculating the peak abscissa y in step 5 is as follows: ; The proportion of pixel clusters of different sizes is The peak positions of pixel clusters of different sizes are .
7. The adaptive energy calibration method for the Timepix3 detector according to claim 5, characterized in that, x and y represent the row and column positions of a pixel in the matrix. Let the number of pixels in a 512×512 matrix be... The elements in the reconstructed 256×256 matrix are , The mapping relationship is as follows: if , ; if , ; if , ; if , .
8. The adaptive energy calibration method for the Timepix3 detector according to claim 1, characterized in that, The time window size is set to 1000ns to 10000ns.
9. The adaptive energy calibration method for the Timepix3 detector according to claim 1, characterized in that, In step 3, the compensation count value is specifically: the sum of the compensated count values is... The sum of the count values before compensation is If the number of pixels in a pixel cluster is n, and the compensation coefficient is k, which is determined by the set threshold, then... .
10. The adaptive energy calibration method for the Timepix3 detector according to claim 2, characterized in that, The metal foil is more preferably a zirconium foil.
Citation Information
Patent Citations
Parameter scanning-based Timepix3 detector energy calibration method
CN117784212A
Charge summation method based on Timepix3 detector
CN118465813A