/usr/include/gpiv/gpiv-valid_par.h is in libgpiv3-dev 0.6.1-3build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
/*
libgpiv - library for Particle Image Velocimetry
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Gerber van der Graaf
This file is part of libgpiv.
Libgpiv is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-------------------------------------------------------------------------------
FILENAME: gpiv-valid_par.h
LIBRARY: libgpiv
EXTERNAL FUNCTIONS:
SOURCE: valid_par.c
gpiv_valid_parameters_set
gpiv_valid_default_parameters
gpiv_valid_get_parameters_from_resources
gpiv_valid_read_parameters
gpiv_valid_check_parameters_read
gpiv_valid_testonly_parameters
gpiv_valid_testadjust_parameters
gpiv_valid_print_parameters
gpiv_valid_fread_hdf5_parameters
gpiv_valid_fwrite_hdf5_parameters
gpiv_valid_mpi_bcast_validpar
--------------------------------------------------------------------------- */
/*!
\file gpiv-valid_par.h
\brief module for parameters for validating PIV data
SOURCES: lib/valid_par.c
LAST MODIFICATION DATE: $Id: gpiv-valid_par.h,v 1.3 2008-09-25 13:19:53 gerber Exp $
*/
#ifndef __LIBGPIV_VALIDPAR_H__
#define __LIBGPIV_VALIDPAR_H__
#define GPIV_VALIDPAR_KEY "VALID" /**< Key of validation processing parameters */
#define GPIV_VALIDPAR_MAX__NEIGHBORS 9 /**< Maximum numbers of adjacent neighbours for validation testing and and calculation of substitution */
/**
* Type of residu to detect outliers
*/
enum ResiduType {
GPIV_VALID_RESIDUTYPE__SNR, /**< Signal to noise ratio */
GPIV_VALID_RESIDUTYPE__MEDIAN, /**< median value of NxN surrounding estimators */
GPIV_VALID_RESIDUTYPE__NORMMEDIAN /**< normalized median, obtained from the ratio
between datapoint under investigation and
median velocity (from 3x3 array, excluding
current point) and median residu.
Ref. Westerweel, Scarano, Exp. in Fluids,
39 (2005), pp1096-1100. */
};
/**
* Erroneous vector substituted by type
*/
enum SubstitutionType {
GPIV_VALID_SUBSTYPE__NONE, /**< no value, point will be disabled by setting __GpivPivData peak_nr to -1 */
GPIV_VALID_SUBSTYPE__L_MEAN, /**< substitute by local mean value */
GPIV_VALID_SUBSTYPE__MEDIAN, /**< substitute by median value from surroundings */
GPIV_VALID_SUBSTYPE__COR_PEAK /**< use location of next highest correlation peak as estimator */
};
typedef struct __GpivValidPar GpivValidPar;
/*!
* \brief Piv validation parameters
*
* The parameters might be loaded from the configuration resources,
* with gpiv_scan_resourcefiles() or with gpiv_scan_parameter().
*/
struct __GpivValidPar {
gfloat data_yield; /**< data yield ( from particle image concentration,
out-of plane flow, velocity gradient within interrogation area.
ref: Keane and Adrian 1992) */
gfloat residu_max; /**< maximum residu value */
guint neighbors; /**< number of neighbouring estimators */
enum ResiduType residu_type; /**< use residu type */
enum SubstitutionType subst_type; /**< use substitution type */
gint histo_type; /**< use histogram type */
gboolean data_yield__set; /**< flag if data_yield has been defined */
gboolean residu_max__set; /**< flag if residu_max has been defined */
gboolean neighbors__set; /**< flag if neighbors has been defined */
gboolean residu_type__set; /**< flag if residu_type has been defined */
gboolean subst_type__set; /**< flag if subst_type has been defined */
gboolean histo_type__set; /**< flag if histo_type has been defined */
};
/**
* Defines value of __set members of PivValidPar.
*
* @param[in] valid_par validation parameters
* @param[in] flag boolean to define __set value
* @param[out] valid_par struct of validation parameters
* @return void
*/
void
gpiv_valid_parameters_set (GpivValidPar *valid_par,
const gboolean flag
);
/**
* Sets parameters to default values.
*
* @param[in] force flag to enforce parameters set to defaults
* @param[out] valid_par_default struct of validation parameters
* @return void
*/
void
gpiv_valid_default_parameters (GpivValidPar *valid_par_default,
const gboolean force
);
/**
* Reads validation parameters from system-wide gpiv.conf and $HOME/.gpivrc.
*
* @param[in] localrc resource filename containing parameter at
current directory
* @param[in] verbose prints parameter values when read
* @return GpivValidPar or NULL on failure
*/
GpivValidPar *
gpiv_valid_get_parameters_from_resources(const gchar *localrc,
const gboolean verbose
);
/**
* Reads validation parameters from file.
*
* @param[in] fp_par file pointer to file to be read.
* If NULL, stdin will be used.
* @param[in] print_par boolean to print parameters to stdout
* @param[out] valid_par validation parameters
* @return void
*/
void
gpiv_valid_read_parameters (FILE *fp_par,
GpivValidPar *valid_par,
const gboolean print_par
);
/**
* Checks out if all parameters have been read.
* If a parameter has not been read, it will be set to valid_par_default or to
* its hard-coded default value in case valid_par_default is NULL.
*
* @param[in] valid_par_default default validation parameters. If NULL,
* library default values are used.
* @param[in] valid_par validation parameters
* @param[out] valid_par validation parameters
* @return NULL on success or error message on failure
*/
gchar *
gpiv_valid_check_parameters_read (GpivValidPar *valid_par,
const GpivValidPar *valid_par_default
);
/**
* Tests if all validation parameters have been read and have been defined
* to valid values.
*
* @param[in] valid_par validation parameters
* @return NULL on success or error message on failure
*/
gchar *
gpiv_valid_testonly_parameters (const GpivValidPar *valid_par
);
/**
* Tests if all validation parameters have been read and have been defined
* to valid values. Aplies missing parameters to defaults, as hard-coded
* in the library and adjusts parameters if necessary.
*
* @param[in] valid_par validation parameters
* @return NULL on success or error message on failure
*/
gchar *
gpiv_valid_testadjust_parameters (GpivValidPar *valid_par
);
/**
* Prints all validation parameters in ASCII format to fp.
*
* @param[in] fp file pointer to printed file.
* If NULL, fp points to stdout.
* @param[in] valid_par validation parameters
* @return void
*/
void
gpiv_valid_print_parameters (FILE *fp,
const GpivValidPar *valid_par
);
/**
* Copies validation parameters.
*
* @param[in] valid_par validation parameters to be copied
* @return GpivValidPar * or NULL on failure
*/
GpivValidPar *
gpiv_valid_cp_parameters (const GpivValidPar *valid_par
);
/**
* Duplicates validation parameters from valid_par_src to
* valid_par_dest if valid_par_dest have not been set.
*
* @param[in] valid_par_src source validation parameters to be copied
* @param[out] valid_par_dest the copied validation parameters
* @return void
*/
void
gpiv_valid_dupl_parameters (const GpivValidPar *valid_par_src,
GpivValidPar *valid_par_dest
);
/**
* Reads validation parameters from hdf5 data file.
*
* @param[in] fname file name of data file
* @return GpivValidPar or NULL on failure
*/
GpivValidPar *
gpiv_valid_fread_hdf5_parameters (const gchar *fname
);
/**
* Writes validation parameters to an existing hdf5 data file.
*
* @param[in] fname file name of data file
* @param[in] valid_par struct of validation parameters
* @return NULL on success or error message on failure
*/
gchar *
gpiv_valid_fwrite_hdf5_parameters (const gchar *fname,
const GpivValidPar *valid_par
);
#ifdef ENABLE_MPI
/**
* Broadcasts valid_par for MPI using MPI_Bcast()
*
* @param[in] valid_par struct of validation parameters to be broadcasted
* @return void
*/
void
gpiv_valid_mpi_bcast_validpar (GpivValidPar *valid_par
);
#endif /* ENABLE_MPI */
#endif /* __LIBGPIV_VALIDPAR_H__ */
|