# Robust and Reconfigurable On-Board Processing for a Hyperspectral Imaging Small Satellite
## 3 On-Board Processing Unit Design
### Software Design
#### 3.3.3 Hyperspectral Data Capture  
In the idle state, the OPU is powered off. A few minutes before a pass over a capture target, the OPU is powered on via a PC script, satellite pointing is configured via a FC script, and capture is initiated via command to the HSI service thread. The HSI service thread uses the uEye driver C API from iDS imaging for camera control [68]. See Table 3 for a list of some capture-influencing parameters that can be configured as part of a data capture command. The Sizing parameters influence the resulting hyperspectral cube dimensions, which are \(L\times S\times\lceil W/(f_{b}f_{s})\rceil\). The line count and frame rate parameters determine the total capture duration, which is \(L/f_{r}\). Exposure time is usually set within a range of 10-40 ms, but can be set to any value from 0.02 ms up to what the configured frame rate allows. The gain is usually kept at the lowest setting for the best possible Signal-to-Noise Ratio (SNR). The sizing, timing and signal level parameters influence spatial resolution, spectral resolution and SNR as discussed in [69; 32].  
The camera is configured to output digital flash signals for every frame. These flash signals are captured and timestamped by the time-stamping module on the FPGA. The  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Name** & **Long Name** & **Description** \\ \hline CSP & Cubesat Space Protocol & Services included in the CSP library mainly used for \\  & & pings \\ \hline FT & File Transfer & Handles file down- and up-load requests \\ \hline CLI & Command Line Interface & Provides OS shell access \\ \hline RGB & Red–Green–Blue Camera & Handles commands to control the RGB camera \\ \hline OBIP & On-Board Image Processing & Runs on-board processing pipeline tasks \\ \hline HSI & Hyperspectral Imager & Handles commands to control the HSI camera \\ \hline TM & Telemetry & Collects and logs telemetry information \\ \hline LOG & Logging & Handles information and error message logging. \\  & & Creates log files. \\ \hline Monitor & Service Monitor & Responsible for start and stop of the above tasks \\ \hline \hline \end{tabular}
\end{table}
Table 2: List of service threads started as part of the application software.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Parameter** & **Description** \\ \hline Sizing & Line count, \(L\) & How many lines to scan. In other words, how many frames to capture. \\  & Sensor height, \(S\) & Spatial sampling. Default are 684 pixels. \\  & Sensor width, \(W\) & Spectral sampling. Default are 1080 pixels. \\  & Binning factor, \(f_{b}\) & Software binning in the spectral dimension. \\  & & Possible values: \(1\times\) though \(18\times\) \\  & Sub-sampling, \(f_{s}\) & On-sensor subsampling in the spectral \\  & & dimension. Possible values: \(2\times\), \(4\times\) \\ \hline Timing and signal level & Frame rate \(f_{r}\) & Rate at which a line/frame is \\  & & scanned/captured. \\  & Exposure time, \(e\) & How long light is collected during a line/frame scan/capture. \\  & Gain, \(g\) & \\ \hline Flags & CCSDS123 in software & Compress HSI data using the software \\  & & implementation of CCSDS123 instead of \\  & & the FPGA implementation \\  & No compression & Do not compress the HSI data and store \\  & & the uncompressed data on SD Card instead. \\ \hline \hline \end{tabular}
\end{table}
Table 3: List of parameters configurable via capture command. Some parameters, e.g., for debugging are omitted.  
image data from the camera are fetched by the driver and stored in a frame buffer queue in DRAM. The frame buffer queue is dynamically allocated with the size of each frame buffer is computed as \(2\times S\times W\) Bytes, with the factor 2 corresponding to the sample size of 2 Bytes per sample.