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
 Forum for Origin C
 integration in origin C
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ovince

Yugoslavia
Posts

Posted - 06/13/2006 :  12:34:32 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello to all,

I have spectra in Worksheet columns. The numeber is quite huge. What I would like to do is to normalize each spectrum with flux ie to divide each column with the column's integral. I belive there is an easy way to perform the integration and divison using Origin C (maybe with help of LabTalk). Anybody to help me with this?

Thanks in advance
Oliver

zachary_origin

China
Posts

Posted - 06/14/2006 :  01:13:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oliver,

The function in OC goes like this,



void integral_normalize()
{

BOOL bErr;
Layer lyAct=Project.ActiveLayer(); // get active layer
Worksheet wks = lyAct; // get the worksheet
Dataset dsX( wks, 0 ); // col(A) as X
Dataset dsY( wks, 1 ); // col(B) as Y
Curve crvMyCurve( dsX, dsY ); // Create Curve object to integrate
IntegrationResult irMyResults; // Origin C structure to store integration results
bErr = Curve_integrate( &crvMyCurve, &irMyResults, NULL, NULL, TRUE ); // Perform integration
double dIntegral = irMyResults.Area; // get the integration result.
dsY = dsY/dIntegral; // normalize the data
}




Assume col(A) and col(B) are X and Y respectively, if not, you can do some modification on the code.

Compile and execute the function in Code Builder with the worksheet active, then Col(B) will be normalized.

It is tested under Origin75Pro SR6, OS: XP-sp2.

Hope it helps.


Zachary
OriginLab GZ Office

Edited by - zachary_origin on 06/14/2006 01:14:42 AM
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 06/14/2006 :  03:36:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks many,

The program works giving fine results. Thanks again

Oliver
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