Interpolate2 with free waves
Henry S.
I'm trying to use interpolate2 with free destination waves and I haven't been successful.
First, the base case:
- x destination and y destination are normal - works as expected
- x destination normal, y destination free - works as expected
function interpolatetest1()
make/o/n=6 xsrc, ysrc
make/o/n=12 xdest
wave xsrc
wave ysrc
wave xdest
xsrc = p
ysrc = 2^p
xdest = p*0.5
interpolate2/i=3/x=xdest/y=ydest xsrc, ysrc
print xdest
print ydest
make/free/n=12 ydestfree
interpolate2/i=3/x=xdest/y=ydestfree xsrc, ysrc
print xdest
print ydestfree
end
make/o/n=6 xsrc, ysrc
make/o/n=12 xdest
wave xsrc
wave ysrc
wave xdest
xsrc = p
ysrc = 2^p
xdest = p*0.5
interpolate2/i=3/x=xdest/y=ydest xsrc, ysrc
print xdest
print ydest
make/free/n=12 ydestfree
interpolate2/i=3/x=xdest/y=ydestfree xsrc, ysrc
print xdest
print ydestfree
end
Using free waves:
- x dest is free, y dest is normal
- x dest is free y dest is free
Both result in "Function Execution Error, While executing Interpolate2, the following error occurred. The x destination wave must be single or double precision floating point." I also believe that I have had a case where the error did not occur, but the y destination values were returned with non-zero values. However, I haven't been able to consistently replicate that case.
function interpolatetest2()
make/o/n=6 xsrc, ysrc
make/free/n=12 xdest
wave xsrc
wave ysrc
xsrc = p
ysrc = 2^p
xdest = p*0.5
interpolate2/i=3/x=xdest/y=ydest xsrc, ysrc
print xdest
print ydest
make/free/n=12 ydestfree
interpolate2/i=3/x=xdest/y=ydestfree xsrc, ysrc
print xdest
print ydestfree
end
make/o/n=6 xsrc, ysrc
make/free/n=12 xdest
wave xsrc
wave ysrc
xsrc = p
ysrc = 2^p
xdest = p*0.5
interpolate2/i=3/x=xdest/y=ydest xsrc, ysrc
print xdest
print ydest
make/free/n=12 ydestfree
interpolate2/i=3/x=xdest/y=ydestfree xsrc, ysrc
print xdest
print ydestfree
end
Using normal waves in a free directory:
Again: "Function Execution Error, While executing Interpolate2, the following error occurred. The x destination wave must be single or double precision floating point."
function interpolatetest3()
make/o/n=6 xsrc, ysrc
wave xsrc
wave ysrc
xsrc = p
ysrc = 2^p
dfref dftemp = newfreedatafolder()
dfref dforig = getdatafolderdfr()
cd dftemp
make/n=12 xdest
wave xdest
cd dforig
xdest = p*0.5
interpolate2/i=3/x=xdest/y=ydest xsrc, ysrc
print xdest
print ydest
make/free/n=12 ydestfree
interpolate2/i=3/x=xdest/y=ydestfree xsrc, ysrc
print xdest
print ydestfree
end
I thought that in the past I'd figured out a way around this while continuing to use free waves, but for now, I'm just going to make normal waves and delete them when I'm done.
I'm using Win 8, Igor 6.3.1.2 32-bit. I've also observed this in several previous versions of Igor.
Thanks for any insight,
Henry
Choose Help->Updates for Igor to update your installation.
October 15, 2013 at 10:26 am - Permalink
Thanks again and my apologies for not checking the most recent release first.
Henry
October 15, 2013 at 12:55 pm - Permalink
Please excuse my resurrection of this very old discussion.
It seems that Interpolate2 is still fussy about mixtures of free and non-free waves as inputs and outputs. What are the rules for mixing free and normal waves? Should we expect Interpolate2 to work consistently for any mixture?
June 11, 2021 at 06:38 am - Permalink
In reply to Please excuse my… by tony
I think so. If you send an example to support I will investigate.
June 11, 2021 at 11:05 am - Permalink