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
 left of peak center xaty50

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
zknauss Posted - 08/29/2022 : 09:58:22 AM
I am trying to get the interpolated value of X at the average of minimum and maximum of Y values on the left side of a curve. For a full curve this would be done xaty50(x_y_curve); however this would calculate using data both on the right and left of peak center. I'd like to get the xaty50 using only those x/y values < the x of peak center which I have defined as Xc. Thank!

ZTK
4   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 08/30/2022 : 2:22:39 PM
To check the slope, you will need to take the derivative of the curve. Please check this function.
https://www.originlab.com/doc/OriginC/ref/Curve-Derivative-GlobalFunction

YimingChen Posted - 08/30/2022 : 2:18:55 PM
The code I provided is just an example that assumes only one peak in the curve and finds the x value at half Ymax to the left of the peak.

Please check the GetSubVector() function page. It returns a subvector by specifying the start and end indices into the vector.
https://www.originlab.com/doc/OriginC/ref/vectorbase-GetSubVector
so to get the curve from peak max to baseline, the code would be
vDataX.GetSubVector(newX, nIndexMax, -1);

James


zknauss Posted - 08/29/2022 : 4:57:40 PM
Before I can test this I'll need to integrate it ino the fitting function just as a double check my data does't always have a true zero as its looking at a set of variable peaks over a period of time which can have high or near zero (no y=0) peak to peak resolution would it be possible to adjust to the formula so instead of looking for a y=0 it would look for when slope(y)=0?
Also to get the curve going from peak max to baseline would this script just be reversed i.e. vDataX.GetSubVector(newX, nIndexMax, 0); Thanks!

ZTK
YimingChen Posted - 08/29/2022 : 10:55:56 AM
Can you try the code below?

bool bOK = x_y_curve.CopyData(vDataX, vDataY);
double dMin, dMax;
uint nIndexMin, nIndexMax;
vDataY.GetMinMax(dMin, dMax, &nIndexMin, &nIndexMax);   
vector newX, newY;
vDataX.GetSubVector(newX, 0, nIndexMax);
vDataY.GetSubVector(newY, 0, nIndexMax);	
Curve crv1(newX, newY);
double halfx = xaty50(crv1);

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