mo_grasp_controller.h File Reference

C interface to access some Fortran functions from retrieval algorithm. More...

#include "mod_par_inv.inc"
#include "../settings/grasp_settings_t.h"
#include "../input/grasp_input_segment.h"
#include "../output/grasp_output_segment_result.h"
#include "../retrieval/mod_par_inv.inc"

Go to the source code of this file.

Functions

void grasp_prepare_segment_settings (retr_input *RIN, sensor_data_t *segment_meas)
 
int grasp_init_inversion (retr_input *RIN)
 
int grasp_input_inversion (const retr_input *RIN, const sensor_data_t *sdata, const float iguess[_KIMAGE][_KPARS], const segment_edges *edges, output_segment_general *ROUT)
 
void grasp_finalize_inversion (retr_input *RIN)
 

Detailed Description

C interface to access some Fortran functions from retrieval algorithm.

Author
David Fuertes
Date
25 Oct 2013 GRASP algorithm is developed in Fortran. Some functions from scientific core are used by the control unit. Controller is the responsible to organize the workflow for processing a big tile (many segments). In this workflow the controller will need to call inversion subroutine (implemented in Fortran) and other functions in order to prepare inputs and outputs. This file contains a C interface for some functions implemented in scientific core but needed to be called from the controller

Function Documentation

◆ grasp_finalize_inversion()

void grasp_finalize_inversion ( retr_input RIN)

Init funtion allocate some global structures which need to be deallocated. It has to be called after inverting all segments

Parameters
RINInput retrieval settings.

◆ grasp_init_inversion()

int grasp_init_inversion ( retr_input RIN)

Before calling inversion algorithm it needs to initialize some global variables. It take some time but once it is initialized you can process many segments so it is only necessary to call at the beginning of first inversion.

Parameters
RINInput retrieval settings

◆ grasp_input_inversion()

int grasp_input_inversion ( const retr_input RIN,
const sensor_data_t sdata,
const float  iguess[_KIMAGE][_KPARS],
const segment_edges edges,
output_segment_general ROUT 
)

C interface for inversion Fortran function.

Parameters
RINInput retrieval settings
sdataInput measures
iguessInitial guess for each pixel. If it is -999 it will replace the value read from settings otherwise this value will be used for a specific pixel
edgesEdges information of current segment
ROUTOutput structure filled with results from inversion
Returns
0 if the inversion process finish properly. -1 in case there is an error but it is related with this specific segment. -2 in case there is an error and all segments are going to be erroneous (abort process)

◆ grasp_prepare_segment_settings()

void grasp_prepare_segment_settings ( retr_input RIN,
sensor_data_t segment_meas 
)

Before calling inversion scientific core needs to do some changes and set some input parameters based on input settings and input measures

Parameters
RINInput settings read which will be checked and prepared to process a specific segment
segment_measInput measures will be checked and prepared to process with specific behavior (settings)