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
 LabTalk Forum
 smoothing script wanted!

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
Pythe 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
2   L A T E S T    R E P L I E S    (Newest First)
Pythe Posted - 10/15/2004 : 05:14:22 AM
Hi Mike,

Thanks for the code. Works perfectly!

Pythe
Mike Buess 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

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