T O P I C R E V I E W |
qqqqq5edu |
Posted - 06/13/2006 : 5:12:58 PM How to smooth all curves simultaneous using adjacent averaging.?? I try hard ,but find I can smooth only one at one time in one graphy which has multiple curves?
I appreciate it a lot.
|
6 L A T E S T R E P L I E S (Newest First) |
minimax |
Posted - 06/19/2006 : 9:24:58 PM quote:
Thanks, Easwar. It works. But I really do not like programming in Origin C as a lot of commands have to be memorized and actually most users are just users, not interested in or familiar with embedded programing, never mentioning having time to learn programming.
I appreciate your help.
Hi Jun Wang, In Origin's next coming version, we have already supported simultaneously smoothing multiple curves just by point-and-click, which I think will be greatly helpful.
Max OriginLab GZoffice |
qqqqq5edu |
Posted - 06/19/2006 : 7:40:11 PM Thanks, Easwar. It works. But I really do not like programming in Origin C as a lot of commands have to be memorized and actually most users are just users, not interested in or familiar with embedded programing, never mentioning having time to learn programming.
I appreciate your help. |
easwar |
Posted - 06/16/2006 : 4:31:15 PM Hi,
So you basically want to smooth all curves plotted in a graph layer and get a result worksheet with the smoothed data - and you want to do this without having to select one curve at a time using the GUI...
Try the script pasted below. Make your graph active, copy-paste all lines of script into script window, then higlight and select all the pasted lines and press Enter key.
If this is what you want, you could tweak the script to make changes and then you can look up programming help on how to put the script into an OGS file and run it, or make a button and have the script run from a new button etc.
Hope this helps.
Easwar OriginLab
// Make graph with raw data curves active and // then run this script // %a=%h; // save graph name create.wksName$="Smooth"; // create result wks create.wksLabel$=Smooth Results for %a; create.template$="Origin"; create.wks(junk); %b=create.wksname$; win -o %b // delete cols in result wks { del col(1); page.title=3; };
layer -c; // count number of data plots in layer for(i=1; i<=count; i++) // loop over plots { %a=%(i,@d); // get name of dataset of plot ix = i * 2 - 1; // ix is index for x result column iy = ix + 1; // iy is index for y result column win -o %b // run script on result worskhet... { wks.addcol(X); // add x, y columns wks.addcol(Y); wks.col$(ix).type=4; // set y column label using dataplot name wks.col$(iy).label$ = Smoothed %a; }; %(%b,ix)=xof(%a); // Set result x same as raw data x curve.data$=%a; // Use curve object to smooth curve.SmoothPts=10; // Change number of points for averaging here... curve.result$=%(%b,iy); curve.adjave(); // Use adacent averaging layer.include(%(%b,iy),200); // Plot smoothed result set %(%b,iy) -c 2; // Set smoothed result curve color to red win -o %b {wks.labels();}; // Show labels on columns in result wks };
|
qqqqq5edu |
Posted - 06/15/2006 : 2:04:00 PM Either of them is not working, or not solving the problem.
My qeustion is following:
Since currrent command in Originpro 7.5 about adjacent averaging is that in a multiple curve graph, you can only smooth one curve at one time and also can see the smoothed curve worksheet. However, my single molecular fluorescence spectra has like 10 or 20 curves in one graph and I want to adjacently average them simultaneously using like 10 points or 20 points, then I want to get respective worksheet for each smoothed curve. |
easwar |
Posted - 06/14/2006 : 12:08:34 PM quote:
How to smooth all curves simultaneous using adjacent averaging.??
Hi,
If what you meant is that you have multiple curves and want to treat them all as one dataset and then do smoothing, you could do the following:
1> With the graph active, use the menu item Analysis->Average Multiple Curves This will first average all your data and create a single averaged result curve that will be plotted on the graph The averaged curve itself may be effectively smooth and you may not need to smooth further 2> If you wish to smooth the averaged curve further, make the average curve as the active curve (can use Data menu and the listing at the bottom to select the averaged curve and make that active). Once that curve is active, you can use the Analysis->Smoothing->Adjacent Averaging menu item to smooth the averaged curve.
Easwar OriginLab
|
Deanna |
Posted - 06/13/2006 : 10:22:49 PM Hi. You need to use Origin C to write a function to smooth multiple curves. For example, the following function smooths all the curves in the active graph page.
void SmoothMultiCurve() { Layer lyAct=Project.ActiveLayer(); GraphPage gpAct=lyAct.GetPage(); if (!gpAct) return; foreach(GraphLayer gl in gpAct.Layers ) { int iIndex=0; DataPlot dp; do { dp = gl.DataPlots(++iIndex);
if (dp) { Curve cc(dp); smooth(cc); } } while(dp); } }
I test this function in Origin Pro 7.5 SR6. You may modify the function as you need.
Deanna OriginLab GZ Office
Edited by - Deanna on 06/13/2006 10:31:51 PM |
|
|