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
 Origin Forum
 Background subtraction with batch processing

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
kimahri01 Posted - 01/09/2018 : 09:48:16 AM
Origin Ver. 2016(64 bit) and Service Release b9.3.226
Operating System: Windows 10

Hi I am Kim. I have some problem with background subtraction. I have read this topic https://www.originlab.com/forum/topic.asp?TOPIC_ID=9797
and I tried to modify a script but it did not work.

I have column A to I.
I set A as X and the others are Y.
My background is column D. I want to subtract background(column D) to column B to H. So I adjust the code to

for(ii=2;ii<=wks.ncols;ii++) wcol(ii)=wcol(ii)-col(4);

However, when I run this code, it subtracted column B to D only. It did not subtract the column after D. I do not know about the code well. Could you please give me a suggestion?

Another question is I cannot use peak analyzer theme for batch processing with using existing dataset for the background. I understood that I have to fix the data set for an only active worksheet to be a background. So when I use this to another worksheet, it failed. How could I do that for background subtraction without a script for batch processing for many worksheets imported as mentioned above?

Thank you

3   L A T E S T    R E P L I E S    (Newest First)
Drbobshepherd Posted - 01/19/2018 : 09:17:15 AM
Kim,

Now that you have your background subtraction script working correctly, you can use it for batch processing. There are many ways to do this. I like entering scripts in an import filter, if possible. This approach will execute your script every time you import a data file. (This works most easily if your data files have a unique extension. Unique file extension usually means a unique filter, and Origin can automatically apply it. If more than one filter exists for your files, you will be prompted to choose).

Read the help files on how to create a custom import filter. It will save time. Then batch processing could simply(and quickly) be done by dragging your data file icons from MS Windows Explorer over to the Origin workspace. It is called Drag and Drop. Look it up.

DrBob
kimahri01 Posted - 01/09/2018 : 11:53:45 PM
Dear Drbobshepherd

Thank you very much. I got it.
Drbobshepherd Posted - 01/09/2018 : 2:28:01 PM
When your loop gets to ii=4, your routine zeroes the background array, Col(4). Then the rest of the loop subtracts zero from the remaining arrays, so it looks like the loop stopped. Store your background array in Col(2), and start your loop with Col(3).

DrBobShepherd

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