CALIBRATE

Section: User Commands (1)
Updated:
Index
Return to Main Contents
 

NAME

calibrate - record calibration information  

SYNOPSIS

calibrate [calfile]  

DESCRIPTION

Calibrate allows you to record the calibration information for all your A/D converter's channels in a calibration file, for later use by the data capture programs (see dsepr(1)), or to change this information in an existing calibration file. The optional argument, calfile, specifies the calibration file to be modified. The default is default.cal, in your current directory.

Certain environment variables have a special meaning to calibrate, and to the capture programs. These environment variables specify various parameters related to the type of A/D converter used. The variables DACPCLK0 and DACPCLK1 indicate the device names for the first and second clocks, such as "/dev/dacp0/efclk0" and "/dev/dacp0/efclk1" for the EF12M. (The defaults for these are "/dev/dacp0/clk2" and "/dev/dacp0/clk3".) Calibrate only uses DACPCLK1. On Linux-based PowerDAQ systems, the A/D doesn't have separate device nodes for the clocks, so these variables are simply set to the same device name as the DACPAD variable. The variable DACPAD indicates the device name for the A/D converter. (The default for this is "/dev/dacp0/adf0".) For systems configured to use a networked capture server, such as any NI USB or PCI based systems, as well as any 64-bit Linux system, the DACPAD variable will instead indicate the URL used to contact the server. ADGAINTYPE should be set to "2" on your machine if gains increase by powers of 2 rather than powers of 4. ADGAINTYPE should be set to the power by which gains on your A/D converter increase, e.g. 10 for an A/D that supports gains of 1, 10, 100 and 1000, and it should be set to "1" for converters that don't have programmable gain. ADRANDOM must be set to "no" if your hardware cannot support random channel addressing. ADMAXLEV must be set to the maximum input voltage of your A/D converter (in microvolts), if it is anything other than the default of "5000000". ADGAINCODE can be set to the desired default gain code (0 to 3), if the standard ±5V input range is inappropriate. Note that this sets the gain code, not the resulting gain factor, which is dependent on the type of A/D converter on your machine. MAXADCHANS should be set to the number of channels supported by your A/D hardware, if it is anything other than the default of "16". All of these environment variables should be set in your ".login" file, so you won't have to bother setting them each time.

When invoked, calibrate prints the following menu prompt line:

Calibrate Edit Gain Import Name Print Quit View-settings Write

An operation is initiated by typing a single letter, the first letter of an item in the menu line. You can also step through the menu using the space bar and the backspace (or erase) key, to highlight the item you want, then press RETURN to select that item.  

Calibrate

This selection allows you to modify the calibration information for a channel. You will be prompted for a channel number, from which the calibration levels will be sampled. You will then be prompted to hit RETURN to measure the zero level for the specified channel. Set the selected channel's input to this level, then hit RETURN.

Next, you are asked whether you want to measure the calibration peak from a pulse, as opposed to measuring just the peak level. If you answer N, (i.e. you want to measure just a level,) then you will be prompted to hit RETURN to measure the peak level. Set the selected channel's input to this level, then hit RETURN. Otherwise, if you want to measure a pulse, answer by typing Y, or simply hitting RETURN. Then you are prompted for the pulse triggering threshold (in A/D units). A default, which will normally be appropriate, is shown in the prompt. You may specify a smaller value if previous attempts failed to find a pulse, or a larger value if you suspect that noise previously caused false-triggering. You are then prompted to hit RETURN to start scanning for the pulse. Once you do so, the selected channel will be sampled until a pulse is received, or until ten seconds have elapsed.

You will finally be prompted for the calibration level in microvolts. Enter the value and hit RETURN. The program then redisplays the updated settings, and the menu line.  

Edit

This selection allows you to manually modify the calibration information for a channel. You will be prompted for the channel number, for which the calibration levels are to be edited. You will then be asked for the zero level, followed by the calibration pulse height, both in A/D units. These two values are entered as numbers, rather than being measured from the A/D converter. You will finally be prompted for the calibration level in microvolts. Enter the value and hit RETURN. The program then redisplays the updated settings, and the menu line.  

Gain

This selection allows you to modify the gain factor for a channel, or for all channels. If your hardware does not support random channel addressing (if the environment variable ADRANDOM is set to "no"), then this operation will set the gain for all channels. Otherwise, gains can be set independently for any channel: you will be asked for a channel number, for which the gain factor is to be changed.

You will be prompted for the gain factor (1, 2, 4 or 8 if the environment variable ADGAINTYPE is set to "2"; 1, 4, 16 or 64 if ADGAINTYPE is 4, which is the default if it's not set; or powers of ADGAINTYPE otherwise). Enter the value and hit RETURN. The program then redisplays the updated settings, and the menu line. If your hardware does not support programmable gain (if ADGAINTYPE is set to 1), then you'll just get a warning to that effect rather than being asked for the gain, and the gain code will be reset for all channels.  

Import

This selection allows you to replace all of the calibration information in your current calibration file with calibration information copied in from another file. You will be prompted for a file name. The information is then copied from the file you specify. If there are any errors in accessing the file, a message will be printed.  

Name

This selection allows you to assign a name to a channel, to identify the signal present on that channel. This name is kept with the calibration information, and thus, is stored as part of subsequently captured runs of data. You will first be prompted for the channel number. Then, you are prompted for the name, which can be up to 42 characters long.  

Print

This selection allows you to print out the calibration information displayed on screen. A new menu is presented, allowing you to choose how to print it out.

The File selection allows you to store the calibration information in a printable ASCII text file. You will be prompted to enter the file name. If you enter a file name, the text will be stored in this file. If the file already exists, it will be overwritten.

The Printer selection allows you to print the calibration information directly to the printer. The lp program is invoked to print the displayed text. Before beginning this operation, make sure the printer is powered up, on-line, and ready to print.

The Quit selection returns you to the previously displayed menu.

The Video selection does not send the text directly to the printer, but instead produces a printed copy of the video display's current contents - a screen dump - by invoking sdump(1). The same thing can be accomplished by pressing the quit key, normally Control-B. The Print/Video operation has the advantage that it can be used even when the program is reading its commands from a file, rather than the terminal. Also, the Print/Video operation clears the menu area before performing the screen dump.  

Quit

This selection causes the program to terminate. If you modified any of the calibration information, and you did not write it out to a file, you will be asked whether you want to do so now. You should respond by typing the single letter Y, meaning yes, or N, meaning no. If you respond with Y, the write operation will be performed before quitting (see below). This will be repeated until either the information is successfully written to a file, or an N is typed in response to the question.  

View-settings

This operation simply prints out the current calibration information for each of the channels. The values printed are the gain factor, the zero and peak levels in A/D units, the calibration level in microvolts, and the signal name for each channel. Although this is done automatically when calibrate starts up, and when changes are made, this operation can be used to refresh the screen when it is cleared by a shell escape.

Note that if there are more channels than can be displayed on screen at once, only a partial set of channels will be shown, and you will be able to scroll through using the arrow keys or + and - keys as described below.  

Write

This selection allows you to write out the calibration information to a file. You are first prompted for a file name. If you simply hit RETURN without typing a file name, then the file name that appears in the prompt will be used. The information is then written to the file. If there are any errors in accessing the file or writing out the data, a message will be printed.  

!command

Whenever the menu line has just been printed, instead of typing a letter to select a menu item, you can type an exclamation point, followed by any UNIX command, then hit RETURN. A UNIX shell is invoked to interpret and execute this command. You can recall and edit the last command entered, by hitting the "up arrow" key, or Control-K, after typing the exclamation point.  

$ or %

Whenever the menu line has just been printed, you can also type either a dollar sign ($), to invoke an interactive Bourne shell, or a percent sign (%), to invoke an interactive C shell. In either case, the shell will continue accepting commands until you type a Control-D, to exit from the shell, and return to calibrate.  

? or /

Whenever the menu line has just been printed, you can also type either a question mark (?), or slash (/), to get a short description of all choices available in the current menu.  

+ or -

If there are more channels on your A/D converter, or in the current calibration file, than can be displayed on a single screen, then you can use the + or - keys, or the up and down arrow keys, to scroll through the list of channels currently displayed.  

OVERVIEW OF CALIBRATION

Channel names and gains are generally assigned before data capture by use of the calibrate program to create a default.cal file. Other files can also be created (with the .cal suffix) by this program, if you want to maintain separate calibrations in a single directory.

The default.cal file is the only calibration file that the cap program (and the cavg(1) program) can use. The cap program will look first in the current directory, and then in /usr/neuro/lib for the file default.cal. If you created other .cal files in the current directory, you must copy the one you want to use to default.cal, before you run cap. E.g.:

cp dualintra.cal default.cal

The information in default.cal is only used for capture. The cap program writes this information in the run header (at the start of the .frm file), for all channels used in the capture. Programs that display data from the captured traces or waveforms will make use of the calibration information in the run header, not in default.cal.

Channel names and calibration values can be modified after data capture. You can use the calibrate program to update your default.cal file, then use fixcal (usually with the -f option) to transfer the new calibration to any .frm file.  

FILES

default.cal                    default calibration file

The file format is simply an array of calinfo structures, one for each channel on the A/D converter, as described in frmfile(5). Historically, calibration files had information for only 16 channels. Now that A/D converters with more channels are supported, the length of the calibration file will vary depending on the number of channels of the A/D converter on the system that creates the file.  

SEE ALSO

fixcal(1), cap(1), dsepr(1), sdump(1), lp(1)
 

Index

NAME
SYNOPSIS
DESCRIPTION
Calibrate
Edit
Gain
Import
Name
Print
Quit
View-settings
Write
!command
$ or %
? or /
+ or -
OVERVIEW OF CALIBRATION
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 17:58:02 GMT, February 20, 2019
Copyright © G. R. Detillieux, Spinal Cord Research Centre, The University of Manitoba.