The problem is complicated because there can be more than one set of variable gain steps (often both ``coarse'' and ``fine'' steps are provided), and because the actual gain values may not be well known. In the latter case, we would like to determine them, if adequate calibration data are available.
This is handled by having up to three columns containing the gain codes; these codes may actually be strings representing the approximate values in magnitudes, or other convenient labels, such as switch positions recorded in the raw data stream. The columns are named GAIN1, GAIN2, and GAIN3.
A character descriptor, GAINTBL, in the observational-data table gives the name of a MIDAS table file, whose columns are again labelled GAIN1, GAIN2, and (if needed) GAIN3 (see Table I.19). The reference column of this table contains the gain codes, and is labelled CODES.
Note that the gain values are multipliers or scale factors; they are not expressed in magnitudes. The true signal is the value in SIGNAL multiplied by the value(s) in the GAINn column(s). It is immaterial whether the largest or the smallest gain is assigned the value unity; the scale is perfectly arbitrary.
All the gains are of course pure numbers, and so have no units. It is the user's responsibility to make sure the gain columns in the gain-table and the data-table files match up correctly. To assist this matching process, both files may contain a character descriptor named GAINNAMES, containing up to three words (separated by commas) that name the three gain adjustments.
The gains should be determinable to extremely high accuracy by purely electrical measurements. In some cases, the measurements have not been done, and only nominal values are available, perhaps based on resistor tolerances. The uncertainties should be placed in the GAINERROR columns.
If the gain steps are unknown, the GAINTBL descriptor should contain one space. If adequate calibration data are available, the reduction program will try to construct a gain table, with the default name gain.tbl.
This table is a little peculiar, in that it is unlikely that the same names will be used for the steps of the different adjustments. For example, the high gain steps might be coded by letters, but the fine steps by numbers. In such cases, only one column in each row will have values defined. This causes no problems, as only the combinations that have meaning should occur in the data.