smooth/ boxsmooth in procedures? BUG: InsertMultipleWavePoints?
schmaud
I need to smooth some waves in a procedure, I tried box smoothed via execute, but it did not work.
So i reverted to smooth,and got an empty wave and this:
BUG: InsertMultipleWavePoints
What am I doing wrong?
Thanks!
Ralf
(PS:Igor 6.0.4.0)
See: http://www.gerv.net/hacking/how-to-ask-good-questions/
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
November 19, 2012 at 11:12 am - Permalink
I have now a working ipf with execute and boxsmooth.
Current solution: I insert the "box" variable into a string via num2str. Would making this variable global work as well?
ex_st="boxsmooth "+num2str(filter)+",lw1,filtered"
execute ex_st
This works, but only upon the 2nd execution of the ipf, with the first I get an error regarding the filtered wave.
Any hints how to improve this?
cheers
Ralf
November 25, 2012 at 05:52 pm - Permalink
What is the exact error message?
My first thought it, the wave filtered does not exist on the first pass.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
November 25, 2012 at 06:48 pm - Permalink
If you are using Igor Pro 5.x then you do need to use Execute, or upgrade to Igor Pro 6.2.
In either case BoxSmooth requires that the destination already exist. You can insure that by using Duplicate/O on the source wave to create the destination wave.
If you are using Execute then you can access global variables in the executed command. However you should avoid globals if possible so I don't recommend it.
In Igor Pro 5.x or later you can also do box smoothing using Smooth /B. Smooth is a built-in operation so you can use it without Execute.
November 25, 2012 at 07:44 pm - Permalink
Thank you this is really helpfull.
on Igor 6.0xx box smooth did not work, with 6.2 it works fine.
Error was in using wave instead of make.... Thanks again for your help.
Ralf
old code:
variable filter=11
loadwave /n=lw /j
duplicate /o lw1, filtered
boxsmooth filter,lw1,filtered
...
November 26, 2012 at 09:41 am - Permalink