Main Page | Files | Data Structures | Functions | Global Variables |

gpiv-io.h File Reference

module for input/output. More...

Go to the source code of this file.

Defines

#define GPIV_PIV_FMT   "%4.0f %4.0f %12.3f %12.3f %12.3f %2d\n"
#define GPIV_PIV_S_FMT   "%-12.5f %-12.5f %-12.5f %-12.5f %-6.2f %-2d\n"
#define GPIV_SCALAR_FMT   "%4.0f %4.0f %12.3f %2d\n"
#define GPIV_SCALAR_S_FMT   "%-12.3f %-12.3f %-12.3f %-2d\n"
#define GPIV_EXT_HEADER   ".h"
#define GPIV_EXT_RAW_IMAGE   ".r"
#define GPIV_EXT_PNG_IMAGE   ".png"
#define GPIV_EXT_PNG_IMAGE_UPCASE   ".PNG"
#define GPIV_EXT_PNG_IMAGE_PROC   "_proc.png"
#define GPIV_EXT_PGM_IMAGE   ".pgm"
#define GPIV_EXT_PGM_IMAGE_UPCASE   ".PGM"
#define GPIV_EXT_RAW_IMAGE_PROC   "_proc.r"
#define GPIV_EXT_PAR   ".par"
#define GPIV_EXT_TA   ".ta"
#define GPIV_EXT_SUBSTR   ".substr"
#define GPIV_EXT_GPIV   ".gpi"
#define GPIV_EXT_GPIV_UPCASE   ".GPI"
#define GPIV_EXT_PIV   ".piv"
#define GPIV_EXT_DAVIS   ".img"
#define GPIV_EXT_DAVIS_UPCASE   ".IMG"
#define GPIV_EXT_COV   ".cov"
#define GPIV_EXT_INT   ".int"
#define GPIV_EXT_OLD   ".old.piv"
#define GPIV_EXT_ERR_PIV   ".err.piv"
#define GPIV_EXT_ERR_STAT   ".stat"
#define GPIV_EXT_PLK   ".plk"
#define GPIV_EXT_UVHISTO   ".pdf"
#define GPIV_EXT_VOR   ".vor"
#define GPIV_EXT_NSTR   ".nstr"
#define GPIV_EXT_SSTR   ".sstr"
#define GPIV_EXT_MANI   ".ma.piv"
#define GPIV_EXT_SA   ".sa.piv"
#define GPIV_EXT_SC   ".sc.piv"
#define GPIV_DAVIS_IMG_DEPTH   12
#define GPIV_IMG_PARAM_RESOURCES

Enumerations

enum  GpivDataFormat { GPIV_RR = 1, GPIV_DAV = 2 }

Functions

void gpiv_io_make_fname (const gchar *fname_base, const gchar *EXT, gchar *fname_out)
GpivImagegpiv_read_image (FILE *fp)
GpivImagegpiv_fread_image (const gchar *fname)
enum GpivDataFormat gpiv_find_pivdata_origin (const gchar line[GPIV_MAX_CHARS])
GpivPivDatagpiv_fread_pivdata (const gchar *fname)
gchar * gpiv_fwrite_pivdata (const gchar *fname, GpivPivData *piv_data, const gboolean free)
GpivPivDatagpiv_read_pivdata (FILE *fp)
GpivPivDatagpiv_read_pivdata_fastx (FILE *fp)
gchar * gpiv_write_pivdata (FILE *fp, GpivPivData *piv_data, const gboolean free)
GpivScalarDatagpiv_fread_scdata (const gchar *fname)
gchar * gpiv_fwrite_scdata (const gchar *fname, GpivScalarData *scalar_data, const gboolean free)
GpivScalarDatagpiv_read_scdata (FILE *fp)
gchar * gpiv_write_scdata (FILE *fp, GpivScalarData *scalar_data, const gboolean free)
gchar * gpiv_write_sc_griddata (FILE *fp, GpivScalarData *scalar_data, const gboolean free)
gchar * gpiv_write_sc_mtvgriddata (FILE *fp, GpivScalarData *scalar_data, const gboolean free)
gchar * gpiv_print_histo (FILE *fp, GpivBinData *bin_data, const gboolean free)
gchar * gpiv_print_cumhisto_eqdatbin (FILE *fp, GpivBinData *klass, const gboolean free)
GpivImagegpiv_read_raw_image (FILE *fp)
GpivImagegpiv_fread_raw_image (const gchar *fname)
gchar * gpiv_write_raw_image (FILE *fp, GpivImage *gpiv_image)
gchar * gpiv_fwrite_raw_image (const gchar *fname, GpivImage *gpiv_image)
GpivImagegpiv_read_png_image (FILE *fp)
gchar * gpiv_write_png_image (FILE *fp, GpivImage *gpiv_image, const gboolean free)
gchar * gpiv_fcreate_hdf5 (const gchar *fname)
gchar * gpiv_fread_hdf5_parameters (const gchar *fname, const gchar *par_key, void *pstruct)
GpivImagegpiv_fread_hdf5_image (const gchar *fname)
gchar * gpiv_fwrite_hdf5_image (const gchar *fname, GpivImage *image, const gboolean free)
gchar * gpiv_fwrite_hdf5_parameters (const gchar *fname, const gchar *par_key, void *pstruct)
GpivPivDatagpiv_fread_hdf5_pivdata (const gchar *fname, const gchar *DATA_KEY)
gchar * gpiv_fwrite_hdf5_pivdata (const gchar *fname, GpivPivData *piv_data, const gchar *DATA_KEY, const gboolean free)
GpivScalarDatagpiv_fread_hdf5_scdata (const gchar *fname, const gchar *DATA_KEY)
gchar * gpiv_fwrite_hdf5_scdata (const gchar *fname, GpivScalarData *scalar_data, const gchar *DATA_KEY, const gboolean free)
gchar * gpiv_fread_hdf5_histo (const gchar *fname, GpivBinData *klass, const gchar *DATA_KEY)
gchar * gpiv_fwrite_hdf5_histo (const gchar *fname, const GpivBinData *klass, const gchar *DATA_KEY)
GpivImagegpiv_read_davis_image (FILE *fp)

Variables

enum GpivDataFormat pdf


Detailed Description

module for input/output.

SOURCES: lib/io.c, lib/io_hdf.c lib/io_image.c lib/io_png.c lib/io_raw.c

LAST MODIFICATION DATE:

Id
io.h,v 1.17 2007-06-06 16:59:02 gerber Exp

Definition in file gpiv-io.h.


Define Documentation

#define GPIV_DAVIS_IMG_DEPTH   12

Depth of mages generated by LaVision's Davis (general: PCO cameras)

Definition at line 136 of file gpiv-io.h.

#define GPIV_EXT_COV   ".cov"

Extension of covariance data

Definition at line 118 of file gpiv-io.h.

#define GPIV_EXT_DAVIS   ".img"

DaVis image format

Definition at line 116 of file gpiv-io.h.

#define GPIV_EXT_DAVIS_UPCASE   ".IMG"

Uppercase DaVis image format

Definition at line 117 of file gpiv-io.h.

#define GPIV_EXT_ERR_PIV   ".err.piv"

Extension of erroneous-corrected piv file name

Definition at line 122 of file gpiv-io.h.

#define GPIV_EXT_ERR_STAT   ".stat"

Extension of residu statistics

Definition at line 123 of file gpiv-io.h.

#define GPIV_EXT_GPIV   ".gpi"

Extension of gpiv file name (HDF 5 format)

Definition at line 113 of file gpiv-io.h.

#define GPIV_EXT_GPIV_UPCASE   ".GPI"

Uppercase extension of gpiv file name (HDF 5 format)

Definition at line 114 of file gpiv-io.h.

#define GPIV_EXT_HEADER   ".h"

Extension of image header file name

Definition at line 100 of file gpiv-io.h.

#define GPIV_EXT_INT   ".int"

Extension of interrogation area

Definition at line 119 of file gpiv-io.h.

#define GPIV_EXT_MANI   ".ma.piv"

Extension of manipulated file name (ASCII format)

Definition at line 130 of file gpiv-io.h.

#define GPIV_EXT_NSTR   ".nstr"

Extension of normal strain file name (ASCII format)

Definition at line 128 of file gpiv-io.h.

#define GPIV_EXT_OLD   ".old.piv"

Extension of old displacements

Definition at line 120 of file gpiv-io.h.

#define GPIV_EXT_PAR   ".par"

Extension of file with used parameters

Definition at line 108 of file gpiv-io.h.

#define GPIV_EXT_PGM_IMAGE   ".pgm"

Extension of raw portable graymap (pgm) image file name

Definition at line 105 of file gpiv-io.h.

#define GPIV_EXT_PGM_IMAGE_UPCASE   ".PGM"

Uppercase extension of pgm

Definition at line 106 of file gpiv-io.h.

#define GPIV_EXT_PIV   ".piv"

Extension of piv file name (ASCII format)

Definition at line 115 of file gpiv-io.h.

#define GPIV_EXT_PLK   ".plk"

Extension of peaklocking output

Definition at line 124 of file gpiv-io.h.

#define GPIV_EXT_PNG_IMAGE   ".png"

Extension of png (Portable Network Graphics) formatted image file name

Definition at line 102 of file gpiv-io.h.

#define GPIV_EXT_PNG_IMAGE_PROC   "_proc.png"

Extension of processed png image file name

Definition at line 104 of file gpiv-io.h.

#define GPIV_EXT_PNG_IMAGE_UPCASE   ".PNG"

Uppercase extension of png

Definition at line 103 of file gpiv-io.h.

#define GPIV_EXT_RAW_IMAGE   ".r"

Extension of raw image file name

Definition at line 101 of file gpiv-io.h.

#define GPIV_EXT_RAW_IMAGE_PROC   "_proc.r"

Extension of processed raw binary image file name

Definition at line 107 of file gpiv-io.h.

#define GPIV_EXT_SA   ".sa.piv"

Extension of spatial averaged file name (ASCII format)

Definition at line 131 of file gpiv-io.h.

#define GPIV_EXT_SC   ".sc.piv"

Extension of scaled data file name (ASCII format)

Definition at line 132 of file gpiv-io.h.

#define GPIV_EXT_SSTR   ".sstr"

Extension of shear strain file name (ASCII format)

Definition at line 129 of file gpiv-io.h.

#define GPIV_EXT_SUBSTR   ".substr"

Extension of file name with substracted data

Definition at line 111 of file gpiv-io.h.

#define GPIV_EXT_TA   ".ta"

Extension of time averaged file name

Definition at line 110 of file gpiv-io.h.

#define GPIV_EXT_UVHISTO   ".pdf"

Extension of displacement histogram

Definition at line 125 of file gpiv-io.h.

#define GPIV_EXT_VOR   ".vor"

Extension of vorticity strain file name (ASCII format)

Definition at line 127 of file gpiv-io.h.

#define GPIV_IMG_PARAM_RESOURCES

As x_corr and depth are required to read properly the gpiv_image but may not necesarraly be present in the header for some image formats under specific situations, it is obtained from the parameter resources

Definition at line 137 of file gpiv-io.h.

#define GPIV_PIV_FMT   "%4.0f %4.0f %12.3f %12.3f %12.3f %2d\n"

Piv data Format

Definition at line 95 of file gpiv-io.h.

#define GPIV_PIV_S_FMT   "%-12.5f %-12.5f %-12.5f %-12.5f %-6.2f %-2d\n"

Piv scaled data Format

Definition at line 96 of file gpiv-io.h.

#define GPIV_SCALAR_FMT   "%4.0f %4.0f %12.3f %2d\n"

Scalar data Format with PIV data positions

Definition at line 97 of file gpiv-io.h.

#define GPIV_SCALAR_S_FMT   "%-12.3f %-12.3f %-12.3f %-2d\n"

Scalar data Format with PIV scaled data positions

Definition at line 98 of file gpiv-io.h.


Enumeration Type Documentation

enum GpivDataFormat

Enumerator:
GPIV_RR 
GPIV_DAV 

Definition at line 145 of file gpiv-io.h.


Function Documentation

gchar* gpiv_fcreate_hdf5 ( const gchar *  fname  ) 

Creates an hdf5 data file with POSITION, DATA and PARAMETERS groups.

Parameters:
[in] fname pointer to complete filename
Returns:
NULL on success or error message on failure

enum GpivDataFormat gpiv_find_pivdata_origin ( const gchar  line[GPIV_MAX_CHARS]  ) 

Determines the name of the program that generated the data.

Parameters:
[in] line character line containing program that generated data
Returns:
pdf enumerator of data origin

gchar* gpiv_fread_hdf5_histo ( const gchar *  fname,
GpivBinData klass,
const gchar *  DATA_KEY 
)

Reads histogram data to ouput file in hdf version 5 format.

Parameters:
[in] fname pointer to complete filename
[in] klass struct bin containing the values for each bin
[in] DATA_KEY identifier of data type (PEAK_LOCK, RESIDUS, ...)
Returns:
NULL on success or error message on failure

GpivImage* gpiv_fread_hdf5_image ( const gchar *  fname  ) 

Reads image data to a hdf5 data file.

Parameters:
[in] fname pointer to complete filename
Returns:
GpivImage on success or NULL on failure

gchar* gpiv_fread_hdf5_parameters ( const gchar *  fname,
const gchar *  par_key,
void *  pstruct 
)

Reads parameters from hdf5 data file.

Parameters:
[in] fname pointer to complete filename
[in] par_key key for apropiate parameter
[out] pstruct parameter structure
Returns:
NULL on success or error message on failure

GpivPivData* gpiv_fread_hdf5_pivdata ( const gchar *  fname,
const gchar *  DATA_KEY 
)

Reads piv data from hdf5 data file.

Parameters:
[in] fname pointer to complete filename
[in] DATA_KEY location of the data in the DATA group in the hdf file
Returns:
GpivPivData or NULL on failure

GpivScalarData* gpiv_fread_hdf5_scdata ( const gchar *  fname,
const gchar *  DATA_KEY 
)

Reads SCALAR data from a hdf5 data file.

Parameters:
[in] fname pointer to complete filename
[in] DATA_KEY key to specify data type/origin (NORMAL_STRAIN, ...)
Returns:
GpivScalarData or NULL on failure

GpivImage* gpiv_fread_image ( const gchar *  fname  ) 

Reads image from file fname.

Parameters:
[in] fname complete filename. This is used to pick the image format loader. Eventually checking the format signature is done in the loader itself
Returns:
GpivImage or NULL on failure

GpivPivData* gpiv_fread_pivdata ( const gchar *  fname  ) 

Reads PIV data from file fname.

Parameters:
[in] fname complete input filename.
Returns:
GpivPivData or NULL on failure

GpivImage* gpiv_fread_raw_image ( const gchar *  fname  ) 

Reads an image from raw binary file. Expects the arrray(s) have not been allocated yet. Reads image data from file.r, header from file.h Eventually, required header info will be read from (system) resources gpiv.conf or $HOME/.gpivrc.

Parameters:
[in] fname complete image filename (ending on .r)
Returns:
GpivImage on success or NULL on failure

GpivScalarData* gpiv_fread_scdata ( const gchar *  fname  ) 

Reads scalar data from file fname.

Parameters:
[in] fname complete input filename.
Returns:
GpivScalarData or NULL on failure

gchar* gpiv_fwrite_hdf5_histo ( const gchar *  fname,
const GpivBinData klass,
const gchar *  DATA_KEY 
)

Writes histogram data to ouput file in hdf version 5 format.

Parameters:
[in] fname pointer to complete filename
[in] klass struct bin containing the values for each bin
[in] DATA_KEY identifier of data type (PEAK_LOCK, RESIDUS, ...)
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_hdf5_image ( const gchar *  fname,
GpivImage image,
const gboolean  free 
)

Writes image data to file in hdf version 5 format.

Parameters:
[in] fname pointer to complete filename
[in] image image frkames and header
[in] free boolean whether to free memory of image arrays
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_hdf5_parameters ( const gchar *  fname,
const gchar *  par_key,
void *  pstruct 
)

Writes parameters to hdf5 data file.

Parameters:
[in] fname pointer to complete filename
[in] par_key key for apropiate parameter
[in] pstruct parameter structure
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_hdf5_pivdata ( const gchar *  fname,
GpivPivData piv_data,
const gchar *  DATA_KEY,
const gboolean  free 
)

Writes PIV data to file in hdf version 5 format.

Parameters:
[in] fname pointer to complete filename
[in] piv_data piv data containing all variables in a datafile
[in] DATA_KEY location of the data in the DATA group in the hdf file
[in] free boolean whether to free memory of PIV data
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_hdf5_scdata ( const gchar *  fname,
GpivScalarData scalar_data,
const gchar *  DATA_KEY,
const gboolean  free 
)

Writes SCALAR data to a file in hdf version 5 format.

Parameters:
[in] fname pointer to complete filename
[in] scalar_data struct GpivScalarData containing all variables in a datafile
[in] DATA_KEY identifier of data type
[in] free boolean whether to free memory of SCALAR data
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_pivdata ( const gchar *  fname,
GpivPivData piv_data,
const gboolean  free 
)

Writes PIV data to file fname in ASCII format.

Parameters:
[in] piv_data PIV data
[in] fname complete output filename.
[in] free flag if allocated memory if piv_data will be freed
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_raw_image ( const gchar *  fname,
GpivImage gpiv_image 
)

Writes raw binary image data to file.r and header to file.h.

Parameters:
[in] fname complete image filename (ending on .r)
[in] gpiv_image image frames and header info
Returns:
NULL on success or error message on failure

gchar* gpiv_fwrite_scdata ( const gchar *  fname,
GpivScalarData scalar_data,
const gboolean  free 
)

Writes scalar data to file fname in ASCII format.

Parameters:
[in] scalar_data scalar data
[in] fname complete output filename.
[in] free flag if allocated memory if piv_data will be freed
Returns:
NULL on success or error message on failure

void gpiv_io_make_fname ( const gchar *  fname_base,
const gchar *  EXT,
gchar *  fname_out 
)

Constructs (output) filename from base name and extension.

Parameters:
[in] fname_base file base name
[in] EXT file extension name
[out] fname_out completed filename
Returns:
void

gchar* gpiv_print_cumhisto_eqdatbin ( FILE *  fp,
GpivBinData klass,
const gboolean  free 
)

Writing cumulative histogram data with an equal number of date per bin or klass to fp. Special output for validation; work around to print float data as y-values.

Parameters:
[in] fp output file
[in] klass struct GpivBinData containing the values for each bin
[in] free flag if allocated memory if scalar_data will be freed
Returns:
NULL on success or error message on failure

gchar* gpiv_print_histo ( FILE *  fp,
GpivBinData bin_data,
const gboolean  free 
)

Writes bins data to file in histogram format.

Parameters:
[in] fp output file. If NULL, stdout is used.
[in] bin_data data containing the values for each bin
[in] free flag if allocated memory if scalar_data will be freed
Returns:
NULL on success or error message on failure

GpivImage* gpiv_read_davis_image ( FILE *  fp  ) 

Reads Davis formatted image, with ext .IMG from file.

Parameters:
[in] fp pointer to input file
Returns:
GpivImage on success or NULL on failure

GpivImage* gpiv_read_image ( FILE *  fp  ) 

Reads image from fp. Image will have to be png formatted.

Parameters:
[in] fp file pointer. If NULL, stdin will be used.
Returns:
pointer to GpivImage

GpivPivData* gpiv_read_pivdata ( FILE *  fp  ) 

Reads PIV data from fp.

Parameters:
[in] fp input file. If NULL, stdin is used.
Returns:
GpivPivData

GpivPivData* gpiv_read_pivdata_fastx ( FILE *  fp  ) 

Reads PIV data from fp with fast running x-position variables. (1st column in data stream)

Parameters:
[in] fp input file. If NULL, stdin is used.
Returns:
GpivPivData

GpivImage* gpiv_read_png_image ( FILE *  fp  ) 

Reads png formatted image.

Parameters:
[in] fp file pointer
Returns:
pointer to GpivImage

GpivImage* gpiv_read_raw_image ( FILE *  fp  ) 

Reads an image from raw binary file. Expects the arrray (s) have not been allocated yet. Eventually, required header info will be read from (system) resources gpiv.conf or $HOME/.gpivrc.

Parameters:
[in] fp input file. If NULL, stdin will be used
Returns:
GpivImage on success or NULL on failure

GpivScalarData* gpiv_read_scdata ( FILE *  fp  ) 

Reads scalar data form ascii file.

Parameters:
[in] fp input file. If NULL, stin is used.
Returns:
GpivScalarData or NULL on failure

gchar* gpiv_write_pivdata ( FILE *  fp,
GpivPivData piv_data,
const gboolean  free 
)

Writes PIV data to fp in ASCII format.

Parameters:
[in] piv_data PIV data
[in] fp output file. If NULL, stout is used.
[in] free flag if allocated memory if piv_data will be freed
Returns:
NULL on success or error message on failure

gchar* gpiv_write_png_image ( FILE *  fp,
GpivImage gpiv_image,
const gboolean  free 
)

Writes image data and header to png formatted image. Optionally frees allocated memory.

Parameters:
[in] fp output file.
[in] gpiv_image image header and data
[in] free boolean whether to free memory of image arrays
Returns:
NULL on success or error message on failure

gchar* gpiv_write_raw_image ( FILE *  fp,
GpivImage gpiv_image 
)

Writes raw binary image frames to fp.

Parameters:
[in] fp output file. If NULL, stdout will be used
[in] gpiv_image image frames and header
Returns:
NULL on success or error message on failure

gchar* gpiv_write_sc_griddata ( FILE *  fp,
GpivScalarData scalar_data,
const gboolean  free 
)

Writes scalar data to file in grid format for gnuplot.

Parameters:
[in] fp output file. If NULL, stdout is used.
[in] scalar_data scalar data containing all variables in a datafile
[in] free flag if allocated memory if scalar_data will be freed
Returns:
NULL on success or error message on failure

gchar* gpiv_write_sc_mtvgriddata ( FILE *  fp,
GpivScalarData scalar_data,
const gboolean  free 
)

Writes scalar data to file in grid format for plotmtv.

Parameters:
[in] fp output file. If NULL, stdout is used.
[in] scalar_data scalar data containing all variables in a datafile
[in] free flag if allocated memory if scalar_data will be freed
Returns:
NULL on success or error message on failure

gchar* gpiv_write_scdata ( FILE *  fp,
GpivScalarData scalar_data,
const gboolean  free 
)

Writes scalar data to file.

Parameters:
[in] fp output file. If NULL, stout is used.
[in] scalar_data scalar data containing all variables in a datafile
[in] free flag if allocated memory if scalar_data will be freed
Returns:
NULL on success or error message on failure


Variable Documentation

enum GpivDataFormat pdf


Generated on Tue Nov 20 19:46:20 2007 for Libgpiv by doxygen 1.5.1