Frizzle: Combining spectra or images by forward modeling

David W. Hogg,Andrew R. Casey
2024-03-17
Abstract:When there are many observations of an astronomical source - many images with different dithers, or many spectra taken at different barycentric velocities - it is standard practice to shift and stack the data, to (for example) make a high signal-to-noise average image or mean spectrum. Bound-saturating measurements are made by manipulating a likelihood function, where the data are treated as fixed, and model parameters are modified to fit the data. Traditional shifting and stacking of data can be converted into a model-fitting procedure, such that the data are not modified, and yet the output is the shift-adjusted mean. The key component of this conversion is a spectral model that is completely flexible but also a continuous function of wavelength (or position in the case of imaging) that can represent any signal being measured by the device after any reasonable translation (or rotation or field distortion). The benefits of a modeling approach are myriad: The sacred data never are modified. Noise maps, data gaps, and bad-data masks don't require interpolation. The output can take the form of an image or spectrum evaluated on a pixel grid, as is traditional. In addition to shifts, the model can account for line-spread or point-spread function variations, world-coordinate-system variations, and calibration or normalization variations. The noise in the output becomes uncorrelated across neighboring pixels as the shifts deliver good coverage in some sense. The only cost is a small increase in computational complexity over that of traditional methods. We demonstrate the method with a small data example and we provide open source sample code for re-use.
Instrumentation and Methods for Astrophysics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to combine multiple astronomical observation data (such as spectra or images) through the forward modeling method to obtain high - quality average spectra or images. Traditional methods usually improve the signal - to - noise ratio by aligning and stacking data, but this method may lose some information and is not flexible enough when dealing with problems such as noise and missing data. ### Specific problem description 1. **Combination of multiple observation data**: - When making multiple observations of the same astronomical source (for example, images with different position offsets or spectra at different line - of - sight velocities), the traditional approach is to align and stack these data to generate an average image or an average spectrum with a high signal - to - noise ratio. - Although the traditional method is reliable and fast, in some cases it sacrifices some information, especially when dealing with problems such as noise and missing data, it is not flexible enough. 2. **Model fitting instead of direct data manipulation**: - The author proposes a method based on model fitting instead of directly modifying data (such as alignment and stacking). By constructing a fully flexible and continuous spectral model, an adjusted average spectrum or image can be generated without modifying the original data. - The benefits of this method include: the original data remains unchanged, the noise map, data gaps and bad - pixel masks do not need interpolation, and the output can be in the form of an image or a spectrum on a traditional pixel grid. 3. **Handling complex effects**: - The model can also consider complex effects such as the line - spread function, changes in the world coordinate system, calibration or normalization changes, so as to better handle various uncertainties in actual observations. ### Solutions - **Forward modeling**: By constructing a continuous spectral model that can represent any reasonable signal change (such as wavelength shift, rotation or field distortion), an adjusted average spectrum or image can be generated without modifying the original data. - **Maximum - likelihood estimation**: Use maximum - likelihood estimation to fit the model parameters to ensure that the output result is the optimal statistical estimate. - **Linear basis functions**: Adopt linear basis functions (such as Fourier series) to represent the spectral model, making the calculation process more efficient and accurate. ### Key formulas - **Spectral expectation model**: \[ y_i = f(x_i-\Delta x_i; \theta)+\text{noise} \] where \( f(x; \theta)=\sum_{j = 1}^{P}a_jg_j(x) \), \( g_j(x) \) is a basis function, and \( \theta \) is a model parameter. - **Best - fitting parameters**: \[ \hat{\theta}=(X^{\top}C^{-1}X)^{-1}X^{\top}C^{-1}Y \] where \( X \) is a design matrix, \( C^{-1} \) is the inverse of the noise covariance matrix, and \( Y \) is the combination of all observation data. - **Output spectrum**: \[ y^{\star}=X^{\star}\hat{\theta} \] where \( X^{\star} \) is the basis function matrix evaluated on the output pixel grid. Through this method, the author aims to provide a more flexible and more accurate data combination method, which is especially suitable for astronomical research requiring high - precision measurement.