Modeling the Echelle Spectra Continuum with Alpha Shapes and Local Regression Fitting
Xin Xu, Jessi Cisewski-Kehe, Allen B. Davis, Debra A. Fischer, John M., Brewer

TL;DR
This paper introduces two novel, data-driven algorithms for continuum normalization of echelle spectra, improving accuracy over polynomial fitting and addressing detector artifacts in high-precision spectrometry.
Contribution
The paper presents two new algorithms, AFS and ALSFS, for spectrum continuum normalization that outperform polynomial methods and incorporate lab reference data.
Findings
Improved continuum normalization accuracy over polynomial fitting.
Effective mitigation of CCD detector artifacts.
Validated on simulated spectra and real spectrometer data.
Abstract
Continuum normalization of echelle spectra is an important data analysis step that is difficult to automate. Polynomial fitting requires a reasonably high order model to follow the steep slope of the blaze function. However, in the presence of deep spectral lines, a high order polynomial fit can result in ripples in the normalized continuum that increase errors in spectral analysis. Here, we present two algorithms for flattening the spectrum continuum. The Alpha-shape Fitting to Spectrum algorithm (AFS) is completely data-driven, using an alpha shape to obtain an initial estimate of the blaze function. The Alpha-shape and Lab Source Fitting to Spectrum algorithm (ALSFS) incorporates a continuum constraint from a lab source reference spectrum for the blaze function estimation. These algorithms are tested on a simulated spectrum, where we demonstrate improved normalization compared to…
| Order B | Order R | |||||
|---|---|---|---|---|---|---|
| S/N | AFS | ALSFS | Iterative | AFS | ALSFS | Iterative |
| 300 | 7.58 | 4.31 | 12.44 | 4.06 | 2.70 | 8.10 |
| 150 | 7.71 | 5.67 | 15.79 | 4.80 | 5.31 | 8.25 |
| 50 | 8.94 | 9.93 | 22.78 | 8.07 | 13.82 | 11.49 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Modeling the Echelle Spectra Continuum with Alpha Shapes and Local Regression Fitting
Department of Statistics and Data Science, Yale University
24 Hillhouse Ave, New Haven, CT 06511, USA
Department of Statistics and Data Science, Yale University
24 Hillhouse Ave, New Haven, CT 06511, USA
Department of Astronomy, Yale University
52 Hillhouse Ave, New Haven, CT 06511, USA
Department of Astronomy, Yale University
52 Hillhouse Ave, New Haven, CT 06511, USA
Department of Astronomy, Yale University
52 Hillhouse Ave, New Haven, CT 06511, USA
(Received March 3, 2019; Revised April 11, 2019; Accepted April 20, 2019)
Abstract
Continuum normalization of echelle spectra is an important data analysis step that is difficult to automate. Polynomial fitting requires a reasonably high order model to follow the steep slope of the blaze function. However, in the presence of deep spectral lines, a high order polynomial fit can result in ripples in the normalized continuum that increase errors in spectral analysis. Here, we present two algorithms for flattening the spectrum continuum. The Alpha-shape Fitting to Spectrum algorithm (AFS) is completely data-driven, using an alpha shape to obtain an initial estimate of the blaze function. The Alpha-shape and Lab Source Fitting to Spectrum algorithm (ALSFS) incorporates a continuum constraint from a lab source reference spectrum for the blaze function estimation. These algorithms are tested on a simulated spectrum, where we demonstrate improved normalization compared to polynomial regression for continuum fitting. We show an additional application, using the algorithms for mitigation of spatially correlated quantum efficiency variations and fringing in the CCD detector of the EXtreme PREcision Spectrometer (EXPRES).
instrumentation: spectrographs; techniques: spectroscopic, radial velocities; methods: statistical, data analysis
††journal: AJ
1 Introduction
Spectroscopy is a powerful observational technique for understanding fundamental astrophysics. A high dispersion stellar spectrum contains detailed information about individual atomic transitions that enables the derivation of parameters such as effective temperature, surface gravity, elemental abundances, and the measurement of Doppler shifts in stellar spectra reveals the presence of stellar and planetary companions (Fischer et al., 2016, and references within). Most spectroscopic analysis techniques require a flat, continuum normalized spectrum (Blanco-Cuaresma et al., 2014). For example, the precision of equivalent width measurements for abundance analysis or cross-correlation for exoplanet detection is very sensitive to even small errors in continuum normalization (Torres et al., 2012, and references within).
An echelle spectrograph disperses light so that high spectral orders can be recorded. The higher orders have greater dispersion and therefore provide higher resolution spectra over a broad range of wavelengths. However, most of the brightness of a spectrum is concentrated in the zeroth and lower spectral orders; higher orders are intrinsically fainter. The optical grating in an echelle spectrograph has angled facets designed to shift the intensity envelope of dispersed light to high spectral orders. When this phase shift is introduced, the grating is said to be blazed and with cross dispersion, several dozen spectral orders can be stacked onto the detector. Each order has an intensity distribution characterized by the blaze function so that the continuum intensity is strongest in the center of the order and drops off steeply toward the edges of the order. The term “blaze function” is often used to describe the shape of the continuum across an echelle order and indeed, the blaze distribution is the dominant effect.
One approach for flattening the spectrum is to divide by the theoretical blaze function (Barker, 1984), which depends on grating parameters (incident angle, the angle of the blazed facets, and the grating facet width and spacing) and can be calculated for each order of the spectrum. However, this method for normalization or flattening of the spectrum will leave residual variations in the continuum because of departures from the theoretical blaze function: manufacturing defects in the grating, chromatic aberrations in the optics of a spectrograph, or quantum efficiency variations in the electronic detector. In addition to the instrumental blaze, additional wavelength-dependent intensity variations will occur because of the black-body temperature of stars or calibration lamps.
Another approach for normalizing the continuum is to divide by an extracted flat-field calibration source (e.g., Skoda et al., 2008), such as a quartz lamp. However, the quartz lamp will also have a black-body curve superimposed on the blaze function. One of the most common methods for normalizing the continuum of a spectrum is to fit a polynomial to high points along the order. This is a completely agnostic approach that does not require prior knowledge about the blaze function and while it works fairly well, polynomial fitting can fail near broad and deep lines, especially if they are close to the edges of the orders. Here, we describe a new approach for continuum fitting and compare our method with polynomial fitting in Section 3.
2 Description of methods
In this work, the goal is to estimate the blaze function of a target spectrum so that it may be removed, leaving a flattened spectrum. Two algorithms are proposed to accommodate different scenarios: (i) the Alpha-shape Fitting to Spectrum algorithm (AFS) (the baseline approach), (ii) the Alpha-shape and Lab Source Fitting to Spectrum algorithm (ALSFS) (when a lab continuum source is available)111The implementation code of AFS and ALSFS, as well as example data can be found and downloaded from: https://github.com/xinxuyale/AFS or https://zenodo.org/badge/latestdoi/173169370..
In the proposed algorithms, we first fit an alpha shape (Edelsbrunner et al., 1983), which is a polygon enclosing a dataset, to capture the general shape of the blaze function of a target spectrum. Then we use this preliminary estimation to select a set of pixels that are ultimately used to fit the final blaze function model. The pixels are selected so that they are generally on or near the continuum and not in the absorption lines. With the selected set of pixels, we use local polynomial regression (Cleveland, 1979) to estimate the blaze function. The two algorithms are introduced next, followed by a discussion on how to select the tuning parameters.
2.1 AFS Algorithm
The proposed AFS algorithm is a versatile algorithm that can be used to remove the blaze function whether or not a corresponding lab source spectrum is available. In this algorithm, an alpha shape is used to obtain a preliminary estimation of the blaze function’s high-level shape. An alpha shape is a generalization of a convex hull, but is not required to be a convex set; it is a region bounded by a set of segments generated from a set of points. To generate an alpha shape, imagine a piece of paper with a plot of spectrum printed on it. Consider a special paper cutter that can only cut out circles with radius , known as -balls. An incomplete circle is allowed, but the cutter cannot cut anything from the spectrum. In Figure1a, the blue circle is an -ball that can be cut out from the paper, but we cannot move the -ball any lower vertically since it would cut the spectrum. Continue to cut as many -balls as possible, and the remaining paper is called an alpha hull. Figure1a shows the resulting alpha hull with . By connecting the points where the alpha hull touches the spectrum with straight segments, it becomes an alpha shape, as displayed in Figure1b. An alpha shape can capture the general shape of a spectrum, and its upper boundary is used as a starting model for the blaze function estimation.
Another technique used in the AFS algorithm is local polynomial regression (Cleveland, 1979), which is a non-parametric method for estimating functions given a set of points. At each point, , a p-degree polynomial model is fitted to a subset of neighboring points of . The p-degree polynomial regression is fitted by weighted least squares, giving more weight to points closer to and less weight to points further away. Consider a dataset , and a p-degree polynomial function in the neighborhood of is , where is in the neighborhood of . Then the estimation of , , is obtained by minimizing
[TABLE]
where is the neighboring set of containing the nearest pixels to , is a smoothing parameter, and \omega_{i}(\lambda_{j})=K\Big{(}\frac{|\lambda_{j}-\lambda_{i}|}{\max\limits_{\begin{subarray}{c}\lambda_{j^{*}}\in N_{m_{0}}(\lambda_{i})\end{subarray}}|\lambda_{j^{*}}-\lambda_{i}|}\Big{)}, with as a common weighting function. The local polynomial estimate at is . An advantage of local polynomial regression over ordinary polynomial regression is its ability to adapt to local characteristics of a dataset rather than fitting all the data points using one single model. This flexibility makes it useful for modeling complex data sets where regular polynomial regression fails.
Let be an observed spectrum, where is the wavelength of pixel , and is the intensity of pixel . Our method is summarized in Algorithm 1 and illustrated in Figure 2 with the details of the AFS algorithm presented next.
In step 1, the intensity vector, , is rescaled by multiplying by a value . This corresponds to the value for the alpha shape. Since the construction of an alpha shape depends on coverage areas of small circles, the relative range of and affects results: if the range of is too large or too small compared to the range of , larger alpha values should be used for the alpha shape. For a common blaze function, works well by scaling the range of and to be , in coordination with a recommended value for later. In step 2, the alpha shape, , is constructed with radius , which is an infinite point set containing all the points within the boundary of the alpha shape (see Figure2a). In , for each , there are infinite such that . The upper boundary of is defined as , which is a finite point set only including the largest such that for each , as displayed in Figure2a. In step 3, we fit a local polynomial regression using all the points in , denoted as , such that is a smoothed version of and is the initial model of the blaze function (see Figure2b). is not an accurate estimate of the blaze function, but rather an approximation of its shape. Next, is divided by to get the first estimate of the flattened spectrum, denoted as , displayed in Figure2c.
In step 4, we denote the intersection of and the spectrum as , shown in Figure2b and2c. Notice that contains points mostly near the continuum. The blue line in Figure2b, which connects the points in , can be thought of as a collection of segments, and points in are vertices of those segments. Each point in is a vertex of a window where splits are defined - the spectrum is cut into small windows by the points in in order to get the local quantiles. The purpose of the next steps is to select a subset of points that do not fall into an absorption feature. This is accomplished by selecting in the upper quantiles of these windows. In particular, in the j-th window, we select the points whose values are larger than the quantile of the in the window, and the selected points make up the set . For , where is the number of points in , the combined set of for different j’s is defined as , displayed in Figure2c. contains points that are locally in the upper quantile, which will be used to estimate the blaze function since these points generally do not fall into an absorption line. In step 5 we run a local polynomial regression on and fit it to the whole spectrum. This regression is our final estimate of the blaze function, denoted as . The red line in Figure2d shows the final estimate of the blaze function. Then, in step 6, is divided by to get the blaze-removed spectrum, denoted as and shown in Figure2e.
2.2 ALSFS Method
The ALSFS algorithm is a method for removing the blaze function when a lab source spectrum, such as an LED or quartz lamp spectrum, is available as a reference. Generally, when a reliable reference spectrum is available, it can be used as the preliminary estimate of the blaze function shape. The use of a reference spectrum can be particularly advantageous in situations when the science spectrum contains wide absorption lines, which often make estimation of blaze function shape especially challenging.
The AFS algorithm in section 2.1 can be adapted to take advantage of this additional information in the reference spectrum. To a first approximation, a lab source continuum spectrum should trace the instrumental blaze function for each order. However, the calibration source will typically have some effective blackbody temperature – that is, its intrinsic intensity will peak at a specific wavelength. Over the limited wavelength range covered by a single spectral order, this effective blackbody function is approximately linear. Therefore, an observation of a lab source spectrum can be modeled as a linear transformation of the instrumental blaze function, and therefore the difference between the blaze function and the corresponding lab source spectrum is only a location-scale transformation. Thus, the blaze estimation problem can be translated into an optimization problem to find the best intercept, scale, and slope of the lab source.
2.2.1 ALSFS Algorithm
The ALSFS algorithm is initialized in the same manner as the AFS algorithm in steps 1 and 2, but it differs slightly in steps 3 and 4 and greatly in step 5. Let the reference lab source spectrum be . The ALSFS algorithm is summarized in Algorithm 2.
Steps 1 and 2 are the same as the AFS algorithm. Since prior knowledge of the shape of blaze function is available, fewer points are needed for the second local polynomial fitting. Step 3 is similar to step 3 of the AFS algorithm, but we make set more accurate by also calculating the quantile of , denoted as . , which means the upper quantile of , displayed in Figure3a. Compared to the upper quantile of within each window, a smaller quantile is used for the global quantile; otherwise, too many points will be excluded if the same quantile is used. Step 4 also departs from the AFS algorithm: for the j-th window, we select the points where both the quantile of the window and into set , shown in Figure3a. In step 5, we use the lab source spectrum’s intensity curve as a reference model, displayed in Figure3b, to find the best linear coefficients for blaze function estimation using the points selected in the previous step. We apply a linear transformation on the lab source spectrum: , where , , and are intercept, scale, and slope parameters, respectively. Since our ultimate goal is to have a flat spectrum without the blaze function, we use an objective function \sum\limits_{\begin{subarray}{c}i\end{subarray}\in S_{\alpha,q}}\Big{(}\frac{l_{i}}{\hat{l}_{i}(a,b,c)}-1\Big{)}^{2}, which measures the total distances from the removed spectrum to the constant 1. We minimize this objective function on the set to get estimates for , , and . Then the modified lab source spectrum is our final estimate for blaze function, displayed in Figure3b. Step 6 is the same as the AFS algorithm, is divided by to get the blaze-removed spectrum.
2.2.2 Lab Source Smoothing by AFS Algorithm
The process of flat-fielding spectra is necessary for removing pixel-to-pixel quantum efficiency (QE) variations in charge coupled devices (CCDs) that are used as detectors in astronomical spectrographs. In the case of fiber-fed echelle spectrographs, flat fielding can be carried out by extracting a featureless calibration spectrum and dividing the extracted science spectrum order-by-order. However, the flat-field source is generally not perfectly uniform in intensity over a large wavelength range, and therefore it will typically have an effective black-body temperature that does not match the stellar effective temperature. As a result, this division leaves behind residual trends. By using the AFS algorithm a model can be fitted to each order of the flat field calibration spectrum. Division of the flat field echelle orders by this fitted model will then produce a normalized spectrum that can be used to divide out the QE variation. Figure 4 shows an example of how this process was used to create a normalized flat in red orders that exhibit fringing from interference of red wavelengths in thinned silicon detectors. This fringing can be removed by dividing stellar spectra with this normalized flat.
In some orders a cosmic ray or a pixel with very low QE will create an upward or downward spike that is confined to one or a few pixels. In this case, the AFS algorithm is slightly modified to iteratively reject these pixels using outlier rejection. Let the original lab source spectrum be , and , . Let be the quantile of , where could be a number between and . In the beginning, the quantile of is denoted as . In the -th iteration, remove pixels where and calculate the quantile of the new , denoted as . Continue the iteration until . The remaining pixels are used for smoothing by the AFS algorithm, displayed in Figure 5.
2.3 Parameter Selection
In the proposed algorithms, there are several parameters that need to be selected by users. In the AFS algorithm, there are three parameters: for the alpha shape, quantile for the point selection, and in two local polynomial regressions. The determines how many windows a spectrum is cut into, because the number of windows is determined by smoothness of the alpha shape, which is controlled by . Using these windows, determines how many points are selected in each window. After selecting the points, determines the smoothness of local polynomial fitting on these selected points. Practically, the three parameters are robust within appropriate ranges. For the example spectrum in Figure6a, we recommend a set of standard parameters wavelength range, as a default. In Figures 6-8, we show the blaze estimates using extreme parameter choices (top panels) and its resulting normalized spectra compared with the standard parameter choice (bottom panels).
First, the can be selected based on the shape of a blaze function. For example, in Figure2a, we find that the blaze function increases first and then decreases. Also, it is convex first, then becomes concave, and turns to be convex in the end. We want to select an that can capture the convex parts (not too large), but will not go too deep into absorption lines (not too small). The choice of is mainly determined by the shape, e.g., curvature and concavity, of a blaze function. However, when there is a wide absorption line, a larger may be needed than the shape would suggest. For echelle spectra orders, since each convex portion generally takes up about of an order, we recommend selecting an that is of the wavelength range of the order, but have found empirically that is rather robust from of the wavelength range to of the wavelength range. Figure6a shows an example of a very large equal to the order’s entire wavelength range. This value is too large for the -balls to capture the shape of the spectrum near the boundaries; in the blaze-removed spectrum, the left part drops downward like a wide absorption feature because points in that portion of the spectrum were not selected in . Figure6b shows an example of a small of of the wavelength range. With such a small , the -balls fit into absorption lines so that points inside an absorption are selected into set . In the removed spectrum, there are regions that are above the reference line , compared with the cyan spectrum where wavelength range.
The parameter depends on the S/N of a spectrum and the amount of absorption. The goal when selecting is to find points on the spectrum that do not drop into absorption lines, but instead are on the continuum. After flattening the spectrum using a preliminary estimate of its shape, we select points in the local upper quantile for the set to be used in the final estimation. If we happened to know the true blaze, then after dividing the spectrum by the blaze we would expect to see points randomly scattered around . In the proposed algorithms, these points are approximated by set . If the S/N is high or there is a large amount of absorption, a larger is needed to select points in so that these points do not fall in absorption lines. Conversely, if S/N is low or there is minimal absorption, a smaller is needed to get enough points into set 222Alternatively, an adaptive can be used for each small window to capture the noise more accurately. An adaptive can incorporate the overall S/N and the average intensity in each window to characterize the noise variance better.. For an order with a similar amount of absorption as the one displayed in Figure6a, a from to works for S/N 300, a from to works for S/N 150, and a from to works for S/N lower than 150. Figure7a shows the effects of a small such as : too many points are selected into so that the blaze function estimate is dragged downward by the points in absorption lines, and in the removed spectrum, the left and right boundary regions are above the reference line . In contrast, Figure7b shows a large of . In this example contains too few points, which makes the estimate sit almost completely above the spectrum. In the removed spectrum, almost all the pixels are under the reference line.
The smoothing parameter depends on the distribution of points in along the spectrum, which is determined by the amount of absorption. If there are many absorption lines or any absorption lines that are wide, the set has large gaps between pixels and thus a large is needed to get a good estimate. If there are few absorption lines or absorption lines that are narrow, a small is needed so that the estimation better adapts to local regions. For an order with a similar amount of absorption as the one displayed in Figure6a, an value from to has worked well empirically. In Figure8a, is set to be (too large) and the estimate is off on the left part of the spectrum, where the blaze-removed spectrum rises to above . Figure8b shows the results of a too small value of : the blaze estimate has some small bumps, but the blaze-removed spectrum looks reasonable to the eye. However, since the true blaze function does not have small bumps, this blaze estimate is not as good a fit as it might appear at first glance.
In general, the blaze function estimate is more sensitive to small changes in than to and . For an echelle spectrum order with a similar amount of absorption as the one displayed in Figure6a, we can start with an equal to of the wavelength range of the order, an equal to , and tune the parameter within the range according to its S/N and amount of absorption. A more detailed set of recommendations for parameters in different situations is provided in the Appendix.
The ALSFS algorithm has the same parameters: , and . Because the final estimate is the reference lab source spectrum with linear modification, has less influence on the results than for the AFS algorithm. In the lab source spectrum smoothing process, , , and operate the same as in the AFS algorithm. The quantile parameter in depends on the particular appearances of spikes. If spikes are long, use a smaller such as ; if spikes are very small, use a larger such as or .
2.4 Complications and Corrections
We have found that the proposed algorithms work well in most cases. However, there are several special cases that can result in poorer estimates of the blaze function, for which we have developed corrections to mitigate these issues. Since the AFS algorithm relies only on the science spectrum itself, it is more susceptible to complications than the ALSFS algorithm.
2.4.1 Boundary Correction
An order is normalized by dividing by its estimated blaze function. Since the blaze function approaches zero near the edges of the order, small errors in the blaze shape will be magnified in the divided spectrum. The ALSFS algorithm is less susceptible to this problem because of the strong constraints provided by the lab source, but other blaze estimation methods, including the AFS algorithm, can be strongly affected.
The AFS algorithm also has difficulty in this region in cases where the edge of an order splits an absorption line. Fortunately, neighboring orders often have some region of overlap that can be used to correct the boundaries. A weighted average of the blaze-removed spectrum of the two orders can be used as an estimate of the blaze function in the overlapping region. For example, Figure 9 shows two neighboring orders that share an overlapping region. Figure9a shows the right boundary of the left order, which looks good as a blaze-removed spectrum using AFS algorithm. Figure9b shows the left boundary of the right order, which spuriously rises above . We correct the overlapping region using the following:
[TABLE]
where and are the intensities for overlapping regions from the left and right orders, respectively, is the array of intensities for the corrected overlapping region, is the number of pixels in the overlapping region, and , for . The result of the correction is shown in Figure9c. The boundary-corrected spectrum is much better than the original estimate, and we can achieve further improvement by changing the definition of . For example, if it is known that one of the two orders has a better estimate on its boundary, we can assign more weight toward the better order. This might be the case for a pair of orders with a broad spectral feature that is cut-off on only one of the orders.
2.4.2 Wide Absorption Lines
Sometimes an order has wide absorption lines that influence the performance of the blaze function estimation. Wide absorption lines can significantly influence the AFS algorithm performance, but only slightly influence the ALSFS algorithm. Figure10b shows the order containing the two deep Na D lines, which are each so broad that the spectrum does not fully return to the nominal continuum level between them. When attempting to fit the blaze function, the alpha shape will dip into wide features like these and pull the final blaze function estimate downward. In Figure10a, the spectrum (same as in Figure10b) before the blaze function removal is displayed. Despite failing to return to the proper continuum level, this attempt at normalization looks reasonable to the eye. Without prior information, the proposed data-driven AFS algorithm cannot consistently determine the continuum level over regions of greatly extended absorption like this one. If we know there is a wide absorption feature before applying the algorithm, the regions can be masked in step 4 of the AFS algorithm, excluding those points from the estimate.
2.4.3 Continuous Opacity
If an absorption region is wider than half of the wavelength range of the target order, we refer to it as continuous opacity. This problem impacts both the AFS algorithm and the ALSFS algorithm. Since the region is so wide, masking is not an option for the AFS algorithm. The only way to deal with it is to use prior information about continuous opacity: location and intensity. Then the spectrum can be adjusted by accounting for the opacity to get a good estimation. The ALSFS algorithm can address this by connecting and adjusting neighboring orders. Since there are overlaps between neighboring orders, one can search neighboring orders until finding an order that does not contain continuous opacity as a reference. Then the orders with continuous opacity can be adjusted to the level of the reference order. An example is shown in section 3.4 to illustrate the continuous opacity correction.
3 Simulations
In our simulation study, we use an integrated-disk solar flux atlas spectrum (Wallace et al., 2011) produced by the National Solar Observatory (NSO), obtained with the McMath-Pierce Solar Telescope’s Fourier transform spectrometer. Since the spectra in the atlas were obtained with a Fourier transform spectrometer rather than an echelle spectrograph, they have no intrinsic blaze function. The atlas has been approximately continuum normalized. The spectral resolution of the atlas ranges from 350000 to 700000, and the spectra are essentially noiseless.
To mimic the data characteristic of EXPRES, we use the same wavelength ranges as EXPRES to divide the NSO spectrum into artificial orders. We impose a shape based on a blaze function estimated from a B-star spectrum onto each order and use our algorithms to remove the blaze function. Then simulated photon noise (Gaussian white noise, which well approximates Poisson noise for high S/N) is added corresponding to a S/N of 300. The noisy blaze-imposed spectrum is divided by the true blaze function of produce a benchmark flattened spectrum. In this simulation study, we use two orders: one from the bluer end of the spectrum and one from the redder end. The AFS algorithm and the ALSFS algorithm are tested on the two orders, respectively. Additionally, we compare our algorithms with the commonly used iterative method. The iterative method is introduced next.
3.1 Iterative Method
The iterative method is commonly used to remove blaze function from a spectrum. A polynomial model is fit to a spectrum order and the fit is considered as the starting estimation for the blaze function. Next, the method iterates. In each iteration, there is a threshold curve obtained by:
[TABLE]
where is the 7th-order polynomial regression estimate at and is the iteration time. As t increases, the threshold curve increases. The method builds a subset containing wavelength ’s with intensity larger than . Then in the next iteration, it only uses spectrum points whose wavelength values are in to fit a polynomial model and the fit is a new estimation for continuum. To stop the iteration, a stopping time, denoted as , can be set at a particular iteration. Another option is to set a standard deviation value , such that the algorithm stops when the standard deviation of the blaze-removed spectrum is smaller than . The cannot be too small (much smaller than the standard deviation of the true spectrum without the blaze function), otherwise the iteration will not stop. In this work, we stop the iteration if either it arrives at the -th iteration or the standard deviation of the blaze-removed spectrum is smaller than . Empirically, an value around works well, but the performance of the iterative method is influenced by the choice of . A higher S/N requires a larger and, in general, we have found a value equal to S/N seems to well.
3.2 Simulated Spectra
The first order (blue) has wavelengths ranging from 4478 to 4528 Å, called “order B”, and the second order (red) has wavelengths ranging from 6154 to 6221 Å, called “order R”. For this simulation, we require a realistic blaze function to add to the NSO spectrum. To do this, we estimate a blaze function of a B-star, HR 5501, observed with EXPRES (Jurgenson et al., 2016). We first use ALSFS algorithm, with the corresponding LED spectrum (after using AFS algorithm on it) as the lab source, on the B-star spectrum to get the estimate of the blaze function. Then we apply this estimate as the blaze function to the two orders. The raw spectrum of the B-star spectrum is then used as the lab source reference for the ALSFS algorithm. The AFS algorithm, ALSFS algorithm, and iterative method are applied to estimate blaze functions of the two orders and residuals are calculated. The residuals of order B and R with S/N are displayed in Figure11a and 11b, respectively. Overall, ALSFS has the smallest residuals that are consistent across the whole order. AFS has larger residuals than ASLFS, which increase in the boundary regions, but the iterative method has larger residuals than AFS in both boundary regions and middle regions.
3.3 Results
Figure 11 displays a single realization of the noisy spectrum. We repeat the procedure by adding different realizations of noise 1000 times. For each of the 1000 realizations, the AFS algorithm, ALSFS algorithm, and the iterative method are applied to the two orders. This is carried out for an S/N 300, 150, and 50. The results are displayed in Figure 12 and Table 1. The root mean squared error (RMSE) is calculated as , where is the residual at pixel . The ALSFS algorithm has the smallest median RMSE for three scenarios: S/N 300-order B, S/N 300-order R and S/N 150-order B. For the other three scenarios, the AFS algorithm has the smallest median RMSE. Except for S/N 50-order R, the iterative method has the largest median RMSE.
3.4 Correction for Continuous Opacity
An example of continuous opacity is illustrated using the same simulation setup: we apply a blaze function obtained from a B-star spectrum to the NSO spectrum, and then we attempt to recover the underlying spectrum. Here we examine five consecutive artificial orders. A region of continuous opacity spans about 80 Å, which is captured in parts of the third, fourth and fifth orders, displayed in Figure13a. After applying the ALSFS algorithm, the resulting blaze-removed spectra are displayed in Figure13b. Although the blaze-removed spectra are flat, the ALSFS algorithm does not capture the continuous opacity correctly on its own. We know that the first two orders are not affected by the continuous opacity, and so they are used as the reference to correct the other orders: each order is linearly adjusted in intercept and slope to be align with its left neighboring order using the points within the overlapping region whose normalized intensities are in the top quantile. Ideally the combined segment should recover the continuous opacity in the normalized intensities after the blaze function removal. However, error in the slope estimation of the first order is amplified: the combined spectrum in Figure13c is not perfectly horizontal and it goes upward from left to right. We fit another linear regression using the points in the combined spectrum whose normalized intensities are in the top quantile to remove the extra slope. The resulting spectrum recovers the continuous opacity well, as displayed in Figure13d.
3.5 Cosmic Rays
The proposed methods can also be used for spectra with cosmic rays. In particular, the modified AFS algorithm for lab source smoothing, described in section 2.2.2, can be used directly to deal with the presence of cosmic rays. To demonstrate this, an order with simulated cosmic rays is displayed in Figure14a, which contains two upward spikes. The blaze function estimate from the AFS algorithm is shown in Figure14a, and the blaze-removed spectrum is displayed in Figure14a in comparison to the true spectrum. The ALSFS algorithm can be modified similarly to deal with cosmic rays.
4 Applications and Discussions
The AFS algorithm can be useful for studying telluric and micro-telluric absorption lines. Telluric lines, originating in the Earth’s atmosphere, create time-varying and humidity-dependent perturbations to the shapes of stellar lines (Leet et al. 2019, in prep). It is a particularly acute problem in the field of high-precision exoplanet radial velocity detection where uncorrected telluric lines contribute a radial-velocity error of 0.2 to 1 meters per second in optical wavelengths (Cunha et al., 2014) and as much as a few meters per second in near infrared wavelengths (Bean et al., 2010).
Telluric lines can be measured using spectroscopic observations of B-stars, which are bright, rapidly rotating young stars whose spectra are devoid of all but the strongest absorption lines because of extreme rotational broadening. A B-star acts as a background against which narrow telluric lines can be observed as a calibration tool for radial velocity measurements of other stars. Fitting and removing the blaze function and continuum of B-stars allows the depth of the telluric lines to be measured, which folds into current and proposed methods to mitigate their effects (e.g., Leet et al. 2019, in prep).
To illustrate the applicability of the proposed algorithms, the AFS and, for comparison, the iterative method are applied to a B-star spectrum, HR 8634, which was observed with EXPRES (Jurgenson et al., 2016) on July 7, 2018. A blue order (order B: 4376 to 4431 Å) and a red order (order R: 6085 to 6160 Å) of this spectrum were selected to show the effect of the blaze function removal. The flattened spectra are displayed in Figure 15, with a reference line at normalized intensity . Though the ground truth is unknown, it appears that the proposed AFS works well on flattening the spectra, while the spectra flattened by the iterative method have a zigzag pattern.
The ALSFS method can be useful for estimating the blaze function of the more complex spectra of late-type stars by incorporating information from a lab source spectrum to obtain an initial guess. Late-type stars are the primary targets of Extreme Precision Radial Velocity (EPRV) planet searches, which aim to suppress radial velocity measurement errors below 1 meter per second. Among the greatest challenges hindering EPRV is the problem of stellar activity: magnetically-driven motions within the stellar atmosphere lead to time-varying features, such as spots and faculae, that create line-profile distortions that skew the measured centroids of the lines leading to imprecise RV measurements (summarized in Fischer et al., 2016, Section 4.2).
Work to address the problem of stellar activity is ongoing, but one encouraging approach used by several teams is to investigate the sensitivity of individual spectral lines to activity, in order to obtain activity-free RVs (Davis et al., 2017; Wise et al., 2018; Dumusque, 2018). These methods all utilize some sort of continuum-fitting method, because the depths of the lines must be known with precision in order to search for correlations with activity over time. By providing flatter, more uniform blaze function estimates, the ALSFS algorithm will permit more precise measurements of the individual line depths and line profile shapes that are correlated with stellar activity.
The ALSFS and iterative method are applied to a blue order (order B: 4473 to 4529 Å) and a red order (order R: 6147 to 6223 Å) of the star 51 Pegasi, observed with EXPRES on July 8, 2018. Amplified figures of the flattened orders are displayed in Figure 16. For order B, the spectrum from ALSFS is mostly flat, while the spectrum from the iterative method has much higher intensities on boundary regions. For order R, both methods works well in flattening, but the iterative method is inaccurate in scale so that the peaks are above the reference line at Normalized Intensity .
We did not test the methods on cooler stars, where the continuum is poorly defined, such as M dwarfs. Since the sun is a relatively metal rich star, as is 51 Peg (metallicity of +0.2; Frasca et al. 2009), our methods are expected to perform at least as well on stars with lower metallicities and higher temperatures.
5 Conclusions
In this work, we presented two data-driven algorithms, AFS and ALSFS, for removing the blaze function from spectra obtained from echelle spectrographs. The key aspects of the algorithms are the use of alpha shapes to provide an initial guess of the blaze function’s shape, and the use of local polynomial regression to refine this guess. The two algorithms are designed for two scenarios: the AFS algorithm operates without a reference spectrum and may be applied directly to stellar spectra containing even a high number of absorption lines, while the ALSFS algorithm also incorporates additional information from a reference continuum spectrum to inform its initial guess. As an application of the AFS algorithm, a continuum lab source reference spectrum - such as an LED or quartz lamp spectrum - could be corrected and smoothed to be used in the ALSFS algorithm.
A simulation study was presented to illustrate the performance of the proposed algorithms compared to the commonly used iterative method for spectral normalization. In general, our algorithms have smaller RMSE than the iterative method. Overall, the ALSFS algorithm has the smallest median RMSE when S/N is high. Moreover, our algorithms are able to capture the edge effects better than the iterative approach. ALSFS is relatively robust to edge effects, and we have also developed a method of boundary correction for the AFS algorithm. Furthermore, detailed discussion regarding the applications of the algorithms was presented with examples of B-star and star 51 Pegasi spectra, which are observed with EXPRES.
This work proposes methodology to correct the continuum of an echelle spectrum by modeling the blaze function of individual orders. A flattened echelle spectrum obtained from the proposed methods works better than its original form in studying physical and astronomical properties of a star, e.g., blaze-removed B-star spectra for understanding telluric lines, more precise absorption line depths for studying stellar activity.
The selection of the parameter is discussed in section 2.3 so in this section we focus on the selection of and . The depends on the amount of absorption of an order, and depends on both the S/N and the amount of absorption. While S/N can be estimated, the amount of absorption is influenced by multiple factors such as wavelength, temperature, surface gravity, and stellar metallicity. Instead of recommending parameter values based on these factors individually, we provide several example orders to give an idea of the rough ranges of parameters to use. The examples below are all echelle spectra, and an wavelength range is used for all of them. The selected and values are listed under each figure. Figure 17 displays two orders of EXPRES spectra for the G8 V star 55 Cancri, which has a temperature of about 5165 K and a metallicity of +0.27 dex (Marcy et al., 2002). Figure 18 displays six simulated orders from the NSO solar spectrum, as described in section 3. The noise is added to each order with S/N set to be , , or . We suggest these examples be used as a guide for parameter selection.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Barker (1984) Barker, P. K. 1984, Astronomical Journal, 89, 899, doi: 10.1086/113587 · doi ↗
- 2Bean et al. (2010) Bean, J. L., Seifahrt, A., Hartman, H., et al. 2010, The Astrophysical Journal, 713, 410
- 3Blanco-Cuaresma et al. (2014) Blanco-Cuaresma, S., Soubiran, C., Jofré, P., & Heiter, U. 2014, Astronomy and Astrophysics, 566, A 98
- 4Cleveland (1979) Cleveland, W. S. 1979, Journal of the American statistical association, 74, 829
- 5Cunha et al. (2014) Cunha, D., Santos, N., Figueira, P., et al. 2014, Astronomy & Astrophysics, 568, A 35
- 6Davis et al. (2017) Davis, A. B., Cisewski, J., Dumusque, X., Fischer, D. A., & Ford, E. B. 2017, The Astrophysical Journal, 846, 59
- 7Dumusque (2018) Dumusque, X. 2018, Astronomy & Astrophysics, 620, A 47
- 8Edelsbrunner et al. (1983) Edelsbrunner, H., Kirkpatrick, D., & Seidel, R. 1983, IEEE Transactions on information theory, 29, 551
