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 for Programming
 Forum for Origin C
 integration in origin C

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
ovince Posted - 06/13/2006 : 12:34:32 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
ovince Posted - 06/14/2006 : 03:36:25 AM
Thanks many,

The program works giving fine results. Thanks again

Oliver
zachary_origin Posted - 06/14/2006 : 01:13:46 AM
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

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