grasp_output_stream.h File Reference

This library defines a general way to work with the output. More...

#include <stdio.h>
#include "../settings/grasp_settings.h"
#include "../input/grasp_input.h"
#include "../output/grasp_output.h"

Go to the source code of this file.

Data Structures

struct  grasp_output_stream_filename_generate_by_template_
 

Macros

#define gos_fprintf(f_, s_, ...)
 It is an implementation of fprinf which uses directly grasp_output_streams. More...
 
#define gos_fprintf_flushed(f_, s_, ...)
 It is an implementation of fprinf which uses directly grasp_output_streams and after printing it force a flush statament. More...
 
#define gos_benchmark_print_stream(f_, label_, benchmark_)
 It is an implementation of fprinf which uses directly grasp_output_streams and benchmark structures. It is thought to print benchmarks quickly. More...
 

Typedefs

typedef char *(* grasp_output_stream_filename_generate_by) (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)
 
typedef struct grasp_output_stream_filename_generate_by_template_ grasp_output_stream_filename_generate_by_template
 

Functions

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_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_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_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_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_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_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_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...
 

Detailed Description

This library defines a general way to work with the output.

Author
David Fuertes
Date
11 Jun 2014 Technical documentation available: (http://www.grasp-open.com/tech-doc/chap02.php#chap02030101) User documentation: (http://www.grasp-open.com/doc/ch04.php#settings-file)

Macro Definition Documentation

◆ gos_benchmark_print_stream

#define gos_benchmark_print_stream (   f_,
  label_,
  benchmark_ 
)
Value:
do { \
if((f_)->writable==true) fprintf(((f_)->file), ("%s:%d: %s: clock_time: %f cpu_time: %f\n"), __FILE__,__LINE__,label_,(benchmark_)->delta_ct, (benchmark_)->delta_ut); \
fflush(((f_)->file)); \
} while (0)

It is an implementation of fprinf which uses directly grasp_output_streams and benchmark structures. It is thought to print benchmarks quickly.

◆ gos_fprintf

#define gos_fprintf (   f_,
  s_,
  ... 
)
Value:
do { \
if((f_)->writable==true) fprintf(((f_)->file), (s_), ## __VA_ARGS__); \
} while (0)

It is an implementation of fprinf which uses directly grasp_output_streams.

◆ gos_fprintf_flushed

#define gos_fprintf_flushed (   f_,
  s_,
  ... 
)
Value:
do { \
if((f_)->writable==true) fprintf(((f_)->file), (s_), ## __VA_ARGS__); \
fflush(((f_)->file)); \
} while (0)

It is an implementation of fprinf which uses directly grasp_output_streams and after printing it force a flush statament.

Typedef Documentation

◆ grasp_output_stream_filename_generate_by

typedef char*(* grasp_output_stream_filename_generate_by) (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)

typedef definition of a function which implements a specific translation from a token and return the substitution string

◆ grasp_output_stream_filename_generate_by_template

Function Documentation

◆ grasp_output_stream_close()

void grasp_output_stream_close ( grasp_output_stream gs)

Close current open stream.

Parameters
gsdefinition 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
gsdefinition of grasp output stream
fpointer 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
gsdefinition 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:

◆ 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
tokenToken to be translated: auto
formatFormat 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
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: icol
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: itime
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: irow
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: iteration
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: itime
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: pwd
formatFormat of the token read from pattern. It is ignored
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated segment_corner_column
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_nt
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated segment_nx
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_ny
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated tile_center_latitude
formatFormat of the token read from pattern: F. It has the format of f C wildcard. FORMATf
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated. tile_center_longitude
formatFormat of the token read from pattern: F. It has the format of f C wildcard. FORMATf
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated. tile_center_longitude
formatFormat 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
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated tile_center_latitude
formatFormat 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
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated. tile_corner_column
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated tile_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated tile_from
formatFormat of the token read from pattern. By default FORMAT is FTH_M_SZ
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated tile_height
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated. tile_to
formatFormat of the token read from pattern. By default FORMAT is FTH_M_SZ
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: tile_width
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated. It is the value read from pattern
formatFormat of the token read from pattern. It is ignored
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: segment_corner_row
formatFormat of the token read from pattern: N. It has to be a integer number which represents number of 0s at left
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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
tokenToken to be translated: yml
formatFormat of the token read from pattern. It is ignored
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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_namecomplete pattern of the filename
settingsCurrent settings
segmentInput segment
outputOutput current segment
tile_descriptionTile description (dimensions)
icolNumber of column. If it is known you have to use -1
irowNumber of current row of the segment
itimeNumber 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_namePattern 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]filenamea valid grasp output stream pattern
[out]gsgrasp 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
gsdefinition of grasp output stream
settingscurrent settings used
segmentcurrent processed segment
outputoutput of processed segment
tile_descriptiongeneral description of tile
icolcolumn position of the segment in the tile
irowrow position of the segment in the tile
itimetime 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
gsdefinition 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
gsdefinition of grasp output stream
Returns
rue if the stream is writable FILE (there was not error)