Skip to content

Commit

Permalink
Feature 2022 stat_analysis (#2185)
Browse files Browse the repository at this point in the history
Proceeding with the merge without an external review based on the details listed above.
  • Loading branch information
JohnHalleyGotway authored Jun 15, 2022
1 parent 8d4e4d4 commit e0ccbd4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
49 changes: 27 additions & 22 deletions src/libcode/vx_statistics/met_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1747,42 +1747,47 @@ void VL1L2Info::allocate_n_alpha(int i) {
////////////////////////////////////////////////////////////////////////

void VL1L2Info::compute_stats() {
double u_diff, v_diff;
int n = vcount;
int n;

if(vcount > 0) {

u_diff = uf_bar - uo_bar;
v_diff = vf_bar - vo_bar;
n = vcount;

FBAR.v = f_speed_bar;
OBAR.v = o_speed_bar;
double u_diff = uf_bar - uo_bar;
double v_diff = vf_bar - vo_bar;

FS_RMS.v = sqrt(uvff_bar);
OS_RMS.v = sqrt(uvoo_bar);
FBAR.v = f_speed_bar;
OBAR.v = o_speed_bar;

MSVE.v = uvff_bar - 2.0*uvfo_bar + uvoo_bar;
FS_RMS.v = sqrt(uvff_bar);
OS_RMS.v = sqrt(uvoo_bar);

RMSVE.v = sqrt(MSVE.v);
MSVE.v = uvff_bar - 2.0*uvfo_bar + uvoo_bar;

FSTDEV.v = compute_stdev(f_speed_bar*n, uvff_bar*n, n);
OSTDEV.v = compute_stdev(o_speed_bar*n, uvoo_bar*n, n);
RMSVE.v = sqrt(MSVE.v);

FDIR.v = convert_u_v_to_wdir(uf_bar, vf_bar);
ODIR.v = convert_u_v_to_wdir(uo_bar, vo_bar);
FSTDEV.v = compute_stdev(f_speed_bar*n, uvff_bar*n, n);
OSTDEV.v = compute_stdev(o_speed_bar*n, uvoo_bar*n, n);

FBAR_SPEED.v = convert_u_v_to_wind(uf_bar, vf_bar);
OBAR_SPEED.v = convert_u_v_to_wind(uo_bar, vo_bar);
FDIR.v = convert_u_v_to_wdir(uf_bar, vf_bar);
ODIR.v = convert_u_v_to_wdir(uo_bar, vo_bar);

VDIFF_SPEED.v = convert_u_v_to_wind(u_diff, v_diff);
FBAR_SPEED.v = convert_u_v_to_wind(uf_bar, vf_bar);
OBAR_SPEED.v = convert_u_v_to_wind(uo_bar, vo_bar);

VDIFF_DIR.v = convert_u_v_to_wdir(u_diff, v_diff);
VDIFF_SPEED.v = convert_u_v_to_wind(u_diff, v_diff);

SPEED_ERR.v = FBAR_SPEED.v - OBAR_SPEED.v;
VDIFF_DIR.v = convert_u_v_to_wdir(u_diff, v_diff);

SPEED_ABSERR.v = fabs(SPEED_ERR.v);
SPEED_ERR.v = FBAR_SPEED.v - OBAR_SPEED.v;

DIR_ERR.v = atan2d(vf_bar*uo_bar - uf_bar*vo_bar, uf_bar*uo_bar + vf_bar*vo_bar);
SPEED_ABSERR.v = fabs(SPEED_ERR.v);

DIR_ABSERR.v = fabs(DIR_ERR.v);
DIR_ERR.v = atan2d(vf_bar*uo_bar - uf_bar*vo_bar,
uf_bar*uo_bar + vf_bar*vo_bar);

DIR_ABSERR.v = fabs(DIR_ERR.v);
}

if(vacount > 0) {

Expand Down
4 changes: 3 additions & 1 deletion src/tools/core/stat_analysis/stat_analysis_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,9 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt,
shc = it->second.hdr.get_shc(it->first, job.by_column,
job.hdr_name, job.hdr_value, lt);
if(job.stat_out) {
if(lt == stat_cnt || lt == stat_nbrcnt) shc.set_alpha(job.out_alpha);
if(lt == stat_cnt || lt == stat_vcnt || lt == stat_nbrcnt) {
shc.set_alpha(job.out_alpha);
}
write_header_cols(shc, job.stat_at, job.stat_row);
}

Expand Down

0 comments on commit e0ccbd4

Please sign in to comment.