#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>
#include "grasp_output_stream.h"
#include <grasp/utils.h>
#include "../global/grasp_runtime_information.h"
#include "../global/grasp_compilation_information.h"
#include "../retrieval/constants_set/mod_globals.inc"
Functions | |
char * | grasp_output_stream_filename_generator (const char *original_name, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
char * | grasp_output_stream_filename (grasp_output_stream *gs, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
Return a allocated string created from original_name replacing the special pattern wildcards. More... | |
bool | grasp_output_stream_filename_validation (const char *original_name) |
Validate if filename is well-formed. More... | |
void | grasp_output_stream_initialize (const char *filename, grasp_output_stream *gs) |
Initilize gs stream argument with filename string. More... | |
FILE * | grasp_output_stream_open (grasp_output_stream *gs, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
Open a stream returning FILE pointer. Open a stream returning FILE pointer. You should use grasp_stream_writable for knowing if you can write in it. If you don't want to add extra information you can give null and -1 values to extra information arguments. More... | |
bool | grasp_output_stream_writable (const grasp_output_stream *gs) |
Return true if the stream is writable. More... | |
bool | grasp_output_stream_writable_file (const grasp_output_stream *gs) |
Return true if the stream is writable file (only if is a file) More... | |
void | grasp_output_stream_close (grasp_output_stream *gs) |
Close current open stream. More... | |
void | grasp_output_stream_destroy (grasp_output_stream *gs) |
Deallocate memory taken by grasp output stream. More... | |
void | grasp_output_stream_debug (grasp_output_stream *gs, FILE *f) |
Dump debug information of current grasp output stream. More... | |
char * | grasp_output_stream_filename_generate_by_auto (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
auto(N): itimexicolxirow with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_icol (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
icol(N): current column number with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_irow (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
irow(N): current column number with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_itime (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
itime(N): current time number with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_iinversion (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
iinversion(N): current inversion id with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_segment_nx (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
segment_nx(N): number of X elements per segment with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_segment_ny (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
segment_ny(N): number of Y elements per segment with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_segment_nt (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
segment_nt(N): number of T elements per segment with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_tile_from (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_from(FORMAT): start tile date in FORMAT. By default FORMAT is FTH_M_SZ More... | |
char * | grasp_output_stream_filename_generate_by_tile_to (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_to(FORMAT): final tile date in FORMAT. By default FORMAT is FTH_M_SZ More... | |
char * | grasp_output_stream_filename_generate_by_tile_corner_column (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_corner_column(N): number of the corner (column) of the tile defined in settings file. Requirement: Input data have to be defined using input.corner instead of input.center More... | |
char * | grasp_output_stream_filename_generate_by_tile_corner_row (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_corner_row(N): number of the corner of (row) the tile defined in settings file. Requirement: Input data have to be defined using input.corner instead of input.center More... | |
char * | grasp_output_stream_filename_generate_by_tile_center_longitude (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_center_longitude(FORMAT): longitude of the center of the tile defined in settings file. Requirement: Input data have to be defined using input.center instead of input.corner More... | |
char * | grasp_output_stream_filename_generate_by_tile_center_latitude (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_center_latitude(FORMAT): latitude of the center of the tile defined in settings file. Requirement: Input data have to be defined using input.center instead of input.corner More... | |
char * | grasp_output_stream_filename_generate_by_tile_coordinate_x (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_coordinate_x(I): x input reference of center of the tile defined in settings file. It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center More... | |
char * | grasp_output_stream_filename_generate_by_tile_coordinate_y (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_coordinate_y(I): y input reference of center of the tile defined in settings file. It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center More... | |
char * | grasp_output_stream_filename_generate_by_tile_width (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_width(N): Number of X elements in tile with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_tile_height (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
tile_height(N): Number of Y elements in tile with N zeros at the left More... | |
char * | grasp_output_stream_filename_generate_by_segment_corner_column (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
segment_corner_column(N): number of column of the segment corner with N zeros at the left. Requirement: Input data have to be defined using input.corner instead of input.center More... | |
char * | grasp_output_stream_filename_generate_by_segment_corner_row (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
segment_corner_row(N): number of row of the segment corner with N zeros at the left Requirement: Input data have to be defined using input.corner instead of input.center More... | |
char * | grasp_output_stream_filename_generate_by_segment_first_date (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
version: Return first date present in specific segment More... | |
char * | grasp_output_stream_filename_generate_by_segment_last_date (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
version: Return last date present in specific segment More... | |
char * | grasp_output_stream_filename_generate_by_iteration (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
version: Return number of iterations of current retrieval More... | |
char * | grasp_output_stream_filename_generate_by_settings_filename (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
settings_filename: the name of settings file used to run the retrieval More... | |
char * | grasp_output_stream_filename_generate_by_version (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
version: Return version of grasp if it is compiled with saving this information More... | |
char * | grasp_output_stream_filename_generate_by_branch (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
branch: git branch of grasp if it is compiled with saving this information More... | |
char * | grasp_output_stream_filename_generate_by_commit (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
commit: Return commit reference of grasp if it is compiled with saving this information More... | |
char * | grasp_output_stream_filename_generate_by_constants_set (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
constants_set: Return constants set used in compilation time More... | |
char * | grasp_output_stream_filename_generate_by_pwd (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
pwd: this is replaced by current folder and is only valid at the beginning of the stream definition More... | |
char * | grasp_output_stream_filename_generate_by_yml (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
yml: this is replaced by current folder of main configuration file and it is only valid at the beginning of the stream definition More... | |
char * | grasp_output_stream_filename_generate_by_token (const char *token, const char *format, const grasp_settings *settings, const grasp_segment_t *segment, const output_segment_general *output, const grasp_tile_dimensions_t *tile_description, int icol, int irow, int itime) |
When the token is known this function is called and will return a copy of input token. More... | |
Variables | |
grasp_output_stream_filename_generate_by_template | grasp_output_stream_wildcard_dictionary [] |
Function Documentation
◆ grasp_output_stream_close()
void grasp_output_stream_close | ( | grasp_output_stream * | gs | ) |
Close current open stream.
- Parameters
-
gs definition of grasp output stream which will be closed
◆ grasp_output_stream_debug()
void grasp_output_stream_debug | ( | grasp_output_stream * | gs, |
FILE * | f | ||
) |
Dump debug information of current grasp output stream.
- Parameters
-
gs definition of grasp output stream f pointer to file where the information will be dumped
◆ grasp_output_stream_destroy()
void grasp_output_stream_destroy | ( | grasp_output_stream * | gs | ) |
Deallocate memory taken by grasp output stream.
- Parameters
-
gs definition of grasp output stream
◆ grasp_output_stream_filename()
char* grasp_output_stream_filename | ( | grasp_output_stream * | gs, |
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
Return a allocated string created from original_name replacing the special pattern wildcards.
Return a allocated string created from original_name replacing the special pattern wildcards. In addition, gs structure will be change to contains the information about if the stream is writable. The following list show all available wildcards that can be used for creating dynamic output filenames:
- auto(N): grasp_output_stream_filename_generate_by_auto
- icol(N): grasp_output_stream_filename_generate_by_icol
- irow(N): grasp_output_stream_filename_generate_by_irow ... this list is keep updated in user doc and the relation between wildcard and function can be found in grasp_output_stream_wildcard_dictionary variable of grasp_output_stream.c
- pwd: grasp_output_stream_filename_generate_by_pwd
- yml: grasp_output_stream_filename_generate_by_yml
- Parameters
-
gs definition of grasp output stream settings current settings used segment current processed segment output output of processed segment tile_description general description of tile icol column position of the segment in the tile irow row position of the segment in the tile itime time position of the segment in the tile
- Returns
- Return a allocated string created from original_name replacing the special pattern wildcards
◆ grasp_output_stream_filename_generate_by_auto()
char* grasp_output_stream_filename_generate_by_auto | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
auto(N): itimexicolxirow with N zeros at the left
- Parameters
-
token Token to be translated: auto format Format of the token read from pattern: "%dx%dx%d" by default but if N is a number it will represent number of zeros at left of each number. Example for N=3: 000111222 settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_branch()
char* grasp_output_stream_filename_generate_by_branch | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
branch: git branch of grasp if it is compiled with saving this information
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_commit()
char* grasp_output_stream_filename_generate_by_commit | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
commit: Return commit reference of grasp if it is compiled with saving this information
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_constants_set()
char* grasp_output_stream_filename_generate_by_constants_set | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
constants_set: Return constants set used in compilation time
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_icol()
char* grasp_output_stream_filename_generate_by_icol | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
icol(N): current column number with N zeros at the left
- Parameters
-
token Token to be translated: icol format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_iinversion()
char* grasp_output_stream_filename_generate_by_iinversion | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
iinversion(N): current inversion id with N zeros at the left
- Parameters
-
token Token to be translated: itime format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_irow()
char* grasp_output_stream_filename_generate_by_irow | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
irow(N): current column number with N zeros at the left
- Parameters
-
token Token to be translated: irow format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_iteration()
char* grasp_output_stream_filename_generate_by_iteration | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
version: Return number of iterations of current retrieval
- Parameters
-
token Token to be translated: iteration format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_itime()
char* grasp_output_stream_filename_generate_by_itime | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
itime(N): current time number with N zeros at the left
- Parameters
-
token Token to be translated: itime format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_pwd()
char* grasp_output_stream_filename_generate_by_pwd | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
pwd: this is replaced by current folder and is only valid at the beginning of the stream definition
- Parameters
-
token Token to be translated: pwd format Format of the token read from pattern. It is ignored settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_corner_column()
char* grasp_output_stream_filename_generate_by_segment_corner_column | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
segment_corner_column(N): number of column of the segment corner with N zeros at the left. Requirement: Input data have to be defined using input.corner instead of input.center
- Parameters
-
token Token to be translated segment_corner_column format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_corner_row()
char* grasp_output_stream_filename_generate_by_segment_corner_row | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
segment_corner_row(N): number of row of the segment corner with N zeros at the left Requirement: Input data have to be defined using input.corner instead of input.center
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_first_date()
char* grasp_output_stream_filename_generate_by_segment_first_date | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
version: Return first date present in specific segment
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_last_date()
char* grasp_output_stream_filename_generate_by_segment_last_date | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
version: Return last date present in specific segment
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_nt()
char* grasp_output_stream_filename_generate_by_segment_nt | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
segment_nt(N): number of T elements per segment with N zeros at the left
- Parameters
-
token Token to be translated: segment_nt format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_nx()
char* grasp_output_stream_filename_generate_by_segment_nx | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
segment_nx(N): number of X elements per segment with N zeros at the left
- Parameters
-
token Token to be translated segment_nx format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_segment_ny()
char* grasp_output_stream_filename_generate_by_segment_ny | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
segment_ny(N): number of Y elements per segment with N zeros at the left
- Parameters
-
token Token to be translated: segment_ny format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_settings_filename()
char* grasp_output_stream_filename_generate_by_settings_filename | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
settings_filename: the name of settings file used to run the retrieval
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_center_latitude()
char* grasp_output_stream_filename_generate_by_tile_center_latitude | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_center_latitude(FORMAT): latitude of the center of the tile defined in settings file. Requirement: Input data have to be defined using input.center instead of input.corner
- Parameters
-
token Token to be translated tile_center_latitude format Format of the token read from pattern: F. It has the format of f C wildcard. FORMATf settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_center_longitude()
char* grasp_output_stream_filename_generate_by_tile_center_longitude | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_center_longitude(FORMAT): longitude of the center of the tile defined in settings file. Requirement: Input data have to be defined using input.center instead of input.corner
- Parameters
-
token Token to be translated. tile_center_longitude format Format of the token read from pattern: F. It has the format of f C wildcard. FORMATf settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_coordinate_x()
char* grasp_output_stream_filename_generate_by_tile_coordinate_x | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_coordinate_x(I): x input reference of center of the tile defined in settings file. It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center
- Parameters
-
token Token to be translated. tile_center_longitude format Format of the token read from pattern: It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_coordinate_y()
char* grasp_output_stream_filename_generate_by_tile_coordinate_y | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_coordinate_y(I): y input reference of center of the tile defined in settings file. It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center
- Parameters
-
token Token to be translated tile_center_latitude format Format of the token read from pattern: It can be defined by corner or latitude. I is N in case it was defined by corner or 0.I in case it was defined like center settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_corner_column()
char* grasp_output_stream_filename_generate_by_tile_corner_column | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_corner_column(N): number of the corner (column) of the tile defined in settings file. Requirement: Input data have to be defined using input.corner instead of input.center
- Parameters
-
token Token to be translated. tile_corner_column format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_corner_row()
char* grasp_output_stream_filename_generate_by_tile_corner_row | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_corner_row(N): number of the corner of (row) the tile defined in settings file. Requirement: Input data have to be defined using input.corner instead of input.center
- Parameters
-
token Token to be translated tile_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_from()
char* grasp_output_stream_filename_generate_by_tile_from | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_from(FORMAT): start tile date in FORMAT. By default FORMAT is FTH_M_SZ
- Parameters
-
token Token to be translated tile_from format Format of the token read from pattern. By default FORMAT is FTH_M_SZ settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_height()
char* grasp_output_stream_filename_generate_by_tile_height | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_height(N): Number of Y elements in tile with N zeros at the left
- Parameters
-
token Token to be translated tile_height format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_to()
char* grasp_output_stream_filename_generate_by_tile_to | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_to(FORMAT): final tile date in FORMAT. By default FORMAT is FTH_M_SZ
- Parameters
-
token Token to be translated. tile_to format Format of the token read from pattern. By default FORMAT is FTH_M_SZ settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_tile_width()
char* grasp_output_stream_filename_generate_by_tile_width | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
tile_width(N): Number of X elements in tile with N zeros at the left
- Parameters
-
token Token to be translated: tile_width format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_token()
char* grasp_output_stream_filename_generate_by_token | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
When the token is known this function is called and will return a copy of input token.
- Parameters
-
token Token to be translated. It is the value read from pattern format Format of the token read from pattern. It is ignored settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_version()
char* grasp_output_stream_filename_generate_by_version | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
version: Return version of grasp if it is compiled with saving this information
- Parameters
-
token Token to be translated: segment_corner_row format Format of the token read from pattern: N. It has to be a integer number which represents number of 0s at left settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generate_by_yml()
char* grasp_output_stream_filename_generate_by_yml | ( | const char * | token, |
const char * | format, | ||
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
yml: this is replaced by current folder of main configuration file and it is only valid at the beginning of the stream definition
- Parameters
-
token Token to be translated: yml format Format of the token read from pattern. It is ignored settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- the wildcard translated
◆ grasp_output_stream_filename_generator()
char* grasp_output_stream_filename_generator | ( | const char * | original_name, |
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
Returns the name of a file applying substitutions to a pattern with wildcards
- Parameters
-
original_name complete pattern of the filename settings Current settings segment Input segment output Output current segment tile_description Tile description (dimensions) icol Number of column. If it is known you have to use -1 irow Number of current row of the segment itime Number of current time of the segment
- Returns
- A string with all wildcards replaced
◆ grasp_output_stream_filename_validation()
bool grasp_output_stream_filename_validation | ( | const char * | original_name | ) |
Validate if filename is well-formed.
- Parameters
-
original_name Pattern to check if it is a valid stream pattern
- Returns
- true if the patern is a valid one
◆ grasp_output_stream_initialize()
void grasp_output_stream_initialize | ( | const char * | filename, |
grasp_output_stream * | gs | ||
) |
Initilize gs stream argument with filename string.
- Parameters
-
[in] filename a valid grasp output stream pattern [out] gs grasp output stream structure initialized
◆ grasp_output_stream_open()
FILE* grasp_output_stream_open | ( | grasp_output_stream * | gs, |
const grasp_settings * | settings, | ||
const grasp_segment_t * | segment, | ||
const output_segment_general * | output, | ||
const grasp_tile_dimensions_t * | tile_description, | ||
int | icol, | ||
int | irow, | ||
int | itime | ||
) |
Open a stream returning FILE pointer. Open a stream returning FILE pointer. You should use grasp_stream_writable for knowing if you can write in it. If you don't want to add extra information you can give null and -1 values to extra information arguments.
- Parameters
-
gs definition of grasp output stream settings current settings used segment current processed segment output output of processed segment tile_description general description of tile icol column position of the segment in the tile irow row position of the segment in the tile itime time position of the segment in the tile
- Returns
- FILE pointer to stream.
◆ grasp_output_stream_writable()
bool grasp_output_stream_writable | ( | const grasp_output_stream * | gs | ) |
Return true if the stream is writable.
- Parameters
-
gs definition of grasp output stream
- Returns
- true if the stream is writable (there was not error)
◆ grasp_output_stream_writable_file()
bool grasp_output_stream_writable_file | ( | const grasp_output_stream * | gs | ) |
Return true if the stream is writable file (only if is a file)
- Parameters
-
gs definition of grasp output stream
- Returns
- rue if the stream is writable FILE (there was not error)
Variable Documentation
◆ grasp_output_stream_wildcard_dictionary
grasp_output_stream_filename_generate_by_template grasp_output_stream_wildcard_dictionary[] |