//////////////////////////////////////////// // KdpFiltParams.cc // // TDRP C++ code file for class 'KdpFiltParams'. // // This file has been automatically // generated by TDRP, do not modify. // ///////////////////////////////////////////// /** * * @file KdpFiltParams.cc * * @class KdpFiltParams * * 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 * */ #include #include //////////////////////////////////////////// // Default constructor // KdpFiltParams::KdpFiltParams() { // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // class name _className = "KdpFiltParams"; // initialize table _init(); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Copy constructor // KdpFiltParams::KdpFiltParams(const KdpFiltParams& 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 = "KdpFiltParams"; // copy table tdrpCopyTable((TDRPtable *) source._table, _table); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Destructor // KdpFiltParams::~KdpFiltParams() { // free up freeAll(); } //////////////////////////////////////////// // Assignment // void KdpFiltParams::operator=(const KdpFiltParams& 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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::isArgValid(const char *arg) { return (tdrpIsArgValid(arg)); } //////////////////////////////////////////// // isArgValid() // // Check if a command line arg is a valid TDRP arg. // return number of args consumed. // int KdpFiltParams::isArgValidN(const char *arg) { return (tdrpIsArgValidN(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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::checkAllSet(FILE *out) { return (tdrpCheckAllSet(out, _table, &_start_)); } ////////////////////////////////////////////////////////////// // checkIsSet() // // Return TRUE if parameter is set, FALSE if not. // // int KdpFiltParams::checkIsSet(const char *paramName) { return (tdrpCheckIsSet(paramName, _table, &_start_)); } //////////////////////////////////////////// // freeAll() // // Frees up all TDRP dynamic memory. // void KdpFiltParams::freeAll(void) { tdrpFreeAll(_table, &_start_); } //////////////////////////////////////////// // usage() // // Prints out usage message for TDRP args as passed // in to loadFromArgs(). // void KdpFiltParams::usage(ostream &out) { out << "TDRP args: [options as below]\n" << " [ -params/--params path ] specify params file path\n" << " [ -check_params/--check_params] check which params are not set\n" << " [ -print_params/--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 KdpFiltParams::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 KdpFiltParams::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 KdpFiltParams::_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("KdpFilt computes KDP from PHIDP.\n\nKDP is defined as half the change in PHIDP per km in range.\n\nRegions with valid PHIDP are determined by examining the quality of the PHIDP data, from RHOHV, and optionally from SNR and the variance of ZDR.\n\nPHIPD folds, so unfolding is the first step in the processing. After unfolding, filtering is applied to smooth PHIDP in range. This is followed by a step to identify regions with phase shift on backscatter.\n\nKDP is then computed as the PHIDP slope between range gates. For DBZ values < 20, 8 gates are used; for DBZ between 20 and 35, 4 gates are used; and if the DBZ exceeds 35, 2 adjacent gates are used.\n\nThe various filtering steps smeer out the KDP in range, which means that the high KDP values are not always located in the core of the precip. To help correct for this effect, we can make use of the self-consistency approach. This allows us to theoretically determine KDP from Z and ZDR - we can call this KDP_ZZDR. We can then use these self-consistent KDP_ZZDR values to compute a conditioned KDP field, by constraining the estimated KDP values to the relevant gates. This reduces the smeering effect. We refer to this KDP field, conditioned using self-consistency, as KDP_SC."); tt->comment_text = tdrpStrDup(""); tt++; // Parameter 'Comment 1' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 1"); tt->comment_hdr = tdrpStrDup("UNFOLDING AND INITIAL FILTERING"); tt->comment_text = tdrpStrDup("The first step is to unfold the PHIDP data. PHIDP folds at -180/180 for simultaneous mode radars, and at -90/90 for alternating mode radars. In order to compute the gradient of PHIDP, we need to unfold it so that it varies smoothly rather than folding."); tt++; // Parameter 'KDP_fir_filter_len' // ctype is '_KDP_fir_filter_len_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = ENUM_TYPE; tt->param_name = tdrpStrDup("KDP_fir_filter_len"); tt->descr = tdrpStrDup("Filter length for the FIR filter for PHIDP (gates)"); tt->help = tdrpStrDup("When computing KDP, an FIR filter is first applied to PHIDP to smooth it. This is the length of that filter, in gates."); tt->val_offset = (char *) &KDP_fir_filter_len - &_start_; tt->enum_def.name = tdrpStrDup("KDP_fir_filter_len_t"); tt->enum_def.nfields = 6; tt->enum_def.fields = (enum_field_t *) tdrpMalloc(tt->enum_def.nfields * sizeof(enum_field_t)); tt->enum_def.fields[0].name = tdrpStrDup("KDP_FIR_LEN_125"); tt->enum_def.fields[0].val = KDP_FIR_LEN_125; tt->enum_def.fields[1].name = tdrpStrDup("KDP_FIR_LEN_60"); tt->enum_def.fields[1].val = KDP_FIR_LEN_60; tt->enum_def.fields[2].name = tdrpStrDup("KDP_FIR_LEN_40"); tt->enum_def.fields[2].val = KDP_FIR_LEN_40; tt->enum_def.fields[3].name = tdrpStrDup("KDP_FIR_LEN_30"); tt->enum_def.fields[3].val = KDP_FIR_LEN_30; tt->enum_def.fields[4].name = tdrpStrDup("KDP_FIR_LEN_20"); tt->enum_def.fields[4].val = KDP_FIR_LEN_20; tt->enum_def.fields[5].name = tdrpStrDup("KDP_FIR_LEN_10"); tt->enum_def.fields[5].val = KDP_FIR_LEN_10; tt->single_val.e = KDP_FIR_LEN_10; tt++; // Parameter 'KDP_n_filt_iterations_unfolded' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("KDP_n_filt_iterations_unfolded"); tt->descr = tdrpStrDup("Sets the number of iterations for the initial FIR filter for unfolded PHIDP."); tt->help = tdrpStrDup("After unfolding PHIDP, the FIR filter is applied to the unfolded phidp, a set number of times, to smooth it. The effect of the filter is a combination of the filter length and the number of iterations."); tt->val_offset = (char *) &KDP_n_filt_iterations_unfolded - &_start_; tt->single_val.i = 2; tt++; // Parameter 'Comment 2' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 2"); tt->comment_hdr = tdrpStrDup("HANDLING PHASE SHIFT ON BACKSCATTER"); tt->comment_text = tdrpStrDup("As the beam passes through liquid precip, PHIDP generally increases. In some regions this increase is augmented by phase shift on backscatter (PSOB) leading to localized peaks in PHIDP. After a PSOB region, PHIDP will decrease to some intermediate level.\n\nKdpFilt offers 2 methods for handling PSOB:\n\t(a) The HUBBERT/BRINGI method, which uses an iterative filtering approach (Hubbert. J, and V.N.Bringi, 1995: An Iterative Filtering technique for the Analysis of Copolar Differential Phase and Dual-Frequency Radar Measurements. Journal of Atmospheric and Oceanic Technology, Vol 12, No 3, June 1995).\n\t(b) The Peak Removal method, which works backwards from longer to shorter ranges, finding the peaks caused by backscatter and trimming them off."); tt++; // Parameter 'KDP_psob_method' // ctype is '_psob_method_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = ENUM_TYPE; tt->param_name = tdrpStrDup("KDP_psob_method"); tt->descr = tdrpStrDup("Method for handling pbase shift on backscatter."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_psob_method - &_start_; tt->enum_def.name = tdrpStrDup("psob_method_t"); tt->enum_def.nfields = 2; tt->enum_def.fields = (enum_field_t *) tdrpMalloc(tt->enum_def.nfields * sizeof(enum_field_t)); tt->enum_def.fields[0].name = tdrpStrDup("HUBBERT_BRINGI_METHOD"); tt->enum_def.fields[0].val = HUBBERT_BRINGI_METHOD; tt->enum_def.fields[1].name = tdrpStrDup("PEAK_REMOVAL_METHOD"); tt->enum_def.fields[1].val = PEAK_REMOVAL_METHOD; tt->single_val.e = PEAK_REMOVAL_METHOD; tt++; // Parameter 'KDP_n_filt_iterations_hubbert_bringi' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("KDP_n_filt_iterations_hubbert_bringi"); tt->descr = tdrpStrDup("Sets the number of iterations for the Hubbert Bringi method."); tt->help = tdrpStrDup("See above."); tt->val_offset = (char *) &KDP_n_filt_iterations_hubbert_bringi - &_start_; tt->single_val.i = 4; tt++; // Parameter 'KDP_phidp_difference_threshold_hubbert_bringi' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_phidp_difference_threshold_hubbert_bringi"); tt->descr = tdrpStrDup("Difference threshold for the Hubbert Bringi method."); tt->help = tdrpStrDup("After each iteration of the filter, the result is checked against the original. If the difference is less than this parameter, the original value at that gate is retained. If the difference exceeds this parameter, the new filtered value is retained."); tt->val_offset = (char *) &KDP_phidp_difference_threshold_hubbert_bringi - &_start_; tt->single_val.d = 4; tt++; // Parameter 'Comment 3' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 3"); tt->comment_hdr = tdrpStrDup("IDENTIFYING VALID KDP REGIONS"); tt->comment_text = tdrpStrDup("In weak signal, the PHIDP is very noisy and contains no useful information. We compute various statistics to help to identify those gates containing valid PHIDP, and those with just noise."); tt++; // Parameter 'KDP_ngates_for_stats' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("KDP_ngates_for_stats"); tt->descr = tdrpStrDup("Number of gates over which the phidp mean, sdev and jitter are computed."); tt->help = tdrpStrDup("The mean, sdev and jitter of phidp are computed over a consecutive number of gates in range, centered on the current gate of interest. This parameter is the number of gates over which these statistics are computed."); tt->val_offset = (char *) &KDP_ngates_for_stats - &_start_; tt->single_val.i = 9; tt++; // Parameter 'KDP_phidp_sdev_max' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_phidp_sdev_max"); tt->descr = tdrpStrDup("Sets the threshold for the standard deviation of phidp in range."); tt->help = tdrpStrDup("The sdev of phidp is a good test for valid phidp. The sdev is computed in the circle, so that it takes account of folding if present. If the sdev is less than this value, we conclude we are in weather echo and the PHIDP is valid and KDP should be computed."); tt->val_offset = (char *) &KDP_phidp_sdev_max - &_start_; tt->single_val.d = 20; tt++; // Parameter 'KDP_phidp_jitter_max' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_phidp_jitter_max"); tt->descr = tdrpStrDup("Sets the threshold for the jitter of phidp in range."); tt->help = tdrpStrDup("The jitter of phidp is defined as the mean absolute change in angle between successive phidp measurements in range. It is computed on the circle to take account of folding. If the jitter is less than this value, we conclude we are in weather echo, the PHIDP is valid and KDP should be computed at this gate."); tt->val_offset = (char *) &KDP_phidp_jitter_max - &_start_; tt->single_val.d = 25; tt++; // Parameter 'KDP_check_rhohv' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_check_rhohv"); tt->descr = tdrpStrDup("Check the RHOHV."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_check_rhohv - &_start_; tt->single_val.b = pTRUE; tt++; // Parameter 'KDP_rhohv_threshold' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_rhohv_threshold"); tt->descr = tdrpStrDup("Sets the threshold for checking RHOHV."); tt->help = tdrpStrDup("If the RHOHV drops below this value, KDP will not be computed at this gate."); tt->val_offset = (char *) &KDP_rhohv_threshold - &_start_; tt->single_val.d = 0.95; tt++; // Parameter 'KDP_check_snr' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_check_snr"); tt->descr = tdrpStrDup("Check the SNR."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_check_snr - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'KDP_snr_threshold' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_snr_threshold"); tt->descr = tdrpStrDup("Sets the threshold for checking SNR (dB)."); tt->help = tdrpStrDup("If the SNR drops below this value, KDP will not be computed at this gate."); tt->val_offset = (char *) &KDP_snr_threshold - &_start_; tt->single_val.d = -6; tt++; // Parameter 'KDP_check_zdr_sdev' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_check_zdr_sdev"); tt->descr = tdrpStrDup("Check the standard deviation of ZDR in range?"); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_check_zdr_sdev - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'KDP_zdr_sdev_max' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_zdr_sdev_max"); tt->descr = tdrpStrDup("Sets the threshold for the standard deviation of zdr in range."); tt->help = tdrpStrDup("The sdev of zdr is a good test for clutter. If the sdev is less than this value, we conclude we are in weather echo rather than clutter."); tt->val_offset = (char *) &KDP_zdr_sdev_max - &_start_; tt->single_val.d = 2; tt++; // Parameter 'Comment 4' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 4"); tt->comment_hdr = tdrpStrDup("COMPUTING KDP FROM Z and ZDR"); tt->comment_text = tdrpStrDup("Using the self-consistency approach, we can estimate KDP from Z and ZDR - we call this KDP_ZZDR. We can then compute KDP conditioned using self-consistenty. We call this KDP_SC."); tt++; // Parameter 'KDP_minimum_for_self_consistency' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_minimum_for_self_consistency"); tt->descr = tdrpStrDup("Sets the lower limit of KDP for computing KDP conditioned by self-consistency."); tt->help = tdrpStrDup("To compute KDP_SC, we first find the gates over which regular KDP exceeds a minimum threshold (i.e. this parameter). Over this run of gates we compute the PHIDP change from the regular KDP and from KDP_ZZDR. By taking the ratio of sum(KDP) / sum(KDP_ZZDR), and applying that ratio to KDP_ZZDR over these gates, we can compute KDP_SC such that the PHIDP change over these gates is the same for both KDP and KDP_SC."); tt->val_offset = (char *) &KDP_minimum_for_self_consistency - &_start_; tt->single_val.d = 0.25; tt++; // Parameter 'KDP_median_filter_len_for_ZZDR' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("KDP_median_filter_len_for_ZZDR"); tt->descr = tdrpStrDup("Sets the length of the median filter when computing KDP_ZZDR."); tt->help = tdrpStrDup("When we compute KDP_ZZDR, we first apply a median filter to both Z and ZDR in range. This parameter is the length of that median filter, in gates."); tt->val_offset = (char *) &KDP_median_filter_len_for_ZZDR - &_start_; tt->single_val.i = 5; tt++; // Parameter 'Comment 5' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 5"); tt->comment_hdr = tdrpStrDup("SANITY CHECK ON KDP RESULTS"); tt->comment_text = tdrpStrDup("Ignore small KDP values, which are likely just noise."); tt++; // Parameter 'KDP_min_valid_abs_kdp' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_min_valid_abs_kdp"); tt->descr = tdrpStrDup("Sets the min valid KDP value."); tt->help = tdrpStrDup("Values less than this are set to 0."); tt->val_offset = (char *) &KDP_min_valid_abs_kdp - &_start_; tt->single_val.d = 0.01; tt++; // Parameter 'Comment 6' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 6"); tt->comment_hdr = tdrpStrDup("ESTIMATING ATTENUATION CORRECTION FOR DBZ AND ZDR"); tt->comment_text = tdrpStrDup("Received power attenuation, and differential attenuation, occur whenever scattering occurs, but is of most importance at shorter wavelengths or in reqions of heavy precipition. We use the reference text Polarimetric Doppler Weather Radar, by Bringi and Chandrasekar, Table 7.1, page 494, to provide the default coefficients from which to estimate the attenuation correction. You may also choose to specify these coefficients in this section."); tt++; // Parameter 'KDP_specify_coefficients_for_attenuation_correction' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_specify_coefficients_for_attenuation_correction"); tt->descr = tdrpStrDup("Option to specify the coefficients and exponents."); tt->help = tdrpStrDup("If false, the default coefficients will be determined for the radar wavelength."); tt->val_offset = (char *) &KDP_specify_coefficients_for_attenuation_correction - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'KDP_dbz_attenuation_coefficient' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_dbz_attenuation_coefficient"); tt->descr = tdrpStrDup("Coefficient for computing DBZ attenuation correction."); tt->help = tdrpStrDup("Default is 0.017. See Bringi and Chandrasekar, Table 7.1, page 494."); tt->val_offset = (char *) &KDP_dbz_attenuation_coefficient - &_start_; tt->single_val.d = 0.017; tt++; // Parameter 'KDP_dbz_attenuation_exponent' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_dbz_attenuation_exponent"); tt->descr = tdrpStrDup("Exponent for computing DBZ attenuation correction."); tt->help = tdrpStrDup("Default is 0.84. See Bringi and Chandrasekar, Table 7.1, page 494."); tt->val_offset = (char *) &KDP_dbz_attenuation_exponent - &_start_; tt->single_val.d = 0.84; tt++; // Parameter 'KDP_zdr_attenuation_coefficient' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_zdr_attenuation_coefficient"); tt->descr = tdrpStrDup("Coefficient for computing ZDR attenuation correction."); tt->help = tdrpStrDup("Default is 0.003. See Bringi and Chandrasekar, Table 7.1, page 494."); tt->val_offset = (char *) &KDP_zdr_attenuation_coefficient - &_start_; tt->single_val.d = 0.003; tt++; // Parameter 'KDP_zdr_attenuation_exponent' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("KDP_zdr_attenuation_exponent"); tt->descr = tdrpStrDup("Exponent for computing ZDR attenuation correction."); tt->help = tdrpStrDup("Default is 1.05. See Bringi and Chandrasekar, Table 7.1, page 494."); tt->val_offset = (char *) &KDP_zdr_attenuation_exponent - &_start_; tt->single_val.d = 1.05; tt++; // Parameter 'Comment 7' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 7"); tt->comment_hdr = tdrpStrDup("DEBUGGING"); tt->comment_text = tdrpStrDup(""); tt++; // Parameter 'KDP_debug' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_debug"); tt->descr = tdrpStrDup("Option to print debug messages in KDP computation."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_debug - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'KDP_write_ray_files' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("KDP_write_ray_files"); tt->descr = tdrpStrDup("Option to write ray files to debug KDP computation."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_write_ray_files - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'KDP_ray_files_dir' // ctype is 'char*' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRING_TYPE; tt->param_name = tdrpStrDup("KDP_ray_files_dir"); tt->descr = tdrpStrDup("Directory for KDP ray files."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &KDP_ray_files_dir - &_start_; tt->single_val.s = tdrpStrDup("/tmp/kdp_ray_files"); tt++; // trailing entry has param_name set to NULL tt->param_name = NULL; return; }