Projecting the surface

Projecting the surface#

Since we have extracted the numerical surface in spherical coordinates, we can also find the points that correspond to the tangent direction and project them into the \ac{FOV} of the instrument. Let’s suppose that for a particular image, the satellite is located at the position \(\vec{r}_{sat}=(x_{sat}, y_{sat}, z_{sat})\) in the \ac{GSE} system. The tangent points of the surface for this location will satisfy the condition:

(7)#\[ \vec{n} \cdot (\vec{r}_{point}-\vec{r}_{sat} )= 0 \]

where \(\vec{r}_{point}\) is the position of each point of the numerical surface and \(\vec{n}\) is the normal vector of the surface for each point, in the GSE system. We can get \(\vec{r}_{point}\) by simply applying the transformation from the spherical system to the cartesian as defined in Coordinate system. To get the normal vectors, we calculate the gradient of the surface with respect to \(\theta\) and \(\phi\) and normalize the corresponding vectors. We can calculate the normals for each point through their cross product:

\[ \vec{n} = \frac{\partial \vec{r}}{\partial \theta} \times \frac{\partial \vec{r}}{\partial \phi} \]

To get the tangent curve, we simply solve Equation (7) numerically, to get the points that satisfy it. In our case, we applied a simple mask with an arbitrary threshold of \(0.05^\circ\) tolerance, as a first approximate and fast solution.

\begin{figure}[bth] \myfloatalign

\subfloat[Calculation of tangent points to satellite.]
{
\label{fig:schematic}
\includegraphics[width=0.45\textwidth]{gfx/projection/tangent_points.png}} 
\quad
\subfloat[Tangent points in GSE.]
{
\label{fig:tangent_points}
\includegraphics[width=0.45\textwidth]{gfx/projection/3D.png}} 
\quad

\caption{Extraction of tangent point to satellite for a numerical surface.}  
\label{fig:tangent}

\end{figure}

The orientation of the satellite is described by three vectors, giving each base vector of the satellite coordinate system, expressed in the \ac{GSE} frame. To move from one system to another, it is sufficient to define the rotation matrix through these vectors and apply a translation according to the position of the satellite, meaning the origin of the satellite’s coordinate system. We construct the rotation matrix:

\[\begin{split} R = \begin{bmatrix} | & | & | \\ \mathbf{e}_x^{sat} & \mathbf{e}_y^{sat} & \mathbf{e}_z^{sat} \\ | & | & | \end{bmatrix} \end{split}\]

The relation between a vector in the GSE frame and the same vector in the satellite frame is:

\[ \vec{r}_{GSE} = R \cdot \vec{r}_{SF} + \vec{t} \]

where \(r_{SF}\) is the vector of a point in the satellite frame and \(\vec{t}\) is the translation vector. Therefore, the transformation of a point in \ac{GSE} to the satellite frame is performed by the following operation:

\[ \vec{v}_{sat} = R^\top \cdot (\vec{v}_{GSE} - \vec{t}) \]

In order to project this in the \ac{SXI} coordinates we need to compute the angle of each point from the z axis (boresight) along the x and y direction of the satellite frame:

\[ azimuth = \arctan{\frac{x}{z}} \]
\[ elevation = \arctan{\frac{y}{z}} \]

And limit this to the \ac{FOV} of the imager, with \(azimuth \in [-7.8,7.7]^\circ\) and \(elevation\in[-13.2,13.2]^\circ\). We can also define a coordinate transformation from the \ac{SXI} degree coordinates to the indexes of the image, by mapping these angles to grid indices \(i_{\text{az}}\) and \(i_{\text{el}}\):

\[ i_{\text{az}} = \text{round} \left( \frac{\theta_{\text{az}} - \text{Az}{\min}}{\text{Az}{\max} - \text{Az}{\min}} \cdot (N{\text{az}} - 1) \right) \]
\[ i_{\text{el}} = \text{round} \left( \frac{\theta_{\text{el}} - \text{El}{\min}}{\text{El}{\max} - \text{El}{\min}} \cdot (N{\text{el}} - 1) \right) \]

where \(N_{\text{az}}\) and \(N_{\text{el}}\) are the number of azimuth and elevation grid points, respectively. To ensure the indices stay within valid bounds we also clip to the minimum of the grid:

\[i_{\text{az}} = \min\left(\max\left(i_{\text{az}}, 0\right), N_{\text{az}} - 1\right)\]
\[i_{\text{el}} = \min\left(\max\left(i_{\text{el}}, 0\right), N_{\text{el}} - 1\right)\]