The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 X-function (pa) LabTalk

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bodya67 Posted - 07/25/2019 : 07:55:56 AM
Origin Ver.: OriginPro 2019b
Operating System: Windows 10
Hello, I would like to ask a question.

I use the X - function (pa) in the loop, but I need to set the peak position. For this, I use smode: = 1, but the cycle continues to run, preventing me from finishing, and since the report is not generated, it gives an error. How can I get around this problem? For example, using the nlfitpeaks function, you can set useqp: = 0, which allows you to select the peak positions and everything works. But for pa, I did not find anything like it. I use this code:
[Main]

n=1;
for (int s_num_1 = 3; s_num_1 <= 3; s_num_1++)
{
for (int s_num_2 = 1; s_num_2 <= 5; s_num_2++)
{

s1$ = $(s_num_1)$(s_num_2 );
s$ = "Sample"+s1$;
newbook;
fname$ = "C:\Users\Admin\Desktop\Excel processed\" + s$ + ".xls";
impExcel;
col(1)[L]$ = RamanShift;
col(2)[L]$ = Intensity;
col(1)[U]$ = (1/cm);

pa iy:=(1,2) smode:=1 theme:=BWF_analisis;

x_G = cell(1,3);
y_G = cell(1,4);
x_D = cell(2,3);
y_D = cell(2,4);

window -a Graph1;
expGraph type:=jpg path:="D:\origin\Graphs1" filename:=s$;


window -a Book1;
col(1)[L]$ = Number;
col(2)[L]$ = x_D;
col(3)[L]$ = y_D;
col(4)[L]$ = x_G;
col(5)[L]$ = y_G;
col(6)[L]$ = y_D/y_G;

cell(n,1)$ = Sample_$(s_num_1)_$(s_num_2);
cell(n,2) = x_D;
cell(n,3) = y_D;
cell(n,4) = x_G;
cell(n,5) = y_G;
cell(n,6) = y_D/y_G;
n++;
window -cw Graph*;
window -cw Sample*;
}
}

}
}
8   L A T E S T    R E P L I E S    (Newest First)
minimax Posted - 08/01/2019 : 02:50:31 AM
Hi bodya67,

Your screenshot just showed a result of fitting, but cannot tell the initial peak position from find peak step.

In another word, it cannot tell if the find peak result is not good or not.

On the other hand, fitting process will certainly shift all the values (center, width, height).

To restrict the shift distance, you may add bounds, on dialog Find Peaks page - Peak Fitting Bounds.

You can also tweak the bounds on Fit Peaks page - Fit Control button - Bounds tab and Fit Control tab's Constraints.
bodya67 Posted - 07/30/2019 : 03:55:20 AM
I tried to select all methods and, usually, when it automatically searches for peaks, the left peak, which is set by the Lorentz function, is obtained too low, approximately, as in the pictures
minimax Posted - 07/29/2019 : 02:09:46 AM
Hi bodya67,

Unfortunately pa does not support manually pick points in the loop, we will check if we could improve.

But at the same time, have you ever tried all the methods under Peak Finding Settings branch?

From the screenshot of your plot, it seems that the peak position is not complicated, so we suppose one of the methods we provide may be able to find the peaks correctly.

In other words, you do not have to pick it by mouse?
bodya67 Posted - 07/26/2019 : 11:02:40 AM
Examples of fitting for the same original spectrum using two peaks of the same function and two different functions for each peak, respectively.

bodya67 Posted - 07/26/2019 : 10:47:44 AM
Hi minimax,
that's right, I need to click for each graphic. I can’t use nlfitpeaks because this function allows setting only 1 type of fitting function for both peaks, and I need to set 2 peaks with different fitting functions. Perhaps this can be done using another function, but I found that it can be done using the pa function, and I do not know other ways.
minimax Posted - 07/26/2019 : 03:22:46 AM
quote:
I myself set the peak positions, based on the type of the original spectrum


Hi bodya67,
Do you mean that the position is not predefined anywhere, and you need interactive operation same as nlfitpeaks to manually select from the graph for each dataset?

If this is true,
a. it cannot be in a silent loop since you need manual mouse click every time?
b. nlfitpeaks should already work well? Why needs to use pa instead? You still need to fit with baseline?
bodya67 Posted - 07/25/2019 : 6:25:15 PM
I myself set the peak positions, based on the type of the original spectrum, for each data set they are different.
Unfortunately, I can't send you the files because this is my research and I can't disclose the data
YimingChen Posted - 07/25/2019 : 5:00:10 PM
Hi,

Can we know where the peak positions info from? Are they different for different dataset? Do you want to 1) set it manually for each dataset 2) load the position from a external file or 3) read it from worksheet with each dataset?

Would you mind sharing with us your data files as well as the peak position info that we can check further? Please send it to <tech@originlab.com>.

Thank you

James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000