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
 Accessing the X dataset of a dataplot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hover

Russia
Posts

Posted - 05/19/2006 :  04:49:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 05/19/2006 :  09:26:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

hover

Russia
Posts

Posted - 05/19/2006 :  11:44:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!
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