// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1992 - 2015 // ** University Corporation for Atmospheric Research(UCAR) // ** National Center for Atmospheric Research(NCAR) // ** Research Applications Laboratory(RAL) // ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA // ** See LICENCE.TXT if applicable for licence details // ** 2015/05/29 22:31:26 UTC // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* //////////////////////////////////////////// // ParamsSetUV.cc // // TDRP C++ code file for class 'ParamsSetUV'. // // This file has been automatically // generated by TDRP, do not modify. // ///////////////////////////////////////////// /** * * @file Params.cc * * @class Params * * This class is automatically generated by the Table * Driven Runtime Parameters (TDRP) system * * @note Source is automatically generated from * paramdef file at compile time, do not modify * since modifications will be overwritten. * * * @author Automatically generated * */ using namespace std; #include "ParamsSetUV.hh" #include <cstring> //////////////////////////////////////////// // Default constructor // ParamsSetUV::ParamsSetUV() { // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // class name _className = "ParamsSetUV"; // initialize table _init(); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Copy constructor // ParamsSetUV::ParamsSetUV(const ParamsSetUV& source) { // sync the source object source.sync(); // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // class name _className = "ParamsSetUV"; // copy table tdrpCopyTable((TDRPtable *) source._table, _table); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Destructor // ParamsSetUV::~ParamsSetUV() { // free up freeAll(); } //////////////////////////////////////////// // Assignment // void ParamsSetUV::operator=(const ParamsSetUV& other) { // sync the other object other.sync(); // free up any existing memory freeAll(); // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // copy table tdrpCopyTable((TDRPtable *) other._table, _table); // set members tdrpTable2User(_table, &_start_); _exitDeferred = other._exitDeferred; } //////////////////////////////////////////// // loadFromArgs() // // Loads up TDRP using the command line args. // // Check usage() for command line actions associated with // this function. // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // char **params_path_p: // If this is non-NULL, it is set to point to the path // of the params file used. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int ParamsSetUV::loadFromArgs(int argc, char **argv, char **override_list, char **params_path_p, bool defer_exit) { int exit_deferred; if (_tdrpLoadFromArgs(argc, argv, _table, &_start_, override_list, params_path_p, _className, defer_exit, &exit_deferred)) { return (-1); } else { if (exit_deferred) { _exitDeferred = true; } return (0); } } //////////////////////////////////////////// // loadApplyArgs() // // Loads up TDRP using the params path passed in, and applies // the command line args for printing and checking. // // Check usage() for command line actions associated with // this function. // // const char *param_file_path: the parameter file to be read in // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int ParamsSetUV::loadApplyArgs(const char *params_path, int argc, char **argv, char **override_list, bool defer_exit) { int exit_deferred; if (tdrpLoadApplyArgs(params_path, argc, argv, _table, &_start_, override_list, _className, defer_exit, &exit_deferred)) { return (-1); } else { if (exit_deferred) { _exitDeferred = true; } return (0); } } //////////////////////////////////////////// // isArgValid() // // Check if a command line arg is a valid TDRP arg. // bool ParamsSetUV::isArgValid(const char *arg) { return (tdrpIsArgValid(arg)); } //////////////////////////////////////////// // load() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to load // up more than one class for a single application. It is a // lower-level routine than loadFromArgs, and hence more // flexible, but the programmer must do more work. // // const char *param_file_path: the parameter file to be read in. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int ParamsSetUV::load(const char *param_file_path, char **override_list, int expand_env, int debug) { if (tdrpLoad(param_file_path, _table, &_start_, override_list, expand_env, debug)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // loadFromBuf() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to // load up more than one module for a single application, // using buffers which have been read from a specified source. // // const char *param_source_str: a string which describes the // source of the parameter information. It is used for // error reporting only. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // const char *inbuf: the input buffer // // int inlen: length of the input buffer // // int start_line_num: the line number in the source which // corresponds to the start of the buffer. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int ParamsSetUV::loadFromBuf(const char *param_source_str, char **override_list, const char *inbuf, int inlen, int start_line_num, int expand_env, int debug) { if (tdrpLoadFromBuf(param_source_str, _table, &_start_, override_list, inbuf, inlen, start_line_num, expand_env, debug)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // loadDefaults() // // Loads up default params for a given class. // // See load() for more detailed info. // // Returns 0 on success, -1 on failure. // int ParamsSetUV::loadDefaults(int expand_env) { if (tdrpLoad(NULL, _table, &_start_, NULL, expand_env, FALSE)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // sync() // // Syncs the user struct data back into the parameter table, // in preparation for printing. // // This function alters the table in a consistent manner. // Therefore it can be regarded as const. // void ParamsSetUV::sync(void) const { tdrpUser2Table(_table, (char *) &_start_); } //////////////////////////////////////////// // print() // // Print params file // // The modes supported are: // // PRINT_SHORT: main comments only, no help or descriptions // structs and arrays on a single line // PRINT_NORM: short + descriptions and help // PRINT_LONG: norm + arrays and structs expanded // PRINT_VERBOSE: long + private params included // void ParamsSetUV::print(FILE *out, tdrp_print_mode_t mode) { tdrpPrint(out, _table, _className, mode); } //////////////////////////////////////////// // checkAllSet() // // Return TRUE if all set, FALSE if not. // // If out is non-NULL, prints out warning messages for those // parameters which are not set. // int ParamsSetUV::checkAllSet(FILE *out) { return (tdrpCheckAllSet(out, _table, &_start_)); } ////////////////////////////////////////////////////////////// // checkIsSet() // // Return TRUE if parameter is set, FALSE if not. // // int ParamsSetUV::checkIsSet(const char *paramName) { return (tdrpCheckIsSet(paramName, _table, &_start_)); } //////////////////////////////////////////// // freeAll() // // Frees up all TDRP dynamic memory. // void ParamsSetUV::freeAll(void) { tdrpFreeAll(_table, &_start_); } //////////////////////////////////////////// // usage() // // Prints out usage message for TDRP args as passed // in to loadFromArgs(). // void ParamsSetUV::usage(ostream &out) { out << "TDRP args: [options as below]\n" << " [ -params/--params path ] specify params file path\n" << " [ -check_params] check which params are not set\n" << " [ -print_params [mode]] print parameters\n" << " using following modes, default mode is 'norm'\n" << " short: main comments only, no help or descr\n" << " structs and arrays on a single line\n" << " norm: short + descriptions and help\n" << " long: norm + arrays and structs expanded\n" << " verbose: long + private params included\n" << " short_expand: short with env vars expanded\n" << " norm_expand: norm with env vars expanded\n" << " long_expand: long with env vars expanded\n" << " verbose_expand: verbose with env vars expanded\n" << " [ -tdrp_debug] debugging prints for tdrp\n" << " [ -tdrp_usage] print this usage\n"; } //////////////////////////////////////////// // arrayRealloc() // // Realloc 1D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int ParamsSetUV::arrayRealloc(const char *param_name, int new_array_n) { if (tdrpArrayRealloc(_table, &_start_, param_name, new_array_n)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // array2DRealloc() // // Realloc 2D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int ParamsSetUV::array2DRealloc(const char *param_name, int new_array_n1, int new_array_n2) { if (tdrpArray2DRealloc(_table, &_start_, param_name, new_array_n1, new_array_n2)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // _init() // // Class table initialization function. // // void ParamsSetUV::_init() { TDRPtable *tt = _table; // Parameter 'Comment 0' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 0"); tt->comment_hdr = tdrpStrDup("SetUV Params"); tt->comment_text = tdrpStrDup("--Params that are used to set phase correction vectors using the Ncar phase correction algorithm "); tt++; // Parameter 'data' // ctype is '_data_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRUCT_TYPE; tt->param_name = tdrpStrDup("data"); tt->descr = tdrpStrDup("data. any number of data sources are used"); tt->help = tdrpStrDup(""); tt->array_offset = (char *) &_data - &_start_; tt->array_n_offset = (char *) &data_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(data_t); tt->array_n = 1; tt->struct_def.name = tdrpStrDup("data_t"); tt->struct_def.nfields = 5; tt->struct_def.fields = (struct_field_t *) tdrpMalloc(tt->struct_def.nfields * sizeof(struct_field_t)); tt->struct_def.fields[0].ftype = tdrpStrDup("string"); tt->struct_def.fields[0].fname = tdrpStrDup("name"); tt->struct_def.fields[0].ptype = STRING_TYPE; tt->struct_def.fields[0].rel_offset = (char *) &_data->name - (char *) _data; tt->struct_def.fields[1].ftype = tdrpStrDup("double"); tt->struct_def.fields[1].fname = tdrpStrDup("threshold"); tt->struct_def.fields[1].ptype = DOUBLE_TYPE; tt->struct_def.fields[1].rel_offset = (char *) &_data->threshold - (char *) _data; tt->struct_def.fields[2].ftype = tdrpStrDup("double"); tt->struct_def.fields[2].fname = tdrpStrDup("fractional_area_data_threshold"); tt->struct_def.fields[2].ptype = DOUBLE_TYPE; tt->struct_def.fields[2].rel_offset = (char *) &_data->fractional_area_data_threshold - (char *) _data; tt->struct_def.fields[3].ftype = tdrpStrDup("double"); tt->struct_def.fields[3].fname = tdrpStrDup("alpha"); tt->struct_def.fields[3].ptype = DOUBLE_TYPE; tt->struct_def.fields[3].rel_offset = (char *) &_data->alpha - (char *) _data; tt->struct_def.fields[4].ftype = tdrpStrDup("double"); tt->struct_def.fields[4].fname = tdrpStrDup("variance"); tt->struct_def.fields[4].ptype = DOUBLE_TYPE; tt->struct_def.fields[4].rel_offset = (char *) &_data->variance - (char *) _data; tt->n_struct_vals = 5; tt->struct_vals = (tdrpVal_t *) tdrpMalloc(tt->n_struct_vals * sizeof(tdrpVal_t)); tt->struct_vals[0].s = tdrpStrDup("not_set"); tt->struct_vals[1].d = 0; tt->struct_vals[2].d = 0; tt->struct_vals[3].d = 0; tt->struct_vals[4].d = 0; tt++; // Parameter 'Comment 1' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 1"); tt->comment_hdr = tdrpStrDup("Alg Description"); tt->comment_text = tdrpStrDup("Given a forecast F and a verifying field V we do this:\n1. Smooth F by taking average in a box\n the box is forecast_input_smooth points on a side\n1. Smooth V by taking average in a box\n the box is verif_input_smooth points on a side\n2. Convert F and V to low res from high res\n there are low_res_ngridpts high res points per lowres point\n3. Compute p.c. shift (all params are in units of low res number of\n gridpoints unless otherwise indicated)\n a. compute p.c. in each volume box\n volume boxes are volume_size[] and overlap by volume_overlap[]\n\n offsets in x and y are:\n -max_phase_shift*phase_shift_res_npt,\n (-max_phase_shift+1)*phase_shift_res_npt,\n ...\n +max_phase_shift*phase_shift_res_npt\n\n i. test phase correction for each offset x,y\n compute a score for this shift using ALL point in box\n ii. get best such score\n iii. for all phase shifts where score was <= good_scaling*best\n refine the score:\n look at shifts near this one and choose if better\n refinement offsets in x and y are:\n -refine_max_phase_shift*refine_phase_shift_res_npt,\n (-refine_max_phase_shift+1)*refine_phase_shift_res_npt,\n ...\n +refine_max_phase_shift*refine_phase_shift_res_npt\n\n iv. find smallest shift with a good score=\n 'good_score' means score <= good_dist_scaling*best\n b. Merge scores from all boxes taking average within overlap\n c. Smooth these motion vectors\n smooth using low_res_motion_smooth for each in order\n c. interpolate back to full grid using bilinear interpolation\n d. smooth the high res motion vectors\n smooth using high_res_motion_smooth for each in order\n4. Use motion to shift the non-smoothed original forecast\n5. Fill gaps in the shifted forecast by smoothing\n param = high_res_gap_fill\n6. Smooth the resulting forecast\n smooth using high_res_output_fcst_smooth for each in order\n"); tt++; // Parameter 'forecast_input_smooth' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("forecast_input_smooth"); tt->descr = tdrpStrDup("smoothing of input fcst"); tt->help = tdrpStrDup("smoothing distance (high res number of gridpoints) for input forecast"); tt->val_offset = (char *) &forecast_input_smooth - &_start_; tt->single_val.i = 9; tt++; // Parameter 'verif_input_smooth' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("verif_input_smooth"); tt->descr = tdrpStrDup("smoothing of input verif"); tt->help = tdrpStrDup("smoothing distance (high res number of gridpoints) for input verification grid"); tt->val_offset = (char *) &verif_input_smooth - &_start_; tt->single_val.i = 9; tt++; // Parameter 'low_res_ngridpts' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("low_res_ngridpts"); tt->descr = tdrpStrDup("low res (ngridpoints)"); tt->help = tdrpStrDup("the number of gridpoints per low resolution gridpoint"); tt->val_offset = (char *) &low_res_ngridpts - &_start_; tt->single_val.i = 1; tt++; // Parameter 'volume_size' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("volume_size"); tt->descr = tdrpStrDup("volume size (low res ngridpoints)"); tt->help = tdrpStrDup("boxes (volumes) are evaluated individually. This is the x,y box length (low res number of gridpoints)"); tt->array_offset = (char *) &_volume_size - &_start_; tt->array_n_offset = (char *) &volume_size_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = TRUE; tt->array_elem_size = sizeof(int); tt->array_n = 2; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].i = 300; tt->array_vals[1].i = 300; tt++; // Parameter 'volume_overlap' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("volume_overlap"); tt->descr = tdrpStrDup("volume overlap (low res ngridpoints)"); tt->help = tdrpStrDup("overlap in volumes x and y (low res number of gridpoints)"); tt->array_offset = (char *) &_volume_overlap - &_start_; tt->array_n_offset = (char *) &volume_overlap_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = TRUE; tt->array_elem_size = sizeof(int); tt->array_n = 2; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].i = 150; tt->array_vals[1].i = 150; tt++; // Parameter 'phase_shift_res_npt' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("phase_shift_res_npt"); tt->descr = tdrpStrDup("phase shift resolution"); tt->help = tdrpStrDup("Resolution of phase shift tests (units=low res number of gridpoints)"); tt->val_offset = (char *) &phase_shift_res_npt - &_start_; tt->single_val.i = 60; tt++; // Parameter 'max_phase_shift' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("max_phase_shift"); tt->descr = tdrpStrDup("max phase shift npt"); tt->help = tdrpStrDup("phase shifts are done at 0 up to +/- max_phase_shift*phase_shift_res_npt, in increments of phase_shift_res_npt"); tt->val_offset = (char *) &max_phase_shift - &_start_; tt->single_val.i = 240; tt++; // Parameter 'refine_phase_shift_res_npt' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("refine_phase_shift_res_npt"); tt->descr = tdrpStrDup("phase shift resolution (refinement)"); tt->help = tdrpStrDup("Resolution of phase shift tests (units=low res number of gridpoints) during refinement phase"); tt->val_offset = (char *) &refine_phase_shift_res_npt - &_start_; tt->single_val.i = 60; tt++; // Parameter 'refine_max_phase_shift' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("refine_max_phase_shift"); tt->descr = tdrpStrDup("max phase shift npt (refinement)"); tt->help = tdrpStrDup("phase shifts are done at 0 up to +/- refine_max_phase_shift*refine_phase_shift_res_npt, in increments of refine_phase_shift_res_npt"); tt->val_offset = (char *) &refine_max_phase_shift - &_start_; tt->single_val.i = 240; tt++; // Parameter 'low_res_motion_smooth' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("low_res_motion_smooth"); tt->descr = tdrpStrDup("low res motion smoothing"); tt->help = tdrpStrDup("low resolution motion is smoothed some number of times at these npt values"); tt->array_offset = (char *) &_low_res_motion_smooth - &_start_; tt->array_n_offset = (char *) &low_res_motion_smooth_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(int); tt->array_n = 3; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].i = 45; tt->array_vals[1].i = 45; tt->array_vals[2].i = 45; tt++; // Parameter 'high_res_motion_smooth' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("high_res_motion_smooth"); tt->descr = tdrpStrDup("high res motion smoothing"); tt->help = tdrpStrDup("high resolution motion is smoothed some number of times at these npt values"); tt->array_offset = (char *) &_high_res_motion_smooth - &_start_; tt->array_n_offset = (char *) &high_res_motion_smooth_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(int); tt->array_n = 3; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].i = 9; tt->array_vals[1].i = 9; tt->array_vals[2].i = 9; tt++; // Parameter 'high_res_gap_fill' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("high_res_gap_fill"); tt->descr = tdrpStrDup("high res gap filling"); tt->help = tdrpStrDup("high resolution forecasts gaps filled by smoothing (npt)"); tt->val_offset = (char *) &high_res_gap_fill - &_start_; tt->single_val.i = 9; tt++; // Parameter 'high_res_output_fcst_smooth' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("high_res_output_fcst_smooth"); tt->descr = tdrpStrDup("high res output forecast smoothing"); tt->help = tdrpStrDup("high resolution forecasts smoothed (npt)"); tt->array_offset = (char *) &_high_res_output_fcst_smooth - &_start_; tt->array_n_offset = (char *) &high_res_output_fcst_smooth_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(int); tt->array_n = 1; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].i = 9; tt++; // Parameter 'exclude_zero_from_smoothing' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("exclude_zero_from_smoothing"); tt->descr = tdrpStrDup("exclude_zero_from_smoothing"); tt->help = tdrpStrDup("TRUE to not include values of 0 in smoothing, instead they are treated like missing data, FALSE to include 0 in the smoothing. Setting this to TRUE will cause boxlike UV fields that are the size of the volumes"); tt->val_offset = (char *) &exclude_zero_from_smoothing - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'high_res_max_expand_npt' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("high_res_max_expand_npt"); tt->descr = tdrpStrDup("high res max filter expansion"); tt->help = tdrpStrDup("after smoothing, at each point the U/V value at the point is set to the point within high_res_max_expand_npt of the point at which |U,V| is max. If set to 0, no such max filter"); tt->val_offset = (char *) &high_res_max_expand_npt - &_start_; tt->single_val.i = 0; tt++; // Parameter 'good_scaling' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("good_scaling"); tt->descr = tdrpStrDup("good scale"); tt->help = tdrpStrDup("When computing refinements, a point is refined if score is good enough if score <= good_scaling*best_score"); tt->val_offset = (char *) &good_scaling - &_start_; tt->single_val.d = 2; tt++; // Parameter 'good_dist_scaling' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("good_dist_scaling"); tt->descr = tdrpStrDup("good distance scale"); tt->help = tdrpStrDup("When minimizing phase correction distance, score is good enough if score <= good_dist_scaling*best_score"); tt->val_offset = (char *) &good_dist_scaling - &_start_; tt->single_val.d = 2; tt++; // Parameter 'fuzzy_grid_distance' // ctype is '_fuzzy_f' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRUCT_TYPE; tt->param_name = tdrpStrDup("fuzzy_grid_distance"); tt->descr = tdrpStrDup("fuzzy function for grid edge computation"); tt->help = tdrpStrDup("function that becomes small when you are close to the grid edge"); tt->array_offset = (char *) &_fuzzy_grid_distance - &_start_; tt->array_n_offset = (char *) &fuzzy_grid_distance_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(fuzzy_f); tt->array_n = 1; tt->struct_def.name = tdrpStrDup("fuzzy_f"); tt->struct_def.nfields = 2; tt->struct_def.fields = (struct_field_t *) tdrpMalloc(tt->struct_def.nfields * sizeof(struct_field_t)); tt->struct_def.fields[0].ftype = tdrpStrDup("double"); tt->struct_def.fields[0].fname = tdrpStrDup("distance"); tt->struct_def.fields[0].ptype = DOUBLE_TYPE; tt->struct_def.fields[0].rel_offset = (char *) &_fuzzy_grid_distance->distance - (char *) _fuzzy_grid_distance; tt->struct_def.fields[1].ftype = tdrpStrDup("double"); tt->struct_def.fields[1].fname = tdrpStrDup("value"); tt->struct_def.fields[1].ptype = DOUBLE_TYPE; tt->struct_def.fields[1].rel_offset = (char *) &_fuzzy_grid_distance->value - (char *) _fuzzy_grid_distance; tt->n_struct_vals = 2; tt->struct_vals = (tdrpVal_t *) tdrpMalloc(tt->n_struct_vals * sizeof(tdrpVal_t)); tt->struct_vals[0].d = 0; tt->struct_vals[1].d = 0; tt++; // Parameter 'fractional_area_min_pcnt' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("fractional_area_min_pcnt"); tt->descr = tdrpStrDup("fractional area min percent"); tt->help = tdrpStrDup("do not do phase correction in boxes where (npt>thresh)/npt is less than this percentage."); tt->val_offset = (char *) &fractional_area_min_pcnt - &_start_; tt->single_val.d = 0.15; tt++; // Parameter 'grid_area_min_pcnt' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("grid_area_min_pcnt"); tt->descr = tdrpStrDup("grid area min percent"); tt->help = tdrpStrDup("do not do phase correction if the grids (verifying and forecast) do not both have (npt>thresh)/npt >= grid_area_min_pcnt"); tt->val_offset = (char *) &grid_area_min_pcnt - &_start_; tt->single_val.d = 0.01; tt++; // trailing entry has param_name set to NULL tt->param_name = NULL; return; }