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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 baselines for many spectra
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Phillip T.

Germany
19 Posts

Posted - 02/16/2021 :  09:25:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello Everyone,

i am trying to create baselines for some spectra but want to review the anchor points before going to the next baseline. I am using the pa command as such (in a loop):

pa iy:=[%H]slectspec!col($(ii)) smode:=1 theme:=2w_IrO2;

If i use smode :=0 it works fine but i cant review the anchorpoints. If i use smode :=1 i can review the first baseline fit and then it brakes the loop and the program stops.

origin verison : b9.5.5.409
OS: win 10

Thank you.

Edited by - Phillip T. on 02/16/2021 09:26:27 AM

easwar

USA
1965 Posts

Posted - 02/16/2021 :  12:14:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Phillip,

I have data arranged as XYYY and I tried the following script

for(int ii=2; ii<=4; ii++)
{
  pa iy:=[book1]1!(1,$(ii)) smode:=0 theme:=mygauss;
}

an it worked for me, although all three PA preview windows opened right away, and I had to click on the next preview to continue to next data etc.

Can you try changing your iy to include the X column, and not just y?

Easwar
OriginLab
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 02/17/2021 :  02:43:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello easwar,

thanks for your reply. I tried using "for" instead of "loop" and changed the column reference. Still the same result

Here is the complete code i use:

//////////////
for(int ii=2; ii<= $(speccols); ii++) {

pa iy:=[%H]slectspec!(1,$(ii)) smode:=0 theme:=2w_IrO2;

blWNcol =$(speccols)+1 ;
blcol = $(speccols)+2 ;

range bl = [%H]slectspec!col($(blcol));

range put = [%H]baselines!col($(ii));

put=bl;

del col($(blcol));
del col($(blWNcol));

};
//////////////////

When I remove the code after the pa command the first spectrum still opens but i also get the error massage "Warning! no data selected" (in german, not sure if its the same in english) however going through the code line by line does not produce that error.
Go to Top of Page

easwar

USA
1965 Posts

Posted - 02/17/2021 :  09:29:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Phillip,

It may just be that the px x-Function cannot be used as it is now, in a loop. Our developers may need to look at this, so I will discuss here.

In the mean time, can you share a few of your spectra? Perhaps we can also improve auto baseline detection so you don't have to adjust one by one in a loop?

You can share the files by starting a ticket here:
https://www.originlab.com/restricted/support/index.aspx?c=3

Please mention this post in your message.

Easwar
OriginLab
Go to Top of Page

easwar

USA
1965 Posts

Posted - 02/17/2021 :  09:43:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Phillip,

We will look into this further, and see if a new X-Function is needed for such operation within a loop. Thank you for sharing your user story. I have created a request to our development team (ORG-23219)

Thank you,

Easwar

P.S. Please share your data if ok, so we can still look at the baseline detection improvements
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 02/19/2021 :  02:07:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Easwar,

sorry for the late answer, I was quite busy and forgot.

Sure I can share my spectra but they are quite specialized and go through other normalization procedures before substracting the baseline. These normalization procedures create some distortions and I dont think an algorithm will be able to recognize those and i place my baseline anchor points as fixed y values. But you are welcome to try.

Regards,
Phillip
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 02/19/2021 :  02:13:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Unfortunately the files are too large to share
Go to Top of Page

minimax

358 Posts

Posted - 02/24/2021 :  04:26:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Phillip T.

Unfortunately the files are too large to share



Hi Phillip,

Would you mind to upload to FTP instead?
https://www.originlab.com/index.aspx?go=Support/SendFilestoSupport

Or if you have some share link for us to download, it is also welcome.

Max
OriginLab Technical Support
Go to Top of Page

minimax

358 Posts

Posted - 02/25/2021 :  02:11:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Phillip,

PA will create a new graph window to start analysis, so %H will change.

You may modify your script a bit to see if it works? like

string srcbook=%H;

for(int ii=2; ii<= $(speccols); ii++) {

pa iy:=[srcbook$]slectspec!(1,$(ii)) smode:=0 theme:=2w_IrO2;

...
range bl = [srcbook$]slectspec!col($(blcol));
range put = [srcbook$]baselines!col($(ii));
...

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000