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 .
// 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
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; }