diff --git a/met/data/config/TCGenConfig_default b/met/data/config/TCGenConfig_default index 748d0e9fa6..0de6a27844 100644 --- a/met/data/config/TCGenConfig_default +++ b/met/data/config/TCGenConfig_default @@ -227,8 +227,12 @@ ci_alpha = 0.05; // output_flag = { fho = NONE; - ctc = BOTH; + ctc = BOTH; cts = BOTH; + pct = NONE; + pstd = NONE; + pjc = NONE; + prc = NONE; genmpr = NONE; } diff --git a/met/src/tools/tc_utils/tc_gen/tc_gen.cc b/met/src/tools/tc_utils/tc_gen/tc_gen.cc index 1171efa5b6..f2a26967d8 100644 --- a/met/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/met/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -95,8 +95,9 @@ static void setup_txt_files (int, int); static void setup_table (AsciiTable &); static void setup_nc_file (); -static void write_stats (const PairDataGenesis &, +static void write_ctc_stats (const PairDataGenesis &, GenCTCInfo &); +static void write_pct_stats (int, PCTInfo &, PCTInfo &); static void write_genmpr_row (StatHdrColumns &, const PairDataGenesis &, STATOutputType, @@ -151,6 +152,19 @@ int main(int argc, char *argv[]) { score_genesis_prob(best_ga, oper_ta); } + // Finish output files + finish_txt_files(); + + // Close the NetCDF output file + if(nc_out) { + + // List the NetCDF file after it is finished + mlog << Debug(1) << "Output file: " << out_nc_file << "\n"; + + delete nc_out; + nc_out = (NcFile *) 0; + } + return(0); } @@ -335,7 +349,7 @@ void score_track_genesis(const GenesisInfoArray &best_ga, do_genesis_ctc(conf_info.VxOpt[i], pairs, ctc_info); // Write the statistics output - write_stats(pairs, ctc_info); + write_ctc_stats(pairs, ctc_info); // Write NetCDF output fields if(!conf_info.VxOpt[i].NcInfo.all_false()) { @@ -346,19 +360,6 @@ void score_track_genesis(const GenesisInfoArray &best_ga, } // end for i n_vx - // Finish output files - finish_txt_files(); - - // Close the NetCDF output file - if(nc_out) { - - // List the NetCDF file after it is finished - mlog << Debug(1) << "Output file: " << out_nc_file << "\n"; - - delete nc_out; - nc_out = (NcFile *) 0; - } - return; } @@ -366,15 +367,16 @@ void score_track_genesis(const GenesisInfoArray &best_ga, void score_genesis_prob(const GenesisInfoArray &best_ga, const TrackInfoArray &oper_ta) { - int i, j; + int i, j, k, l, prob_time; + double prob_value; + IntArray prob_times; StringArray edeck_files, edeck_files_model_suffix; ProbInfoArray fcst_pa, empty_pa; ConcatString model, cs; map model_pa_map; - map::iterator it; - map gen_prob_map; - map::iterator gen_it; - PCTInfo pct_info; + map::iterator model_it; + map pct_dev_map, pct_ops_map; + PCTInfo empty_pct; // Get the list of EDECK files get_atcf_files(edeck_source, edeck_model_suffix, atcf_reg_exp, @@ -386,17 +388,9 @@ void score_genesis_prob(const GenesisInfoArray &best_ga, process_edecks(edeck_files, edeck_files_model_suffix, fcst_pa); - /* JHG, need to think about the output files! - // Setup output files based on the number of techniques present - // and possible pairs. - int n_time = (conf_info.FcstSecEnd - conf_info.FcstSecBeg) / - (conf_info.InitFreqHr*sec_per_hour) + 1; - int n_pair = best_ga.n() * n_time + fcst_ga.n(); - setup_txt_files(fcst_ga.n_technique(), n_pair); + // Setup output files based on the number of techniques + setup_txt_files(fcst_pa.n_technique(), 0); - // If requested, setup the NetCDF output file - if(!conf_info.NcInfo.all_false()) setup_nc_file(); -*/ // Process each verification filter for(i=0; ifirst; - pct_info.set_vx_opt(&conf_info.VxOpt[i], - &conf_info.NcOutGrid); -*/ + for(j=0,model_it=model_pa_map.begin(); + model_it!=model_pa_map.end(); + model_it++,j++) { + mlog << Debug(2) << "[Filter " << i+1 << " (" << conf_info.VxOpt[i].Desc - << ") " << ": Model " << j+1 << "] " << "For " << it->first - << " model, comparing " << it->second.n_prob_gen() + << ") " << ": Model " << j+1 << "] " << "For " << model_it->first + << " model, comparing " << model_it->second.n_prob_gen() << " genesis forecasts to " << best_ga.n() << " " << conf_info.BestEventInfo.Technique << " and " << oper_ta.n() << " " << conf_info.OperTechnique << " tracks.\n"; -/* - // Get the pairs - get_genesis_pairs(conf_info.VxOpt[i], it->first, it->second, - best_ga, oper_ta, pairs); - - // Do the categorical verification - do_genesis_ctc(conf_info.VxOpt[i], pairs, ctc_info); - - // Write the statistics output - write_stats(pairs, ctc_info); - // Write NetCDF output fields - if(!conf_info.VxOpt[i].NcInfo.all_false()) { - write_nc(ctc_info); + // Loop over the probability of genesis events + for(k=0; ksecond.n_prob_gen(); k++) { + + // JHG search for a match! + // For now, just assume it's a hit. + // Also need to define SHC values. + bool dev_match = true; + bool ops_match = true; + + // Loop over the individual probabilities + for(l=0; lsecond.prob_gen(k).n_prob(); l++) { + + // Current lead time + prob_time = nint(model_it->second.prob_gen(k).prob_item(l)); + prob_value = model_it->second.prob_gen(k).prob(l) / 100.0; + + // Add a new map entries for this lead time, if necessary + if(!prob_times.has(prob_time)) { + prob_times.add(prob_time); + pct_dev_map[prob_time] = empty_pct; + pct_ops_map[prob_time] = empty_pct; + } + + // Increment counts + if(dev_match) pct_dev_map[prob_time].pct.inc_event (prob_value); + else pct_dev_map[prob_time].pct.inc_nonevent(prob_value); + if(ops_match) pct_ops_map[prob_time].pct.inc_event (prob_value); + else pct_ops_map[prob_time].pct.inc_nonevent(prob_value); + + } // end for l + } // end for k + + // Write probabilistic output + for(k=0; k 0 || stat_at.ncols() > 0) return; + // Check to see if the stat file stream has already been setup + bool init_from_scratch = (stat_out == (ofstream *) 0); - // Initialize file stream - stat_out = (ofstream *) 0; + // Get the maximum number of probability thresholds + n_prob = conf_info.get_max_n_prob_thresh(); - // Build the file name - stat_file << out_base << stat_file_ext; + // Compute the number of rows/cols needs for each file type + for(i=0, stat_rows=0, stat_cols=0; i