Use-Script-Anchors
In OriginPro, the Peak Analyzer is capable of creating and subtracting baseline. You can create a baseline by finding baseline anchor points first and then connect those anchor points either by interpolation or by fitting. To search for those baseline anchor points, you can either use built-in methods or define the search method on your own using LabTalk scripts.
Dataset dspos; pkfind iy:=(dsx, dsy) dir:=p npts:=5 value:=200 ocenter:=dspos; // Find major peak positions int npk=dspos.GetSize(); // Get major peak numbers // Create datasets to store anchor points int nn = dsx.GetSize(); // Get source X size dataset apt_x, apt_y;// Create datasets to store anchor points apt_x.SetSize(npk+1); // Set anchor points number apt_y.SetSize(npk+1); apt_x[1] = dsx[1]; // Set 1st data point as 1st anchor point apt_y[1] = dsy[1]; apt_x[npk+1] = dsx[nn]; // Set last data point as last anchor point apt_y[npk+1] = dsy[nn]; for (ii=1; ii<=npk; ii++) { int istart = dspos[ii]; // Get row index of ii-th peak int iend = dspos[ii+1]; // Get row index of the next peak range rtemp = [??]!dsy[$(istart):$(iend)]; // Declare the range and point to the loose dataset limit rtemp; // Get stats of the subrange int ind = limit.imin; // Get min Y row index apt_y[ii+1]=limit.ymin; // Get min Y between two peaks as anchor point apt_x[ii+1]=dsx[ind]; };
The script will firstly find all major peak positions and then treat the minimum between every two adjacent peaks as one baseline anchor point, then add the first and last data points as two baseline anchor points.
Note: You can still uncheck Enable Auto Find checkbox and then use Add or Modify/Del to add or remove baseline anchor points.
5. Click Next button to go to Create Baseline page, make sure Connect by is selected as Interpolation and the Interpolation Method is Line. Then click Finish to obtain integration areas for each peak.