# Application of Compressive Sensing in the Presence of Noise for Transient Photometric Events
## 2 CS Architecture  
We use CS architecture based on our previous work, as described in [7, 8]. A figurative description is shown in Figure 1.  
A reference image can be viewed as a clean image. The observed image will have a change in pixel flux of the microlensing source star over time, as well as any noise. If the point spread function (PSF) of the observed and reference image are not identical, differencing algorithms can be applied. Differencing algorithms obtain a convolution kernel to match the PSF of the observed and reference image, and then perform subtraction on the convolved reference image and the observed image. However, to eliminate an additional layer of complexity, in order to accurately evaluate the effect of CS on reconstruction, we assume that the PSF of the observed and reference image are the same. Due to this assumption, we perform a subtraction to obtain the differenced measurements, \(y_{diff}\), as shown in Equation (3). For our simulation modeling purposes, we assume optimal differencing results, typically provided with both reference and observed images with the same detector response. The result of differencing can then be used to only detect a change in magnitude corresponding to a microlensing event. We can write the differenced image in that case as  
\[x_{diff}=x_{r}-x_{o} \tag{2}\]  
The differenced image consists of relevant information needed to reconstruct a transient photometric curve. From the architecture in Figure 1, we obtain  
\[y_{diff} =y_{r}-y_{o}\] \[=Ax_{r}-Ax_{o}\] \[=A(x_{r}-x_{o})\] \[=A(x_{diff}) \tag{3}\]  
Differencing the images makes them sparse, with non-zero pixel coefficients for only the star sources experiencing magnification. Adding noise leads to less sparse images, which can hinder performance of CS reconstruction algorithms. Further details on the type of noise used in our work are discussed in Section 3. For 2D images, we apply CS in the following manner:  
Figure 1: CS architecture. The blue block represents CS data acquisition, which can be performed on-board a spaceflight instrument, while the orange blocks represent computations, which can be performed on the ground. 1. Generate a spatial sky image of size \(n\times n\) using uniform random distribution, in the range of 50 and 5000 pixel value. The radius of these star sources are generated using an airy point spread function with an aperture radius between 1 and 5 pixel units, which is randomly chosen. 2. Magnification for the source star experiencing a single-lens microlensing event is determined by the microlensing equations [4]. The center pixel value, \(P[x_{0},x_{1}]\), at any time, \(t\), is given by \[Amp[x_{0},x_{1}]=M(t)\times P[x_{0},x_{1}]\] (4) where \(Amp\) is the amplification value, \(P\) is the pixel value from step 1, and \(M(t)\) is the magnification value at time \(t\). 3. If adding source noise or background noise, generate a noise image of the same size, \(n\times n\). Add this image to the image generated in step 1. 4. Generate a CS-based projection matrix of size \(m\times n\), where \(m=q\%\times n\). In our simulations, we use \(q=25\). 5. Create CS-based measurements by \[y_{o}=Ax_{o}+n_{t}\] (5) where \(x_{o}\) is the observed spatial region, \(y_{o}\) is the CS measurements acquired from applying CS on \(x_{o}\), and \(n_{t}\) is the total measurement noise added. 6. Create CS-based measurements from a reference image, \(x_{r}\), and the same measurement matrix, \(A\): \[y_{r}=Ax_{r}\] (6)
7. Obtain the difference, \(y_{diff}=y_{o}-y_{r}\). 8. Reconstruct \(x_{diff}\) using CS reconstruction algorithms, given \(y_{diff}\) and \(A\). Reconstruction algorithms such as orthogonal matching pursuit (OMP) or optimization algorithms can be used. We use OMP in our work. For OMP alogirthms, we set the sparsity level to be 10% of \(n\). Hence, once 10% of \(n\) non-zero elements are obtained, the algorithm successfully exits. This value was used based on prior knowledge about transient sources in spatial sky images.