Customized TRM4 Batch Module

The TRM4 Batch Module is a tailored solution we provide to our customers to enable batch calculations on a specific set of TRM4 input parameters. The customers define which set of TRM4 input parameters and which set of output parameters they are interested in and in return, we provide a C-API (Application Programming Interface) to run batch calculations with exactly these input parameters and to output exactly the requested results using third party software with compatible C-interface (e.g. Python, Matlab).

Working principle of the TRM4 Batch Module

TRM4 Batch Module workflow.
TRM4 Batch Module workflow.

The starting point of a batch calculation using the TRM4 Batch Module is a tr4-file generated in the graphical user interface (GUI) of the TRM4 software. This file serves as a template specification of the imager and environmental conditions and must comply with the restrictions described in the tab “Restrictions”.

As a second step, the tr4-file is loaded by the Batch Module. If an error occurs, the diagnostics function of the Batch Module will help you to troubleshoot it. After the file is successfully opened by the Batch Module, the user is provided with a handle (pointer) to the specific set of input parameters agreed on. Using this handle, the user can edit these parameters at will.

For each edit of the input parameters, a calculation can be performed (batch calculation). Once again, if an error occurs during calculation, the diagnostics function of the Batch Module will help to troubleshoot the error. Using a handle to the defined set of output parameters, the user can read out the TRM4 results and use them for further processing.

TRM4v3 GUI input mask associated with the specification of „Target, Scenario and Task“. Red-rimmed GUI controls are not allowed to be changed in TRM4 Batch Module, while green-rimmed ones are.
TRM4v3 GUI input mask associated with the specification of „Target, Scenario and Task“. Red-rimmed GUI controls are not allowed to be changed in TRM4 Batch Module, while green-rimmed ones are.

In the graphical user interface of TRM4, there are basically two types of fields in the input masks for the imager, environment and task specification: fields associated with a numerical value and fields associated with GUI controls (e.g. radio button, list box, check box). Using the Batch Module only those input parameters can be accessed which correspond to fields associated with a numerical value.

As an example, the figure shows the input mask associated with the specification of “Target, Scenario and Tasks”. Fields marked with a red rectangle are GUI controls and thus not allowed as input parameters. Whereas those marked with green rectangles are fields associated with numerical values and therefore allowed for the Batch Module. External data (e.g. the background spectral reflectivity) is also considered as a numerical value. In this case, only the control “Spectral” needs to be selected. The Batch Module will then use the data stored in the underlying table disregarding whether it is defined from preset data (here “green grassland”) or is user specified data.

The full functionality of the TRM4 Batch Module is provided via a C-API with the following exported functions:

Function Description
int bm_init() This is the starting point of any calculations with the batch module. This allocates memory and its return value tells whether this was successful or not. See “Start” in the workflow.
struct user_input * const bm_user_input() This provides a handle to the user_input structures holding input parameters. See “Edit parameters” in the workflow.
const struct user_output * const bm_user_output() This provides a handle to the user_output structures holding output quantities. See “Read out and save results for postprocessing” in the workflow.
int bm_open(const char *) Open in the batch module a tr4 file given as argument. Return value tells whether this was successful or not. See “Open tr4 project file in batch module” in the workflow.
int bm_calculate() Starts a TRM4 calculation. Return value tells whether this was successful or not. See “Calculate” in the workflow.
const char * bm_diagnostics() This provides the same amount of information as the Diagnostics window of the TRM4 GUI. In case the batch module functions bm_open() and bm _calculate() fail, additional information is given. See “Diagnostics” in the workflow.
int bm_term() This is the last function to be called when using the batch module. This deallocates memory. See “End” in the workflow.

Note that the structures user_input and user_output are tailored to the needs of the customer and have to be agreed on before a user specific Batch Module can be provided since the methods bm_open(const char *), bm_calculate() and bm_diagnostics() will provide some user specific content.

Further information

 

Sensor simulation

You want to learn more about our projects and competences in the field of modeling and simulation of electro-optical systems? Then visit the page of the sensor simulation research group.

 

Do you have questions about our research topic or are you interested in a collaboration? Do not hesitate to contact us. We are happy to support you with our competences.

 

Optronics department

You want to learn more about our projects and specific competences in the field of optronics?