Astron. Astrophys. 342, 763-772 (1999)

## 2. Derivation of veiling

In this section, we consider a spectral range small enough for the excess and the extinction to be constant. The reference spectrum S is normalized to its local continuum and the object spectrum O is corrected from any residual continuum slope. In the following for simplicity we do not make the distinction between a parameter and its estimated value and the reference spectrum is assumed to match exactly the underlying object stellar spectrum, unless clearly stated.

### 2.1. The formalism

In the absence of noise, by definition O and S are related by:

where is the wavelength, a scaling factor, r the veiling, and a weight which is equal to 0 at unusable wavelength ranges (like emission lines or partially filled lines), and to 1 elsewhere. In the following, we assume that the spectra are sampled at the Shannon frequency at values for , and the entire acquired spectrum is usable, . Now we want to estimate the parameters, and . Assuming that the measurement errors are gaussian, the maximum likelihood estimate of the parameters is simply obtained via a least square fit, non linear in this case. To perform the fit, we first define the vector , whose components are:

where the index i stands for , , and and represent the variances of and , respectively. For statistically independent measurements, the correct values of the p's are obtained by minimizing the square modulus of the vector with an iterative procedure, solving at each step the system of equations (see Knoechel & Heide 1978):

where is a vector whose components are and , i.e. the increment to vector whose components are and ; is the transpose matrix of the derivatives of with respect to the s, the upper bar over standing for the expected value. The element of matrix is written as:

For the calculations, can conveniently be approximated by . At each step, the matrix and the vector are then recomputed. The procedure is very robust and it generally converges after a few iterations, if the initial values of the s are close to the correct ones. At the end of the iterative process, the variance of the s are the diagonal elements of the matrix . The reduced chi-square value is simply given by and should be close to 1 for a statistically correct fit.

### 2.2. Error analysis

The detailed error calculation is given in Appendix A. Generally, the reference star is much brighter than the object source, and its contribution to the noise can be neglected. Indeed, it is important to have a set of good quality reference stars which can be used in any veiling study. Under this assumption, for both photon and constant additive limited noises, within a very good approximation, the standard deviation (error hereafter) of the veiling is given by:

and the relative error on the scaling factor can be written as:

where is the signal to noise ratio on the object total spectrum flux and is the variance of the normalized reference spectrum expected value . measures the square of the spectrum contrast and is defined by:

Clearly, for veiling values greater than 1, the veiling error increases as the square of the veiling which illustrates the difficulty to estimate large veiling values. These results are discussed in Sect. 2.4. The relative veiling error can also be written as:

This formula can be useful to estimate rapidly the veiling error from the data and allows us to introduce the contrast spectrum in noise units (resp. ), which is a central quantity in bias studies.

### 2.3. Bias problems

There are two main sources of bias in veiling calculation. The first is due to a bad estimate of the noise ratio between the object and the reference. The second is due to mismatches between the object and the reference spectra.

#### 2.3.1. Uncorrect noise estimate

Let us first study the noise problem. We assume for simplicity constant additive noises for the object and for the reference. Eq. (2) can then be rewritten as:

where . Clearly, Eq. (9) shows that the estimated veiling depends on the input noise ratio between the reference and the object. If this noise ratio is not correctly estimated, the veiling will be biased. We derive an analytical expression of this bias in Appendix B1. We find that it is a function of the veiling r, and (the contrast of the object and the reference spectra in noise units) and of the quantity , where is the input noise ratio between the reference and the object. The expected value of the estimated veiling lies between two extreme values, and , which define the range of permitted veiling values compatible with the data, and correspond to () and (f infinite) in Eq. (2), respectively. Defining the extreme relative veiling biasses and , it follows that (see Appendix B1):

and

where the brackets stand for the mean value. This bias has a very simple explanation. Underestimating the noise ratio is equivalent to underestimate the reference noise , or equivalently, to overestimate the object noise . Let us concentrate for example on the reference. If is underestimated, the algorithm will interpret part of the reference noise in terms of high frequency signal, it will "see" the reference absorption lines apparently deeper than they really are and will tend to overerestimate the object veiling. On the contrary, if is overestimated, the algorithm will interpret part of the true signal in terms of noise, it will "see" the reference aborption lines less deep than they really are and will then tend to underestimate the object veiling. It is not always easy to estimate the true noise ratio between the reference and the object. But if one of the two sources has a very good signal to noise ratio, usually the reference, then is large and , as shown in Eq. (10). It is then convenient to set in Eq. (2): the derived veiling is biased, but the bias is negligible. On the other hand, if is large, [see Eq. (11)]: in this case it is better to set in Eq. (2). If both and are small, the bias can be very important even if the input noise ratio is not correct by only a factor of 2 (as shown in Figs. B1a and B1b). In case of doubt, one can minimize the bias by underestimating or overestimating the noise ratio , depending if is larger or smaller than , respectively.

To conclude this section, we generally recommend to filter the spectra before veiling calculation, but the choice of the working spectral resolution must be examined case by case. The spectra between 5180 Å and 5220 Å presented in Fig. 1 of Hartmann & Kenyon (1990) are typical examples. Indeed, we can see the presence of high frequency noise superposed on lower frequency structures. Filtering these data by a factor of a few will considerably reduce the noise without affecting significantly the spectrum contrast, which in turn will greatly decrease the possible bias due to a bad noise estimate at a negligible cost in terms of the veiling error.

#### 2.3.2. Mismatches between the object and the reference spectra

The other source of bias, regards mismatches between the object and the reference spectra, and it is treated in details in Appendix B2. By mismatches, we mean spectral differences between the reference spectrum and the true underlying object stellar spectrum T and/or systematic errors of any kind. We show that if the contrast of the object and the reference spectra are large compared to the residual of the veiling equation, then the bias is dominated by the apparent veiling of S with respect to T. Defining the bias by , where is the calculated veiling, the relative bias is written:

In the case of non noisy data, the validity of Eq. (12) can be checked by computing the extreme veiling values and obtained from and infinite, respectively. If these two values coincide, then Eq. (12) is correct. Otherwise, we must add to Eq. (12) another bias which depends on the input value. The distance between and is a good indicator to evaluate the importance of mismatches between S and T, which cannot be interpreted in terms of veiling. It also probably gives a good order of magnitude of the resulting bias.

### 2.4. The effect of the spectral resolution

In this section, we study the effect of the spectral resolution on the veiling value and the associated noise. For this purpose, we use a high quality spectrum of the K7V star HD 201092, obtained at the 1.93m telescope of the Observatoire de Haute Provence (France) with the instrument ELODIE, at (see Baranne et al. 1995) and for which and . Fig. 1 shows this spectrum between 4000 Å and 6800 Å, normalized to its local continuum at and then filtered at .

 Fig. 1. Spectrum of the K7V star HD 201092, first normalized to its local continuum at and filtered at .

Defining as we did so far, the veiling as the ratio between the excess and the local stellar continuum, does not provide an absolute quantity, because the level of the local continuum is resolution dependent. To study the effect of the spectral resolution on the veiling value, we have selected a spectral band of 40 Å centered at 5200 Å from our K7V star, normalized to its local continuum to simulate the reference, and added a veiling of 1 to the reference to simulate the object. We then degrade the spectral resolution of both the object and the reference by gaussian filtering, and estimate the veiling, renormalizing first the reference spectrum to its new local continuum. The veiling is found to vary by about 10% when the spectral resolution varies from 40000 to 500. However, the product of the veiling with the spectrophotometrically calibrated local continuum of the reference spectrum, which measures the excess, will obviously remain unchanged. Defining the veiling as the ratio between the excess and the mean reference flux (see HHKHS) would result in a quantity little dependent on the spectral resolution.

The veiling error, Eq. (5), is inversely proportional the product which is sensitive to the spectral resolution R. Fig. 2 shows between 4000 Å and 6600 Å, computed from our K7V spectrum for various spectral resolutions, every 50 Å in a wavelength interval of 100 Å. It has two maxima, the first around 4300 Å and the second, slightly higher around 5200 Å. This explains why veiling studies are often performed around 5200 Å. Indeed, this wavelength combines a high spectrum contrast with a good experimental response. However, the region around 4300 Å can also be interesting if the signal to noise ratio is high enough. At most wavelengths varies only by a factor of 2 to 4 from to . For a given integration time and wavelength interval, the signal to noise ratio on the object total spectrum flux is obviously independent on R for photon and background limited noises. However, for CCD readout limited noise, it is inversely proportional to the square root of the number of pixels, i.e. the square root of R. Hence, if we take only into account the statistical noise, we conclude that within a factor of a few, the veiling error is independent on the spectral resolution and can even increase with the latter for readout limited noise. However in practice, it will be difficult to estimate the veiling in a 100 Å interval at spectral resolutions as low as a few hundreds. A first reason is that, excluding the unusable features, the useful spectrum could be reduced to only a few points, leading to a high veiling error. More important, at such low spectral resolutions the spectrum contrast is generally small (of the order of a few%) and can become comparable to systematic local errors (probably of the order of one to a few %) leading to important biasses. For moderatly veiled T Tauri stars, these difficulties can be overcome by working on large structures of high contrast like the one extending from 4900 Å to 5250 Å in Fig. 1 (). Although on such a large spectral bandwidth, the formalism of Sect. 2.1 cannot be applied, the problem can be solved by simple polynomial model fitting (Chelli et al. 1997; Chelli, in preparation).

 Fig. 2. Variance, for various spectral resolutions, of a K7V reference spectrum normalized to its continuum and computed every 50 Å over a 100 Å bandwidth. The strong Na doublet in absorption around 5893 Å, often partially filled in CTTs, has been excluded from the calculation.

© European Southern Observatory (ESO) 1999

Online publication: February 23, 1999