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
 Average of selected range for normalization
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jenskruse

Albania
Posts

Posted - 01/15/2009 :  08:46:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and SR (Select Help-->About Origin):
Operating System: 8Pro SR4

Hi,

Is it somehow possible to select with the data selector tool a range in a spectrum and calculate the average value of this range and using then this value to normalize the whole sectrum? I have a work around with many clics but it is very time consuming .

thanks a lot for our help,

cheers,
Jens

cpyang

USA
1406 Posts

Posted - 01/15/2009 :  12:55:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following code should work:


	// save the current marker positions
	int nLeft = MKS1;
	int nRight= MKS2;

	sum(%C);
	
	MKS1=-1;//remove the data markers
	%C/=sum.mean;// normalize whole curve
	MKS1=nLeft;
	MKS2=nRight; // restore the data markers


CP
Go to Top of Page

greg

USA
1379 Posts

Posted - 01/15/2009 :  3:03:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This script will run the Data Selector tool. When you are satisfied with the position of the Data Markers, press Enter to normalize the curve.

dotool 4; // Data Selector mode
def pointproc {
// remember size
get %C -e last;
// set limits by tool
set %C -bs mks1;
set %C -es mks2;
// calculate mean of this range
sum(%C);
// remove Data Markers
mks1 = -1;
// Restore full range
set %C -b 1;
set %C -e last;
// Normalize
%C /= sum.mean;
// shut off Data Selector
dotool 0;
}
Go to Top of Page

jenskruse

Albania
Posts

Posted - 01/16/2009 :  09:53:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I works !
Thanks for your help.

jens
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