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 |
|
|