| Author |
Topic  |
|
|
Pythe
Netherlands
Posts |
Posted - 10/12/2004 : 09:06:17 AM
|
Hi,
I don't know anything (yet) about making or even using scripts, so I hope someone is willing to help me with the following:
I want to perform a Savitzky-Golay smoothing on all the Y-data in my worksheet (sharing one X-data column) and create a new worksheet with the same X-data column and the adapted Y-data columns. Can someone write a script, tell me how to use it and where I can alter the smoothing parameters if necessary?
Thanks a lot!
Pythe |
|
|
Mike Buess
USA
3037 Posts |
Posted - 10/12/2004 : 11:18:48 AM
|
Hi Pythe,
This script will duplicate and smooth the active worksheet using SG method. Results will go to the duplicate wks. To execute... copy all lines to the script window, adjust polydeg and pts as desired, then select all lines and press Enter.
polydeg=3; // polynomial degree (1-9) pts=2; // number of pts to smooth on right and left %I=%H; // name of active wks win -d; // duplicate doc -e W {%R=%H}; // find name of new wks curve.polydeg=polydeg; curve.smoothleftpts=pts; curve.smoothrightpts=pts; curve.smoothpts=2*pts+1; curve.x$=%(%I,1); loop (i,2,wks.ncols) { curve.data$=%(%I,i); curve.result$=%(%R,i); curve.SGSmooth(); }; win -a %R; // active results
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 10/12/2004 11:20:13 AM |
 |
|
|
Pythe
Netherlands
Posts |
Posted - 10/15/2004 : 05:14:22 AM
|
Hi Mike,
Thanks for the code. Works perfectly!
Pythe |
 |
|
| |
Topic  |
|
|
|