# Spacecraft and Asteroid Thermal Image Generation for Proximity Navigation and Detection Scenarios
## 2 Thermal Modeling
### Method Implementation  
The method is implemented thanks to the flexibility of the opensource code OpenFOAM, as well as the one of Blender. Indeed, the temperature field is exported in a VTK format ([[https://vtk.org/](https://vtk.org/)]([https://vtk.org/](https://vtk.org/)), accessed on 21 March 2024), a popular format for scientific visualization of the results. On the other side, Blender, thanks to a free add-on named VTKNodes ([[https://github.com/tkeskita/BVtkNodes](https://github.com/tkeskita/BVtkNodes)]([https://github.com/tkeskita/BVtkNodes](https://github.com/tkeskita/BVtkNodes)), accessed on 21 March 2024), is able to import such a file into its node architecture for image rendering. In particular, a Python v3.9 code takes the temperature VTK file, within which the mesh is stored, as well as all the camera data, i.e., pose, pixel size, and sensor size. With such information, the radiative temperature field that is emitted by the target and received by the camera \(q_{fc}\) is computed and stored in a different VTK file. This latter file is the one imported in Blender and used for the actual rendering. The overall pipeline is illustrated in Figure 7.  
Figure 6: Detection camera model workflow.  
Once \(q_{fc}\) is computed, it is possible to use it for the application of any thermal camera model. Indeed, the results presented in the section focus on such a quantity, as everything in the final thermal image is proportional to it. Furthermore, since \(q_{fc}\) is scaled by the emissivity value \(\varepsilon\) of the material, it is clear that \(\varepsilon\) has a big impact on the final result as reported in the following subsections. The presented images are noiseless and for thermal images, the black and white scale is set from the minimum to the maximum heat flux values of the scene, producing a realistic thermal image, upon which, given the presented thermal camera models, the actual output of the instrument can be produced. For such considerations, since the goal is to test the pipeline, the computation of \(q_{fc}\) is the one reported in Equation (18), where the optics attenuation is not considered:  
\[q_{fc}=\frac{\varepsilon\sigma T_{rad}^{4}}{\pi}\ \frac{(\mathbf{\hat{n}}_{f} \cdot\mathbf{r}_{fc})\left(\mathbf{\hat{n}}_{c}\cdot\mathbf{r}_{cf}\right)}{| \mathbf{r}_{fc}|^{4}}\,\Delta A_{c}\,. \tag{18}\]  
It is a simplification because, with the limited wavelength range of the bolometer, the measured heat flux is not necessarily proportional to \(T^{4}\), but since the image can always be scaled to the maximum heat flux observed in the scene, the final image is not affected. Furthermore, it does not affect the pipeline structure or the details of the final image, thus demonstrating the flexibility of the method and its ability to produce relevant data without a specific camera model. Indeed, the full-camera characterization (calibration and noises) is not always available, and the pipeline can cope with that. Having said so, this simplification shall be used just to test the pipeline and not to produce thermal images for real-case scenarios. The pipeline is currently applied with the complete formulation that considers the optics attenuation and the noise of the camera for the thermal camera data available from Hayabusa [1, 3, 13, 14]. The results using such a thermal camera model are reported in Section 4.3. The proposed method has been thoroughly tested under multiple environmental conditions with different heat flux ranges, different combinations of material properties, and background disturbances. The interested reader can refer to [17] for more details on this point and for more information on the application of the pipeline using the complete formulation with optics attenuation and camera noise.