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
 Accessing the X dataset of a dataplot

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
hover Posted - 05/19/2006 : 04:49:19 AM
Origin Version (Select Help-->About Origin): 7.5SR1
Operating System: XP

Could you please suggest the way to access X dataset of a given graph? The following piece of code obtains Y datasets nicely, but not X.

==========
GraphLayer gl = GetActiveGraph();
foreach(DataPlot dp in gl.DataPlots)
{
dp.GetRange(i1, i2);
Dataset ds1;
ds1.Attach(dp.GetDatasetName());
// ...
}
==========

What I am trying to write is a custom menu function that would process only the currently visible parts of the graphs, interpolating them and finding the precise locations of the peaks of all the curves in the family - typically, spectra at different temperatures etc. The exact algorithm of interpolation is to be chosen - I would start with parabolas, perhaps, or try splines. It is crucial to have resolution better than the increment in the X dataset, but on the other hand, fitting the entire line does not work, since the shape is quite complex and changing.

Regards,
Yar
2   L A T E S T    R E P L I E S    (Newest First)
hover Posted - 05/19/2006 : 11:44:13 AM
Thanks!
Mike Buess Posted - 05/19/2006 : 09:26:48 AM
Hi Yar,

Attach a curve to dp and either (1) use crv.HasX() to find its X dataset name or (2) use Curve_x() to find the X values at i1 and i2...

dp.GetRange(i1,i2);
Curve crv(dp);
string strX;
crv.HasX(strX);
out_str("X dataset: " + strX);
double dx1 = Curve_x(&crv,i1);
double dx2 = Curve_x(&crv,i2);

Mike Buess
Origin WebRing Member

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