Frequently Asked Questions about Igor
- Why can long, descriptive wave names cause problems?
- Why shouldn’t I put units in wave names?
- Why shouldn’t I change the name of a column?
- Why won’t my error wave show up in the fitting dialog?
- Why won’t a popup list of waves show up in the fitting dialog?
- Can I perform a fit using uncertainties in both x and y?
Why can long, descriptive wave names cause problems?
Although Igor allows you the freedom to name your wave why I love to make my wave names so descriptive, you’ll save yourself headaches by avoiding spaces in wave names. Waves are identified by their names. The first space appears to end the wave name, unless you surround the whole name with single quotes: 'why I love to make my wave names so descriptive'.
Why shouldn’t I put units in wave names?
Igor has a nifty way of associating physical dimensions to both the values in a wave and to its scaling. If you use the Sample Variance panel from the HMC menu, you have a direct means of entering units. Alternatively, use the Data|Change Wave Scaling… command.
Why shouldn’t I change the name of a column?
Coming from a spreadsheet, a natural way to change the name of a data column would be to edit the column head. Unfortunately, in Igor this does not do what you think it might. It doesn’t change the name of the wave shown in the column, it merely changes its label in the table. So, don’t double-click to edit the column head; right-click to Rename the wave.
Look carefully at the title bar of the window shown above, which lists the names of the three waves shown in the table. The middle wave is listed as wave0 in the title bar, but as height in the body of the table. Why? Because the text of the column head was changed, not the wave name itself, probably by double-clicking on the column head and filling out the Title box near the bottom of the dialog shown here.
Moral: do not double-click on the column head to change the title; right-click on the column head and choose Rename... from the popup menu.
Why won’t my error wave show up in the fitting dialog?
There a few different possibilities that could cause this problem. The first thing to check is whether your data is in a text wave, not a numeric wave. This can happen because you imported from a file and the titles at the top of the file confused Igor or because the first thing you typed in a new column of a data sheet was text, not numbers. Igor has to decide whether to create a text or numeric wave when you begin a new column. It takes its cue from the first thing you type. So, be sure to type a number first. To check whether your wave is a text wave, locate it in the Data Browser (in the Data menu). Then check the information supplied when you click on the wave's icon, as illustrated in the figure.
If the wave is a text wave, you can convert it to a numeric wave with the command toNumeric(wavename), if you have installed the HMC menu.
Another possibility is that the wave you want to reference doesn't have the same number of points as another wave you are using. For example, if you are running a fit and trying to use a wave for uncertainties, unless the wave with uncertainties has the same number of points as the \( y \) wave, it won't show up as a possible wave in the fitting dialog. The figure illustrates the problem, which you can fix by right-clicking on the extra cell(s) and deleting the corresponding points from the wave.
Why won’t a popup list of waves show up in the fitting dialog?
Sigh. This is an intermittent bug that WaveMetrics can’t seem to squash. Here’s a klunky work-around.
- In Igor, hold down the shift key and from the Help menu select Show Igor Preferences Folder.
- Open the file Igor Dialog Preferences in a text editor (not a word processor).
- Search for “Curve Fit.residWaveWB.popwb” and compare the lines to
the following:
Curve Fit.residWaveWB.popwb.height=312 Curve Fit.residWaveWB.popwb.hoff=0 Curve Fit.residWaveWB.popwb.left=181 Curve Fit.residWaveWB.popwb.top=321 Curve Fit.residWaveWB.popwb.voff=0 Curve Fit.residWaveWB.popwb.width=200
If any values are different, adjust them to equal those shown here, then save the file. That should fix the problem.
Can I perform a fit using uncertainties in both x and y?
Yes, indeed! Unfortunately, you cannot pull this off using the fitting dialog alone, but the amount of command-line typing is quite modest. You just have to include some extra information in the fitting command. Here’s an example. Suppose you have done a fit using the dialogs and the following command got written to the history area:
CurveFit /NTHR=0/TBOX=790 line ywave /X=xwave /W=ywave_err /I=1 /D /R
To make the fitting operation include errors stored in xwave_err for the values of the independent variable, copy the fitting command and add the parts shown in red
CurveFit /NTHR=0/TBOX=790 /ODR=2 line ywave /X=xwave /W=ywave_err /I=1 /XW=xwave_err /D /R
Note that the ordering is only somewhat flexible. The switch /ODR=2 needs to appear before the name of the fitting function, which is line in this case. Similarly, the switch /XW needs to appear after ywave.
In the above commands, the final switch /R makes Igor produce a wave of residuals. When you use both x and y uncertainties, you can produce a wave of x residuals, too. First preallocate a residual wave:
Duplicate xwave Res_xwave
Then modify the fitting command to compute the x residuals:
CurveFit /NTHR=0/TBOX=790 /ODR=2 line ywave /X=xwave /W=ywave_err /I=1 /XW=xwave_err /D /R /XR=Res_xwave
To get a panel of x residuals to show up on the right side of the graph, use the following commands
AppendToGraph/B=berr/VERT Res_x vs ywave ModifyGraph marker(Res_x)=19,mode(Res_x)=3 ModifyGraph axisEnab(bottom)={0,0.75},axisEnab(berr)={0.8,1},freePos(berr)={0,kwFraction} ModifyGraph tick=2,zero(berr)=1,mirror(berr)=1,standoff=0