All the background subtraction tasks are performed by mean of this command. In the specific case of a spectral background subtraction, either automatical or interactive rebinning is also possible.
The command structure is identical in the spectral case (qualifier /SPECTRUM) and in the light curve case (qualifier /LIGHT_CURVE), save for the automatic rebinning option which is available only in the spectral case. Also, in the spectral case a table name must always be specified for the output table containing the background subtracted spectrum, while in the light curve case the output column label must be specified.
The table containing the source+background data and the background data must be given as a first parameter. If the background data are contained in a different table, also the background table name must be specified, separated by a comma (see Table 4.6).
When all the data are contained in the same table, the source+background data are read from the first data column in the table, while the background data are read from the second one. When the data are contained in different tables, they are read from the first data column of each of the tables. When the data were corrected within Projection run in correction mode, the corresponding corrected spectral columns with the statistical errors are taken as input instead. The labels of the data columns to be considered must be explicitly specified in order to take over this default mechanism. When the data were corrected within Projection run in correction mode, the user can specify either the corrected or the raw spectra columns. In any case, always the corrected spectra will be automatically read in.
If no background subtraction is requested for the data to be prepared, the keyword NONE must replace the second input column name.
In the spectral background subtraction the (optional) fourth parameter (indicated in Table 4.6 as rebin) defines the way an automatical spectral rebinning should be performed. The regular rebinning is specified via the keyword rebin=<value> where <value> is the rebin factor (an integer number). A constant signal-to-noise ratio rebinning is introduced via the keyword signal=<value>, where <value> is the lower limit to the signal to noise ratio in the automatic rebinning of the result spectrum (see the algorithm described above). When the keyword is omitted, it is assumed to be signal.
It is always possible to save a special bin structure by appending an output filename to the parameter signal (for instance, the construct signal=5,cinque would rebin the spectrum at constant signal-to-noise 5, and then would save the new bin definitions into file cinque). In order to read and apply a special rebin structure from a previously created file, the filename should be specified at the position of the rebinning parameter (for instance to read from the file cinque one can type the word cinque or rebin=cinque at the appropriate position in the PREPARE/SPECTRA command line).
The filenames s7 and s34 are reserved and are used to reproduce the standard (SASS) spectral rebinning.
One more parameter is introduced by the keyword select=<value1,value2> where value1 and value2 define the channel interval to be considered in the spectral rebinning.
When the data were not corrected within Projection run in correction mode, the last parameters are used to optionally indicate the correction vectors corresponding to the data (in the spectral case they are two table names, in the light curve case they are two column labels). In this way the background subtraction can be performed keeping into account the different conditions under which the data were obtained (in general this condition are very similar, and therefore this option can be often ignored).
If instead the data are already corrected within Projection run in correction mode, the last two parameters can be used to indicate the error columns to associate to the corrected spectra (if the table was not manipulated by the user by renaming or deleting or creating new columns, such columns are found automatically).
Two examples of background subtraction command lines are given in the following:
Midas 003> PREPARE/SPECTR source,back spec ? 5 source_c,back_c
The source+background spectrum is contained in table source.tbl at its first column, while the background spectrum is in table back.tbl, always at the first column. If the question mark (?) is replaced by the string #1,none, no background subtraction will be performed. The result of the spectral preparation is written to spec.tbl after automatic rebinning to is performed. If the data were not corrected within Projection, the (optional) last two parameters are interpreted as correction vectors placed in the tables source_c.tbl and back_c.tbl. Otherwise they are interpreted as the labels of the columns where the corresponding statistical errors are placed. In the latter case they do not need to be specified, unless the table was manipulated by deleting or shifting table columns.
Midas 004> PREPARE/LIGHT rates SOURCE SOUBAC,BACK C_SOURCE,C_BACK
The source+background and background light curves are in table rates.tbl at the columns SOUBAC and BACK. The corresponding correction vectors are in the columns C_SOURCE and C_BACK. The output is written to the column SOURCE of the input table.