more /NWOK
tony
Would it be possible to add something like the /NWOK flag for curvefit to other commands that can optionally take an X wave?
Display w vs w_x /NWOK
AppendToGraph w vs w_x /NWOK
and interpolate2 are the commands that I most frequently wish had such a flag.
I end up with a lot of if blocks in my code that look like this:
if (waveexists(w_x))
appendtograph w vs w_x
else
appendtograph w
endif
appendtograph w vs w_x
else
appendtograph w
endif
Part of the driver for my addition of /NWOK for CurveFit and FuncFit was the shear number of optional waves in curve fitting. The only practical way to deal with it was to allow null wave references, or to use Execute, which is distasteful.
Display has just the one optional wave. Not saying no, but it's less compelling.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 17, 2017 at 09:24 am - Permalink
November 17, 2017 at 10:32 am - Permalink
if (WaveExists(xw))
AppendToGraph/W=$gname yw vs xw
else
AppendToGraph/W=$gname yw
endif
end
The /Z flag tells igor that a NULL wave is OK for xw; the WaveExists() function tests for the NULL wave.
This localizes the ugliness to just one function :)
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 17, 2017 at 12:09 pm - Permalink
Haha, that is just what I do!!
November 18, 2017 at 03:21 am - Permalink