grasp_input.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 CNRS & Universite Lille 1. All rights reserved.
3  *
4  * Licensed under the GRASP Open Source License V1.0 (see LICENSE file)
5  */
6 
7 #ifndef GRASP_DATA_H
8 #define GRASP_DATA_H
9 
10 #include "mod_par_OS.inc"
11 #include "mod_par_inv.inc"
12 #include <time.h>
13 #include <stdbool.h>
14 #include <stdint.h>
15 #include <stdio.h>
16 #include "../settings/grasp_settings.h"
17 #include "../output/grasp_output_stream_t.h"
18 #include "../controller/grasp_controller_functions.h"
19 
20 #define GRASP_INPUT_UNKNOWN_FILEINDEX -1
21 
22 
23 // Initialize grasp tile description
24 int grasp_input_initialize_tile_description(int nfiles, char input_files[GRASP_INPUT_MAX_FILES][_GBL_FILE_PATH_LEN], grasp_tile_description_t *tile_description);
25 
26 // Main function for get segment data.
27 // Return segment filled with segment data and return number of pixels retrieved. Return a number lower than 0 if there was a problem
28 int grasp_input_extract_segment(grasp_settings *settings, grasp_input_driver_t *driver, int ntransformers,grasp_input_transformer_t *transformers, grasp_segment_t *segment,grasp_results_t *results, grasp_tile_dimensions_t *tile_dimensions, int id_inversion);
29 
30 // Initialization funtion from retrieval module. It is implemented in mod_edges.f90
32 
33 // Set in segment.edges the information of available pixels around the segment
34 void grasp_input_edges_find(grasp_settings *settings, grasp_segment_t *segment, grasp_tile_dimensions_t *tile_dimensions, grasp_results_t *results, int icol, int irow, int itime);
35 
36 /* provides the number of pixels in the group of pixels corresponding to
37  * the it index time (between 1 and NT).
38  */
39 int grasp_input_get_num_pixels_at_it(const sensor_data_t *sdata, int it);
40 
50 int grasp_input_position_of_inversion(const grasp_tile_dimensions_t *tile_dimensions, int id_inversion, int *icol, int *irow, int *itime);
51 
52 /*
53  * This function remove missing_value from segment and update the corresponding related fields
54  */
55 void grasp_input_clean_segment(grasp_segment_t *segment, float missing_value);
56 
63 void grasp_input_dump_iguess(FILE *output_stream, const grasp_settings *settings, const grasp_segment_t *segment);
64 /*
65  * This function dumps a segment in the SDATA format.
66  */
67 void grasp_input_dump_sdata(FILE *output_stream, const sensor_data_t *sdata);
68 
69 /*
70  * This function prints a segment in a readable form, for debugging purpose.
71  * The label is any string the caller wants to display in front of the segment
72  * (may be set to NULL or an empty string if no label is needed).
73  */
74 void grasp_input_print_sdata(FILE *output_stream, const char *label, const sensor_data_t *sdata);
75 
76 /* Added by F. Ducos (more debugging routines for segments, with the original interface; required by the POLDER driver) */
77 void grasp_input_print_segment_pixel(FILE *output_stream, const grasp_segment_t *segment, size_t ipixel);
78 void grasp_input_print_segment(FILE *output_stream, const char *label, const grasp_segment_t *segment);
79 
80 // Return all filenames that will be processed expading filenames array of configuration
81 int grasp_input_expand_files(int nfiles, char input_files[GRASP_INPUT_MAX_FILES][_GBL_FILE_PATH_LEN], char ***output_files);
82 
83 // trackmem_free memory of input filenames used
84 void grasp_input_deallocate_expanded_files(char **files, int nfiles);
85 
86 #endif /* GRASP_DATA_H */
void grasp_input_print_segment_pixel(FILE *output_stream, const grasp_segment_t *segment, size_t ipixel)
Definition: grasp_input.c:1480
void grasp_input_dump_sdata(FILE *output_stream, const sensor_data_t *sdata)
Definition: grasp_input.c:1412
void grasp_input_clean_segment(grasp_segment_t *segment, float missing_value)
Definition: grasp_input.c:639
void grasp_input_edges_initialization(segment_edges *edges)
int grasp_input_expand_files(int nfiles, char input_files[GRASP_INPUT_MAX_FILES][_GBL_FILE_PATH_LEN], char ***output_files)
Definition: grasp_input.c:1519
Definition: grasp_output_tile_result.h:292
void grasp_input_deallocate_expanded_files(char **files, int nfiles)
Definition: grasp_input.c:1576
Definition: grasp_input_tile_description.h:22
Definition: grasp_input_tile_description.h:32
int grasp_input_get_num_pixels_at_it(const sensor_data_t *sdata, int it)
Definition: grasp_input.c:602
Definition: grasp_input_segment.h:147
int grasp_input_initialize_tile_description(int nfiles, char input_files[GRASP_INPUT_MAX_FILES][_GBL_FILE_PATH_LEN], grasp_tile_description_t *tile_description)
Definition: grasp_input.c:23
void grasp_input_print_sdata(FILE *output_stream, const char *label, const sensor_data_t *sdata)
Definition: grasp_input.c:1492
void grasp_input_print_segment(FILE *output_stream, const char *label, const grasp_segment_t *segment)
Definition: grasp_input.c:1472
void grasp_input_edges_find(grasp_settings *settings, grasp_segment_t *segment, grasp_tile_dimensions_t *tile_dimensions, grasp_results_t *results, int icol, int irow, int itime)
Definition: grasp_input.c:571
int grasp_input_position_of_inversion(const grasp_tile_dimensions_t *tile_dimensions, int id_inversion, int *icol, int *irow, int *itime)
Definition: grasp_input.c:44
Definition: grasp_input_segment.h:243
int grasp_input_extract_segment(grasp_settings *settings, grasp_input_driver_t *driver, int ntransformers, grasp_input_transformer_t *transformers, grasp_segment_t *segment, grasp_results_t *results, grasp_tile_dimensions_t *tile_dimensions, int id_inversion)
Definition: grasp_input.c:69
#define GRASP_INPUT_MAX_FILES
Definition: grasp_input_settings.h:24
Definition: grasp_input_functions.h:40
Definition: grasp_settings_t.h:409
Definition: grasp_input_segment.h:227
void grasp_input_dump_iguess(FILE *output_stream, const grasp_settings *settings, const grasp_segment_t *segment)
Definition: grasp_input.c:1396
Definition: grasp_input_functions.h:51