smooth/ boxsmooth in procedures? BUG: InsertMultipleWavePoints?

Hallo,

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)
Sorry I forgot to update...

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?

wave filtered

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

schmaud wrote:
Sorry I forgot to update...

Any hints how to improve this?


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
In Igor Pro 6.x, BoxSmooth can be invoked directly from a user-defined function so you do not need to use Execute.

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.
Hallo,

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:
wave lw0,lw1,filtered,w_coef
variable filter=11

loadwave /n=lw /j
duplicate /o lw1, filtered

boxsmooth filter,lw1,filtered
...