When I follow the procedure on my own dataset, I get the message that no peaks are found but no additional information is given. Does anyone know why it doesn't work? I added the script and the data below:
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]; };
This will help you understand the options for peak finding and use suitable options for your dataset. If you remove the value:=200, it should help you get started.