A spectral data processing system and method based on in-situ data perception and intelligent analysis

CN122238207APending Publication Date: 2026-06-19FUDAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FUDAN UNIVERSITY
Filing Date
2026-02-09
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies for spectral data processing are opaque, lack clear algorithm details, lack data closure, have limited algorithm accuracy, are difficult to handle data quality issues, are inconvenient to export data, and cannot achieve automation and standardization.

Method used

The system employs an in-situ testing module to acquire spectral data in real time, an in-situ data sensing and quality processing module to automatically detect and clean invalid values, an intelligent feature extraction module to extract precise peak positions and half-peak widths, a multi-peak Gaussian fitting analysis module to perform Gaussian fitting, and a data synchronization and closed-loop control module to achieve automatic synchronization and support the export of structured data.

Benefits of technology

It enables real-time acquisition, efficient processing, accurate analysis, and automatic synchronization of spectral data, ensuring data quality, reducing human intervention, improving analytical accuracy and work efficiency, and supporting structured data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122238207A_ABST
    Figure CN122238207A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of spectral data processing technology, specifically a spectral data processing system and method based on in-situ data sensing and intelligent analysis. This invention employs in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, and PL mapping to acquire real-time three-dimensional spectral data of time, wavelength, and intensity for real-time monitoring of material crystallization, defects, and luminescence properties. It uses an automatic invalid value detection and cleaning algorithm to address data quality issues; it extracts peak position and half-peak width (WHM) characteristic parameters from the spectral data using peak position extraction and WHM calculation methods; it uses a nonlinear optimization algorithm to perform multi-peak Gaussian fitting on the spectral data; and it employs a signal-slot mechanism to achieve real-time synchronization of data presentation and fitting analysis, forming a complete closed loop of in-situ testing, data sensing, processing, analysis, synchronization, and export. This invention achieves real-time acquisition, efficient processing, accurate analysis, and automatic synchronization of spectral data, providing technical support for standardized processing and traceable analysis of spectral data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of spectral data processing technology, specifically relating to a spectral data processing system and method based on in-situ data sensing and intelligent analysis. Background Technology

[0002] In fields such as spectral analysis, materials characterization, and chemical kinetics research, researchers need to process large amounts of time-wavelength-intensity three-dimensional data. Traditional data processing methods have the following problems:

[0003] 1. Lack of transparency in data processing: In existing technologies, the data processing process is a "black box," with unclear algorithm details, making it impossible for users to understand how the data is processed and transformed. For example, peak extraction typically uses a simple maximum value detection method, which has limited accuracy; the handling of data quality issues relies on manual judgment, lacking automated invalid value detection and repair mechanisms.

[0004] 2. Lack of data closure: Each functional module operates independently and cannot be automatically synchronized. For example, when the heatmap is updated, the related fitted curves cannot be automatically updated, requiring manual operation by the user, which can easily lead to data inconsistencies. The process from data loading to analysis to export lacks closed-loop control, making automated data flow impossible.

[0005] 3. Limited algorithm accuracy: In existing technologies, peak position extraction usually adopts a simple maximum value detection method, which cannot obtain accurate peak position and half-peak width values; the fitting algorithm lacks parameter boundary constraints and optimization strategies, making it difficult to guarantee the fitting quality.

[0006] 4. Data quality issues: The original data may contain invalid values ​​such as negative numbers, NaN values, and infinity. Current technology lacks an automated invalid value detection and processing mechanism, which requires manual processing, which is inefficient and prone to errors.

[0007] 5. Inconvenient data export: Fitting results and curve data cannot be easily exported as structured data files (such as Excel and CSV), which is not conducive to subsequent analysis and report writing, and also makes it impossible to establish standardized data archives. Summary of the Invention

[0008] The purpose of this invention is to provide a spectral data processing system and method based on in-situ data sensing and intelligent analysis, in order to solve the problems of opaque data processing, unclear algorithm details, lack of data closure, limited algorithm accuracy, and difficulty in handling data quality issues in the prior art, and to achieve efficient processing, accurate analysis and automatic synchronization of spectral data.

[0009] The spectral data processing system based on in-situ testing and intelligent analysis provided by this invention includes: an in-situ testing module, an in-situ data sensing and quality processing module, an intelligent feature extraction module, a multi-peak Gaussian fitting analysis module, a data synchronization and closed-loop control module, and a data export and standardization interface module; wherein:

[0010] (i) The in-situ testing module is used to acquire three-dimensional spectral data of time, wavelength, and intensity in real time using multimodal characterization methods such as in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, and PL mapping, so as to realize real-time monitoring of material crystallization, defects, and luminescence properties. This module includes:

[0011] (1) In-situ optical imaging unit, using a high-resolution CCD or CMOS camera, to monitor material morphology, defects and crystallization process in real time; the in-situ optical imaging unit can be configured with different magnification and illumination conditions, and supports bright field, dark field and polarization imaging modes.

[0012] (2) Absorption spectroscopy test unit: using fiber optic spectrometer or array detector to continuously acquire absorption spectra with a time resolution of 10ms-1s.

[0013] The system uses a xenon lamp or LED as the light source, selects a specific wavelength using a monochromator or filter, measures the absorption intensity of the material at different wavelengths, and obtains the change of absorption intensity with wavelength and time.

[0014] (3) Fluorescence spectroscopy testing unit: The sample is excited by an excitation source (such as a laser or LED), and the fluorescence spectrum is collected by a fiber optic spectrometer or array detector. The system continuously acquires data with a time resolution of 10 ms to 1 s, measures the fluorescence intensity of the material at different wavelengths, and obtains the change of fluorescence intensity with wavelength and time, which is used to monitor carrier dynamics and luminescence characteristics.

[0015] (4) PL mapping unit, which uses a scanning or array detection system to perform large-area uniformity scanning. The system acquires spatially resolved spectral information through mechanical scanning or array detectors, generating three-dimensional spatial-wavelength-intensity data for evaluating the uniformity and spatial distribution characteristics of materials.

[0016] (5) Data Acquisition and Transmission: All test data are automatically recorded as a three-dimensional data matrix of time-wavelength-intensity in CSV format, containing wavelength and time-intensity data columns. The system transmits data to the data sensing module in real time via a data bus (such as USB, Ethernet or serial port) to achieve real-time linkage between testing and analysis.

[0017] (ii) The in-situ data sensing and quality processing module is used to receive spectral data (CSV format), automatically detect and process invalid values, and ensure data quality. This module includes:

[0018] (1) Data input interface: Receives three-dimensional data of time-wavelength-intensity, and supports CSV format file input. The data format is as follows: the first column is the wavelength data, and the subsequent columns are the intensity data at different time points. The time data is read from the beginning of the file.

[0019] (2) Invalid value detection algorithm: Automatically detects invalid values ​​in the data, including NaN (Not a Number), Inf (Infinity), and negative numbers. The detection process is executed automatically when the data is loaded, without the need for manual intervention.

[0020] (3) Data cleaning algorithm: The `np.nan_to_num()` function from the NumPy library is used to replace NaN and Inf with 0, and the `np.maximum()` function is used to set negative numbers to 0. The algorithm formula is as follows:

[0021] data = np.nan_to_num(data, nan=0.0, posinf=0.0, neginf=0.0)

[0022] data = np.maximum(data, 0)

[0023] (4) Standardized data output: Output a clean numerical matrix to ensure that all data are valid finite values, providing a reliable data foundation for subsequent analysis.

[0024] (III) The intelligent feature extraction module is used to extract feature parameters such as peak position and half-maximum width (WHM) from spectral data, and generate peak position-time curves and WHM-time curves. The core algorithm of this module is an interpolation-optimized peak position extraction algorithm, which includes the following steps:

[0025] (1) Maximum value detection: The np.argmax() function is used to find the index position corresponding to the maximum value of the spectral intensity at each time point, and the peak wavelength peak_wl and peak intensity peak_int are determined.

[0026] (2) Half-peak width point search: Calculate the half-peak height value half_max = peak_int / 2, and search for half-peak height points on both sides of the peak. When searching to the left, start from the peak position and traverse to the left to find the first data point with an intensity less than or equal to half_max; when searching to the right, start from the peak position and traverse to the right to find the first data point with an intensity less than or equal to half_max.

[0027] (3) Linear interpolation optimization: When two adjacent data points are found to be located on either side of the half-peak height, the np.interp() function is used for linear interpolation to obtain the accurate half-peak width position. The interpolation formula is:

[0028] wl = np.interp(half_max,

[0029] [intensity[idx+1], intensity[idx]],

[0030] [wavelengths[idx+1], wavelengths[idx]])

[0031] The final calculation is: FWHM = |wl_right - wl_left|.

[0032] Compared to simple maximum value detection methods, this algorithm significantly improves the extraction accuracy of peak position and half-peak width through linear interpolation.

[0033] (iv) The multi-peak Gaussian fitting analysis module is used to perform multi-peak Gaussian fitting on the spectral data, extract fitting parameters, and evaluate the fitting quality. This module includes:

[0034] (1) Multi-peak Gaussian function model: Supports fitting of 1-5 Gaussian peaks, the function model is:

[0035] y = Σ(A_i × exp(-((x - μ_i) / σ_i)² / 2)) where A_i is the amplitude of the i-th peak, μ_i is the peak position of the i-th peak, and σ_i is the standard deviation of the i-th peak. For n peaks, there are 3n parameters to be fitted.

[0036] (2) Levenberg-Marquardt nonlinear optimization algorithm: Implemented using the curve_fit() function from the SciPy library, this function performs nonlinear least squares optimization based on the Levenberg-Marquardt algorithm. The algorithm flow includes:

[0037] (a) Set initial parameter p0: Based on the initial parameter input by the user, convert FWHM to standard deviation σ = FWHM / 2.355.

[0038] (b) Set parameter boundary constraints: amplitude ≥ 0, peak position within the fitting range, standard deviation > 0.1 and < 100.

[0039] (c) Optimization: The objective function is to minimize the sum of squared residuals, i.e., min Σ(y_obs - y_fit)².

[0040] (d) Result transformation: Convert the standard deviation σ to the half-maximum width FWHM = 2.355 × σ.

[0041] (3) Algorithm for evaluating fitting quality: The algorithm automatically calculates the coefficient of determination R², root mean square error RMSE, and chi-square value χ² to evaluate the fitting quality. The calculation formula is as follows:

[0042] R² = 1 - Σ(y_obs - y_fit)² / Σ(y_obs - y_mean)²;

[0043] RMSE = sqrt(Σ(y_obs - y_fit)² / n);

[0044] χ² = Σ((y_obs - y_fit)² / y_fit).

[0045] (v) The data synchronization and closed-loop control module is used to achieve real-time synchronization of data presentation and fitting analysis, forming a data closed loop. The core mechanism of this module is the signal-slot mechanism, and the specific process is as follows:

[0046] (1) Signal triggering: When the heat map is updated, the system automatically triggers the data synchronization signal.

[0047] (2) Intermediate time point data extraction algorithm: The system automatically calculates the intermediate time point index mid_time_idx = len(times) / / 2, and extracts the intensity data current_intensity = data[:, mid_time_idx].

[0048] (3) Data synchronous transmission: Data is transmitted to the fitting analysis module through the sync_fitting_data(wavelengths, current_intensity) method in the main window.

[0049] (4) Automatic update: After receiving the data, the fitting analysis module automatically updates the internal data and prepares to perform fitting analysis.

[0050] This mechanism enables automatic synchronization without human intervention, ensuring consistency between data presentation and fitting analysis.

[0051] (vi) The data export and standardization interface module is used to export the analysis results as structured data files, supporting Excel and CSV formats. This module includes:

[0052] (1) Exporting curve data: Export the intensity-time curve, peak position-time curve, and half-peak width-time curve as three separate Excel or CSV files for easy use and analysis.

[0053] (2) Exporting fitting results: Export the fitting parameters, fitting quality statistics and fitting settings information as an Excel file containing multiple worksheets to achieve structured data management.

[0054] (3) Automatic export of batch processing: When processing in batches, curve data files are automatically generated for each file. Excel format is preferred, and CSV format is automatically downgraded when it is unavailable.

[0055] The workflow of the system of this invention is as follows:

[0056] (1) In-situ testing: During the material preparation or processing, multimodal characterization methods such as in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, and PL mapping are used to acquire time-wavelength-intensity three-dimensional spectral data in real time. The system continuously acquires data with a time resolution of 10ms-1s, automatically records it as a time-wavelength-intensity three-dimensional data matrix, and transmits it to the data sensing module in real time.

[0057] (2) In-situ data sensing: Receive time-wavelength-intensity three-dimensional spectral data in CSV format through the data input interface.

[0058] (3) Data quality processing: NaN, Inf and negative numbers are detected by invalid value detection algorithm, invalid values ​​are automatically repaired by data cleaning algorithm, and standardized data is output.

[0059] (4) Feature extraction: The peak position and half-peak width are calculated as time using an interpolation-optimized peak position extraction algorithm to generate peak position-time curves and half-peak width-time curves.

[0060] (5) Data visualization: Generate heat maps (2D and 3D) and curves (intensity-time, peak position-time, half peak width-time) based on the processed data.

[0061] (6) Fitting analysis: The spectral data at selected time points are fitted using a multi-peak Gaussian function model and the Levenberg-Marquardt algorithm. Fitting parameters are extracted and the fitting quality is evaluated.

[0062] (7) Data synchronization: When the heat map is updated, the intensity data at intermediate time points is automatically extracted using the signal-slot mechanism and synchronously transmitted to the fitting analysis module.

[0063] (8) Results export: Export curve data and fitting results as structured data files (Excel or CSV format).

[0064] The above process forms a complete closed loop of in-situ testing → data perception → processing → analysis → synchronization → export, realizing automated data processing and real-time monitoring without human intervention.

[0065] Technical features and advantages of this invention

[0066] 1. In-situ real-time monitoring: The in-situ testing module enables real-time monitoring of the material preparation or processing process. It uses multi-modal characterization methods to acquire three-dimensional spectral data of time-wavelength-intensity, with a time resolution of 10ms-1s, and can capture the dynamic changes of material crystallization, phase transition and luminescence properties in real time.

[0067] 2. Data closed loop: It realizes a complete closed loop of in-situ testing → data perception → processing → analysis → synchronization → export. The modules are automatically synchronized through the signal-slot mechanism without human intervention.

[0068] 3. Algorithm optimization: An interpolation-optimized peak extraction algorithm is adopted, which significantly improves the extraction accuracy of peak position and half-peak width compared with the simple maximum value detection method; the Levenberg-Marquardt nonlinear optimization algorithm is adopted to improve the fitting quality and convergence speed.

[0069] 4. Real-time synchronization: The signal-slot mechanism is used to realize the real-time synchronization of data presentation and fitting analysis, ensuring data consistency, reducing manual operation, and avoiding errors caused by data asynchrony.

[0070] 5. Data quality assurance: Automated invalid value detection and cleaning algorithms are used to ensure data quality, reduce errors caused by data problems, and improve the accuracy of analysis.

[0071] 6. Standardized data management: Supports exporting analysis results as structured Excel and CSV files, facilitating subsequent analysis and report writing, and achieving standardized data management.

[0072] 7. Multi-threaded architecture: Employs multi-threading technology to execute data loading, fitting calculations, and batch processing tasks in background threads, avoiding UI freezing and improving user experience.

[0073] This invention utilizes an in-situ testing module to acquire real-time time-wavelength-intensity three-dimensional spectral data using multimodal characterization methods such as in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, and PL mapping, enabling real-time monitoring of material crystallization, defects, and luminescence properties. An in-situ data sensing and quality processing module receives spectral data and employs an automatic invalid value detection and cleaning algorithm to address data quality issues. An intelligent feature extraction module uses an interpolation-optimized peak position extraction algorithm and a half-peak width calculation algorithm to extract characteristic parameters such as peak position and half-peak width from the spectral data. A multi-peak Gaussian fitting analysis module uses a Levenberg-Marquardt nonlinear optimization algorithm to perform multi-peak Gaussian fitting on the spectral data, extracting fitting parameters and evaluating the fitting quality. Finally, a data synchronization and closed-loop control module uses a signal-slot mechanism to achieve real-time synchronization of data presentation and fitting analysis, forming a complete closed loop: in-situ testing → data sensing → processing → analysis → synchronization → export. This invention enables real-time acquisition, efficient processing, accurate analysis, and automatic synchronization of spectral data, solving problems such as lack of real-time monitoring, opaque data processing, unclear algorithm details, and lack of data closure in existing technologies. It provides reliable technical support for the standardized processing and traceable analysis of spectral data. Attached Figure Description

[0074] Figure 1 This is a diagram illustrating the overall architecture of the system of this invention. It shows the data closed-loop process: in-situ testing → in-situ data sensing → data quality processing → feature extraction → fitting analysis → data synchronization → result export.

[0075] Figure 2 This is a schematic diagram of the in-situ testing module. It illustrates the composition and connection relationships of multimodal characterization units such as in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, and PL mapping.

[0076] Figure 3 This is a flowchart of a data quality processing algorithm. It illustrates the specific steps involved in invalid value detection and cleaning.

[0077] Figure 4 This is a schematic diagram of a data synchronization mechanism. It illustrates the specific process of data synchronization using the signal-slot mechanism.

[0078] Figure 5 This is a complete system workflow diagram. It illustrates the complete data closed-loop process from in-situ testing to result export. Detailed Implementation

[0079] The present invention will be further described below with reference to the embodiments and accompanying drawings.

[0080] Example 1: In-situ testing based on multimodal characterization

[0081] This embodiment describes the specific implementation of the in-situ testing module and demonstrates how to acquire time-wavelength-intensity three-dimensional spectral data in real time.

[0082] Step 1: In-situ optical imaging

[0083] During material preparation or processing, the system activates the in-situ optical imaging unit. A high-resolution CCD camera (2048×2048 pixels) continuously captures material morphology images at an acquisition rate of 1-10 frames per second. The imaging system is configured with different magnifications (10×-100×) and illumination conditions (bright field, dark field, polarized) to monitor the material crystallization process, defect formation, and morphological changes in real time. Image data is automatically saved and synchronized with the spectral data timestamp.

[0084] Step 2: Absorption Spectroscopy Test

[0085] The system initiates the absorption spectroscopy testing unit. Using a xenon lamp source (wavelength range 200-2500 nm) and a fiber optic spectrometer (resolution 0.1-1 nm), absorption spectra are continuously acquired with a time resolution of 10 ms to 1 s. For the perovskite thin film annealing process, the system acquires a complete spectrum every 100 ms within the 400-800 nm wavelength range at 1 nm wavelength intervals, continuously monitoring changes in the material's absorption characteristics. Data is automatically recorded as a three-dimensional time-wavelength-intensity matrix in CSV file format. The first column contains wavelength data (unit: nm), subsequent columns contain absorption intensity data at different time points (unit: au), and time data is read from the file header (unit: s).

[0086] Step 3: Fluorescence spectroscopy test

[0087] The system initiates the fluorescence spectroscopy testing unit. A 405 nm laser is used as the excitation source, and fluorescence spectra are acquired via a fiber optic spectrometer. The system continuously acquires fluorescence spectra with a time resolution of 10 ms–1 s, at 1 nm wavelength intervals within the 400–800 nm wavelength range, acquiring a complete fluorescence spectrum every 100 ms to monitor the material's luminescence properties and carrier dynamics in real time. Fluorescence intensity data is automatically recorded and synchronized with the absorption spectrum data timestamp.

[0088] Step 4: PL mapping

[0089] For large-area samples, the system activates the PL mapping unit. A scanning detection system is employed, using a stepper motor to control the sample stage or detection head for two-dimensional scanning (scanning range 10 × 10 mm, spatial resolution 100 μm). At each scanning point, the system acquires complete spectral information, generating spatial-wavelength-intensity three-dimensional data for evaluating the material's uniformity and spatial distribution characteristics.

[0090] Step 5: Real-time data transmission

[0091] All test data is transmitted to the data sensing module in real time via a data bus (USB 3.0 or Gigabit Ethernet). The system adopts a multi-threaded architecture, with test data acquisition executed in a background thread to avoid blocking the data processing and analysis workflow. Data files are automatically saved in CSV format, containing complete metadata (test time, test conditions, instrument parameters, etc.).

[0092] Technical Effects: This embodiment enables real-time monitoring of the material preparation or processing process, continuously acquiring multimodal spectral data with a time resolution of 10ms-1s, and capturing the dynamic changes in the material's crystallization, phase transition, and luminescence properties in real time. Compared to existing technologies that can only perform offline testing after preparation, this embodiment achieves true in-situ real-time monitoring, providing real-time feedback for optimizing the material preparation process.

[0093] Example 2: In-situ data sensing based on data quality processing

[0094] This embodiment describes in detail the specific implementation process of the data quality processing algorithm.

[0095] Step 1: Data Input

[0096] The system receives time-wavelength-intensity three-dimensional spectral data in CSV format via a data input interface. The data file format is as follows: the first line is the title, lines 2-13 are metadata, and the data begins on line 14. The first column is the wavelength data (unit: nm), and subsequent columns are the intensity data at different time points (unit: au). The time data is read from the beginning of the file (unit: s).

[0097] Step 2: Invalid Value Detection

[0098] The system automatically detects invalid values ​​in the data. The detection algorithm traverses the entire data matrix and identifies the following types of invalid values:

[0099] NaN (Not a Number): Usually caused by missing data or calculation errors.

[0100] Inf (infinity): Usually generated by dividing by zero or numerical overflow.

[0101] Negative numbers: For spectral intensity data, negative numbers usually indicate measurement errors or data anomalies.

[0102] Step 3: Data Cleaning

[0103] The system uses the following algorithm to automatically repair invalid values:

[0104] # Replace NaN and Inf with 0 absorbance_data = np.nan_to_num(absorbance_data, nan=0.0, posinf=0.0,neginf=0.0) # Set negative numbers to 0 absorbance_data = np.maximum(absorbance_data, 0);

[0105] This algorithm ensures that all data are valid finite values, providing a reliable data foundation for subsequent analysis.

[0106] Step 4: Standardize Output

[0107] The cleaned data is output in standard NumPy array format, with shape (n_wavelengths, n_times), where n_wavelengths is the number of wavelengths and n_times is the number of time points. All elements in the data matrix are non-negative finite values.

[0108] This embodiment achieves automatic data quality assurance, avoiding program errors caused by data problems and improving analysis accuracy. Compared to existing technologies that require manual handling of data quality issues, this embodiment achieves fully automated data cleaning, significantly improving processing efficiency.

[0109] Example 3: Peak position extraction based on interpolation optimization

[0110] This embodiment describes in detail the specific implementation of the peak extraction algorithm for interpolation optimization.

[0111] Step 1: Maximum value detection

[0112] For each time point t, the system extracts the intensity data for that time point, intensity = data[:, t], and uses the np.argmax() function to find the index position corresponding to the maximum intensity value:

[0113] max_idx = np.argmax(intensity)peak_wl = wavelengths[max_idx]peak_int= intensity[max_idx]

[0114] Obtain the peak wavelength peak_wl and peak intensity peak_int.

[0115] Step 2: Half-peak width search

[0116] The system calculates the half-peak height value, half_max = peak_int / 2, and then searches for half-peak height points on both sides of the peak value.

[0117] Search to the left: Starting from the peak position max_idx, traverse to the left and find the first data point left_idx whose intensity is less than or equal to half_max.

[0118] Search to the right: Starting from the peak position max_idx, traverse to the right and find the first data point right_idx whose intensity is less than or equal to half_max.

[0119] Step 3: Linear interpolation optimization

[0120] When two adjacent data points are found to be located on either side of the half-peak height, the system uses the np.interp() function to perform linear interpolation to obtain the precise location of the half-peak width.

[0121] For the width of the left half-peak:

[0122] if left_idx < len(intensity) - 1: wl_left = np.interp(half_max, [intensity[left_idx+1],intensity[left_idx]], [wavelengths[left_idx+1],wavelengths[left_idx]]);

[0123] For the width of the right half-peak:

[0124] if right_idx > 0: wl_right = np.interp(half_max, [intensity[right_idx-1],intensity[right_idx]], [wavelengths[right_idx-1], wavelengths[right_idx]]).

[0125] Step 4: Calculate the full width at half maximum (FWHM)

[0126] The final calculation is: FWHM = |wl_right - wl_left|.

[0127] This embodiment significantly improves the extraction accuracy of peak position and full width at half maximum (FWHM) through linear interpolation. Compared to simple maximum value detection methods, this embodiment can obtain sub-pixel-level accurate peak positions, and the calculation accuracy of FWHM is also significantly improved. For typical spectral data (wavelength resolution of approximately 1 nm), interpolation optimization can improve the peak position extraction accuracy from ±0.5 nm to ±0.1 nm.

[0128] Example 4: Multi-peak Gaussian fitting based on Levenberg-Marquardt

[0129] This embodiment describes in detail the specific implementation of the multi-peak Gaussian fitting algorithm.

[0130] Step 1: Multi-peak Gaussian function model

[0131] The system supports fitting of 1-5 Gaussian peaks, and the function model is as follows:

[0132] def gaussian(x, *params): y = np.zeros_like(x) for i in range(0, len(params), 3): A = params[i] # Amplitude mu = params[i+1] # Peak position sigma = abs(params[i+2]) # Standard deviation (ensure it is positive) if sigma > 0: y += A * np.exp(-((x - mu) / sigma) ** 2 / 2) return y;

[0133] For n peaks, there are a total of 3n parameters to be fitted.

[0134] Step 2: Initial parameter settings

[0135] The system sets the initial guess value p0 based on the initial parameters input by the user. For each peak i, the initial parameters include:

[0136] Amplitude A_i: The amplitude value input by the user

[0137] Peak position μ_i: Peak position input by the user (unit: nm)

[0138] Standard deviation σ_i: Obtained from the user-input full width at half maximum (FWHM_i), σ_i = FWHM_i / 2.355

[0139] Step 3: Parameter Boundary Constraints

[0140] The system sets parameter boundary constraints to ensure the physical meaning of the fitting results:

[0141] `bounds_lower = [0, fit_range[0], 0.1] * num_peaks # Amplitude ≥ 0, peak position within range, σ > 0.1` `bounds_upper = [np.inf, fit_range[1], 100] * num_peaks # Amplitude has no upper limit, peak position within range, σ < 100`

[0142] Step 4: Levenberg-Marquardt optimization

[0143] The system uses the curve_fit() function from the SciPy library to perform Levenberg-Marquardt nonlinear least squares optimization:

[0144] popt, _ = curve_fit( gaussian, wl_fit, int_fit, p0=initial_guess, bounds=(bounds_lower, bounds_upper), maxfev=max_iter, ftol = tolerance );

[0145] Where wl_fit and int_fit are the wavelength and intensity data within the fitting range, max_iter is the maximum number of iterations (default 200), and tolerance is the convergence tolerance (default 1e-8).

[0146] Step 5: Result Transformation and Quality Assessment

[0147] After fitting, the system converts the standard deviation σ into the half-width at half-maximum (FWHM) = 2.355 × σ, and calculates the fitting quality index:

[0148] Coefficient of determination R²: R² = 1 - Σ(y_obs - y_fit)² / Σ(y_obs - y_mean)², with a value range of [0, 1]. The closer to 1, the better the fit.

[0149] Root Mean Square Error (RMSE): RMSE = sqrt(Σ(y_obs - y_fit)² / n), with the same units as the intensity data. A smaller RMSE indicates a better fit.

[0150] Chi-square value χ²: χ² = Σ((y_obs - y_fit)² / y_fit), used to evaluate the statistical significance of the fit.

[0151] This embodiment achieves efficient nonlinear optimization using the Levenberg-Marquardt algorithm, which, compared to simple linear fitting methods, can accurately handle complex spectra with overlapping multi-peaks. For typical spectral data, R² can usually reach above 0.95, and RMSE is typically less than 5% of the maximum intensity, indicating good fitting quality.

[0152] Example 5: Data Synchronization Closed Loop Based on Signal-Slot Mechanism

[0153] This embodiment describes in detail the specific implementation of the data synchronization mechanism.

[0154] Step 1: Signal Trigger

[0155] When the heatmap is updated, the system automatically triggers a data synchronization signal. Specifically, in the `update_heatmap()` method of the `DataDisplayTab` class, after the heatmap is drawn, the system checks whether the main window reference has been set.

[0156] if hasattr(self, 'main_window') and self.main_window: # Trigger data synchronization

[0157] Step 2: Extracting data from intermediate time points

[0158] The system automatically calculates the index of intermediate time points and extracts the intensity data for those time points:

[0159] mid_time_idx = len(times) / / 2 if mid_time_idx < data.shape[1]: current_intensity = data[:, mid_time_idx]

[0160] Step 3: Data Synchronization and Transfer

[0161] The system passes data to the fitting analysis module through the sync_fitting_data() method in the main window:

[0162] self.main_window.sync_fitting_data(wavelengths, current_intensity)

[0163] The main window's sync_fitting_data() method is implemented as follows:

[0164] def sync_fitting_data(self, wavelengths, intensity): if self.data_fitting_tab and wavelengths is not Noneand intensity is not None: self.data_fitting_tab.set_data(wavelengths,intensity)

[0165] Step 4: Automatic Update

[0166] After receiving the data, the fitting analysis module automatically updates its internal data in preparation for fitting analysis.

[0167] def set_data(self, wavelengths, intensity): self.wavelengths = wavelengths self.current_intensity = intensity # Data has been updated and fitting analysis can be performed.

[0168] This embodiment achieves automatic data synchronization without human intervention, ensuring consistency between data presentation and fitting analysis. Compared to existing technologies that require manual operation to update fitting data, this embodiment achieves fully automated data flow, significantly improving work efficiency and avoiding errors caused by data asynchrony.

[0169] Example 6: Coordinate Axis Optimization Based on Intelligent Tick Generation Algorithm

[0170] This embodiment describes in detail the specific implementation of the intelligent scale generation algorithm.

[0171] Step 1: Numerical Range Analysis

[0172] The system analyzes the numerical range of the data to determine the minimum and maximum values ​​of the coordinate axes:

[0173] min_val = data.min() max_val = data.max() data_range = max_val - min_val

[0174] Step 2: Accuracy is automatically determined

[0175] The system automatically determines the display precision based on the numerical range:

[0176] if data_range >= 1000: decimals = 0 # Integer display elif data_range >= 100: decimals = 1 # 1 decimal place elif data_range >= 10: decimals = 2 # 2 decimal places elif data_range >= 1: decimals = 3 # 3 decimal places else: decimals = 4 # 4 decimal places

[0177] Step 3: Generate uniformly distributed scale

[0178] The system uses the np.linspace() function to generate uniformly distributed tick points (including boundary values):

[0179] def get_axis_ticks(min_val, max_val, num_ticks=5): ticks = np.linspace(min_val, max_val, num_ticks) return ticks

[0180] By default, five tick marks are generated, including the minimum value, the maximum value, and three intermediate values.

[0181] Step 4: Tag Enhancement

[0182] The system includes data range information in the axis labels, in the format "label name [minimum value - maximum value]":

[0183] label = f'Time (s) [{min_val:.{decimals}f} - {max_val:.{decimals}f}]'ax.set_xlabel(label).

[0184] This embodiment utilizes an intelligent scale generation algorithm to optimize the display of coordinate axes, simultaneously showing boundary values ​​and a reasonable number of intermediate values, allowing users to quickly understand the data range. Compared to existing technologies that only display boundary values, this embodiment provides richer data range information, improving data readability.

Claims

1. A spectral data processing system based on in-situ testing and intelligent analysis, characterized in that, include: The module includes: in-situ testing module, in-situ data sensing and quality processing module, intelligent feature extraction module, multi-peak Gaussian fitting analysis module, data synchronization and closed-loop control module, and data export and standardization interface module; among which: (i) The in-situ testing module is used to acquire time, wavelength and intensity three-dimensional spectral data in real time using in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy and PL mapping multimodal characterization methods, so as to realize real-time monitoring of material crystallization, defects and luminescence properties; (ii) The in-situ data sensing and quality processing module is used to receive spectral data (CSV format), automatically detect and process invalid values, and ensure data quality; (iii) The intelligent feature extraction module is used to extract feature parameters such as peak position and half-peak width from spectral data, and generate peak position-time curves and half-peak width-time curves; (iv) The multi-peak Gaussian fitting analysis module is used to perform multi-peak Gaussian fitting on spectral data, extract fitting parameters, and evaluate the fitting quality; (v) The data synchronization and closed-loop control module is used to realize real-time synchronization of data presentation and fitting analysis, forming a data closed loop; (vi) The data export and standardization interface module is used to export the analysis results as structured data files, supporting Excel and CSV formats.

2. The spectral data processing system according to claim 1, characterized in that, The in-situ testing module specifically includes: (1) In-situ optical imaging unit, using a high-resolution CCD or CMOS camera, to monitor material morphology, defects and crystallization process in real time; the in-situ optical imaging unit can be configured with different magnification and illumination conditions, and supports bright field, dark field and polarization imaging modes. (2) Absorption spectroscopy testing unit: using a fiber optic spectrometer or array detector to continuously acquire absorption spectra with a time resolution of 10ms-1s; The system uses a xenon lamp or LED as a light source, selects a specific wavelength using a monochromator or filter, measures the absorption intensity of the material at different wavelengths, and obtains the change of absorption intensity with wavelength and time. (3) Fluorescence spectroscopy testing unit: The sample is excited by an excitation light source and the fluorescence spectrum is collected by a fiber optic spectrometer or array detector. The fluorescence intensity of the material at different wavelengths is measured continuously with a time resolution of 10ms-1s. The change of fluorescence intensity with wavelength and time is obtained to monitor carrier dynamics and luminescence characteristics. (4) PL mapping unit, using a scanning or array detection system to perform large-area uniformity scanning; spatially resolved spectral information is acquired through mechanical scanning or array detectors to generate three-dimensional spatial-wavelength-intensity data for evaluating the uniformity and spatial distribution characteristics of materials. (5) Data acquisition and transmission: All test data are automatically recorded as a three-dimensional data matrix of time-wavelength-intensity, and the data format is CSV file, which includes wavelength column and time-intensity data column; the data is transmitted to the data sensing module in real time through the data bus to realize real-time linkage between testing and analysis.

3. The spectral data processing system according to claim 1, characterized in that, The in-situ data sensing and quality processing module specifically includes: (1) Data input interface: Receives three-dimensional data of time-wavelength-intensity, supports CSV format file input; the data format is: the first column is wavelength data, the subsequent columns are intensity data at different time points, and the time data is read from the beginning of the file; (2) Invalid value detection: Automatically detects invalid values ​​in the data, including NaN (Not a Number), Inf (Infinity) and negative numbers; the detection process is executed automatically when the data is loaded, without manual intervention; (3) Data cleaning: The np.nan_to_num() function of the NumPy library is used to replace NaN and Inf with 0, and the np.maximum() function is used to set negative numbers to 0; (4) Standardized data output: Output a clean numerical matrix to ensure that all data are valid finite values, providing a reliable data foundation for subsequent analysis.

4. The spectral data processing system according to claim 1, characterized in that, The core algorithm in the intelligent feature extraction module is an interpolation-optimized peak extraction algorithm, which includes the following steps: (1) Maximum value detection: The np.argmax() function is used to find the index position corresponding to the maximum value of the spectral intensity at each time point, and the peak wavelength peak_wl and peak intensity peak_int are determined; (2) Half-peak width point search: Calculate the half-peak height value half_max = peak_int / 2, and search for the half-peak height point on both sides of the peak. When searching to the left, start from the peak position and traverse to the left to find the first data point with an intensity less than or equal to half_max. When searching to the right, start from the peak position and traverse to the right to find the first data point with an intensity less than or equal to half_max. (3) Linear interpolation optimization: When two adjacent data points are found to be located on both sides of the half-peak height, the np.interp() function is used for linear interpolation to obtain the accurate half-peak width point position.

5. The spectral data processing system according to claim 1, characterized in that, The multi-peak Gaussian fitting analysis module specifically includes: (1) Multi-peak Gaussian function model: Supports fitting of 1-5 Gaussian peaks, the function model is: y = Σ(A_i × exp(-((x - μ_i) / σ_i)² / 2)), where A_i is the amplitude of the i-th peak, μ_i is the position of the i-th peak, and σ_i is the standard deviation of the i-th peak; for n peaks, there are 3n parameters to be fitted. (2) Levenberg-Marquardt nonlinear optimization: This is implemented using the curve_fit() function from the SciPy library. This function performs nonlinear least squares optimization based on the Levenberg-Marquardt algorithm. The algorithm flow includes: (a) Set initial parameter p0: Based on the initial parameter input by the user, convert FWHM to standard deviation σ = FWHM / 2.355; (b) Set parameter boundary constraints: amplitude ≥ 0, peak position within the fitting range, standard deviation > 0.1 and < 100; (c) Optimization: The objective function is to minimize the sum of squared residuals, i.e., min Σ(y_obs - y_fit)²; (d) Result transformation: Convert the standard deviation σ to the half-maximum width FWHM = 2.355 × σ; (3) Fit quality assessment algorithm: Automatically calculate the coefficient of determination R², root mean square error RMSE, and chi-square value χ² to assess the fit quality; the calculation formula is: R² = 1 - Σ(y_obs - y_fit)² / Σ(y_obs - y_mean)²; RMSE = sqrt(Σ(y_obs - y_fit)² / n); χ² = Σ((y_obs - y_fit)² / y_fit).

6. The spectral data processing system according to claim 1, characterized in that, In the data synchronization and closed-loop control module, the core mechanism is the signal-slot mechanism, and the specific process is as follows: (1) Signal triggering: When the heat map is updated, the system automatically triggers a data synchronization signal; (2) Intermediate time point data extraction algorithm: The system automatically calculates the intermediate time point index mid_time_idx = len(times) / / 2, and extracts the intensity data current_intensity = data[:, mid_time_idx] at that time point; (3) Data synchronous transmission: Data is transmitted to the fitting analysis module through the sync_fitting_data(wavelengths, current_intensity) method in the main window; (4) Automatic update: After receiving the data, the fitting analysis module automatically updates the internal data and prepares to perform fitting analysis.

7. The spectral data processing system according to claim 1, characterized in that, The data export and standardization interface module specifically includes: (1) Curve data export: Export the intensity-time curve, peak position-time curve, and half-peak width-time curve as three separate Excel or CSV files for easy use and analysis; (2) Exporting fitting results: Export the fitting parameters, fitting quality statistics and fitting settings information as an Excel file containing multiple worksheets to achieve structured data management; (3) Automatic export of batch processing: When processing in batches, curve data files are automatically generated for each file. Excel format is preferred, and CSV format is automatically downgraded when it is unavailable.

8. The spectral data processing system according to any one of claims 1-7, characterized in that, The workflow is as follows: (1) In-situ testing: During the material preparation or processing, in-situ optical imaging, absorption spectroscopy, fluorescence spectroscopy, PL mapping multimodal characterization methods are used to acquire time-wavelength-intensity three-dimensional spectral data in real time; continuous acquisition is performed with a time resolution of 10ms-1s, and the data is automatically recorded as a time-wavelength-intensity three-dimensional data matrix and transmitted to the data sensing module in real time. (2) In-situ data sensing: Receive time-wavelength-intensity three-dimensional spectral data in CSV format through the data input interface; (3) Data quality processing: NaN, Inf and negative numbers are detected by invalid value detection algorithm, and invalid values ​​are automatically repaired by data cleaning algorithm, and standardized data is output; (4) Feature extraction: The peak position and half-peak width are calculated as time using an interpolation-optimized peak position extraction algorithm to generate peak position-time curves and half-peak width-time curves; (5) Data visualization: Generate heat maps and memory curves based on the processed data, including intensity-time, peak position-time, and half-peak width-time; (6) Fitting analysis: The spectral data at selected time points are fitted using a multi-peak Gaussian function model and the Levenberg-Marquardt algorithm. Fitting parameters are extracted and the fitting quality is evaluated. (7) Data synchronization: When the heat map is updated, the intensity data at intermediate time points is automatically extracted using the signal-slot mechanism and synchronously transmitted to the fitting analysis module; (8) Results Export: Export the curve data and fitting results as a structured data file; The above process forms a complete closed loop of in-situ testing → data perception → processing → analysis → synchronization → export, realizing automated data processing and real-time monitoring without human intervention.