grasp_output_stream.h
Go to the documentation of this file.
52 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);
82 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);
126 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); \
156 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);
161 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);
181 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);
196 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);
211 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);
226 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);
241 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);
256 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);
271 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);
286 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);
301 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);
316 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);
331 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);
346 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);
361 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);
376 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);
391 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);
406 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);
421 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);
436 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);
451 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);
466 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);
481 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);
496 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);
511 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);
526 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);
541 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);
556 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);
572 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);
587 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);
602 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);
617 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);
632 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);
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
Definition: grasp_output_stream.c:1011
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
Definition: grasp_output_stream.c:880
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
Definition: grasp_output_stream.c:1057
Definition: grasp_output_stream_t.h:24
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 beginn...
Definition: grasp_output_stream.c:1123
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
Definition: grasp_output_stream.c:851
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
Definition: grasp_output_stream.c:423
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
Definition: grasp_output_stream.c:567
Definition: grasp_input_tile_description.h:22
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....
Definition: grasp_output_stream.c:708
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
Definition: grasp_output_stream.c:1096
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
Definition: grasp_output_stream.c:451
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....
Definition: grasp_output_stream.c:738
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_stre...
Definition: grasp_output_stream.c:320
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....
Definition: grasp_output_stream.c:909
void grasp_output_stream_debug(grasp_output_stream *gs, FILE *f)
Dump debug information of current grasp output stream.
Definition: grasp_output_stream.c:377
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
Definition: grasp_output_stream.c:1109
struct grasp_output_stream_filename_generate_by_template_ grasp_output_stream_filename_generate_by_template
bool grasp_output_stream_writable_file(const grasp_output_stream *gs)
Return true if the stream is writable file (only if is a file)
Definition: grasp_output_stream.c:352
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.
Definition: grasp_output_stream.c:1137
void grasp_output_stream_close(grasp_output_stream *gs)
Close current open stream.
Definition: grasp_output_stream.c:360
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: Inpu...
Definition: grasp_output_stream.c:938
Definition: grasp_output_segment_result.h:498
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
Definition: grasp_output_stream.c:596
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)
Definition: grasp_output_stream.h:161
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)
Definition: grasp_output_stream.c:53
void grasp_output_stream_destroy(grasp_output_stream *gs)
Deallocate memory taken by grasp output stream.
Definition: grasp_output_stream.c:373
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....
Definition: grasp_output_stream.c:797
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
Definition: grasp_output_stream.c:480
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....
Definition: grasp_output_stream.c:679
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
Definition: grasp_output_stream.c:989
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
Definition: grasp_output_stream.c:652
void grasp_output_stream_initialize(const char *filename, grasp_output_stream *gs)
Initilize gs stream argument with filename string.
Definition: grasp_output_stream.c:280
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.
Definition: grasp_output_stream.c:129
const char * token
Definition: grasp_output_stream.h:164
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....
Definition: grasp_output_stream.c:824
Definition: grasp_input_segment.h:243
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
Definition: grasp_output_stream.c:1043
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
Definition: grasp_output_stream.c:625
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
Definition: grasp_output_stream.c:967
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
Definition: grasp_output_stream.c:538
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
Definition: grasp_output_stream.c:387
Definition: grasp_output_stream.h:163
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
Definition: grasp_output_stream.c:1070
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....
Definition: grasp_output_stream.c:767
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
Definition: grasp_output_stream.c:1083
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
Definition: grasp_output_stream.c:509
bool grasp_output_stream_writable(const grasp_output_stream *gs)
Return true if the stream is writable.
Definition: grasp_output_stream.c:348
Definition: grasp_settings_t.h:409
bool grasp_output_stream_filename_validation(const char *original_name)
Validate if filename is well-formed.
Definition: grasp_output_stream.c:144