Skip to content
Snippets Groups Projects
Commit 58aa28e0 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 3c979f7e
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,7 @@ def create_file2(filename, raob_to_amv_dct, raob_dct, amv_files):
rootgrp.close()
def run_best_fit_all(full_domain=False):
def run_best_fit_all(amv_path=None, product_path=None, raob_path=None, gfs_path=None, source='FMWK', full_domain=False):
amv_files = get_datasource('/apollo/cloud/scratch/AMV_BUST/FMWK_TEST3/', 10, 'FMWK')
#prd_files = get_datasource('/apollo/cloud/scratch/AMV_BUST/FMWK_TEST3/', 10, 'FMWK_CLD_HGT')
prd_files = get_datasource('/apollo/cloud/scratch/AMV_BUST/FMWK_TEST3/', 10, 'FMWK_CLD_PHASE')
......@@ -1144,11 +1144,11 @@ def compare_amvs_bestfit(amvs, bfs, bin_size=200):
amv_spd = good_amvs[keep_idxs, sidx]
amv_dir = good_amvs[keep_idxs, didx]
bf_spd, bf_dir = spd_dir_from_uv(bfs[keep_idxs, 0], bfs[keep_idxs, 1])
# bf_spd, bf_dir = bfs[keep_idxs, 0], bfs[keep_idxs, 1]
#bf_spd, bf_dir = bfs[keep_idxs, 0], bfs[keep_idxs, 1]
diff = amv_spd * units('m/s') - bf_spd
diff = diff.magnitude
# diff = amv_spd - bf_spd
#diff = amv_spd - bf_spd
spd_mad = np.average(np.abs(diff))
spd_bias = np.average(diff)
print('spd, MAD: {0:.2f}'.format(spd_mad))
......@@ -1160,7 +1160,7 @@ def compare_amvs_bestfit(amvs, bfs, bin_size=200):
bin_spd = bin_data_by(diff, amv_p, bin_ranges)
dir_diff = direction_difference(amv_dir, bf_dir.magnitude)
# dir_diff = direction_difference(amv_dir, bf_dir)
#dir_diff = direction_difference(amv_dir, bf_dir)
print('dir, MAD: {0:.2f}'.format(np.average(np.abs(dir_diff))))
print('dir bias: {0:.2f}'.format(np.average(dir_diff)))
print('-------------------------------------')
......@@ -1246,15 +1246,11 @@ def make_plot(bin_ranges, bin_values):
std.append(np.std(bin_vals[i]))
#do_plot(x_values, [std_r, std_g, std], ['THIN', 'THICK', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB Pres Match', x_axis_label='STD (hPa)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [std_r, std_g, std], ['THIN', 'THICK', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB Pres Match', x_axis_label='STD (deg)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [mad_r, mad_g, mad], ['THIN', 'THICK', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB Pres Match', x_axis_label='MAD (deg)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [mad_r, mad_g, mad], ['ICE', 'NOT ICE', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB BestFit', x_axis_label='MAD (hPa)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [pres_mad_r, pres_mad_g], ['RAOB', 'GFS'], ['blue', 'red'], title='ACHA - BestFit', x_axis_label='MAD', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [spd_mad_r, spd_mad_g], ['RAOB', 'GFS'], ['blue', 'red'], title='ACHA - BestFit', x_axis_label='MAE (m/s)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [pres_bias_r, pres_bias_g], ['RAOB', 'GFS'], ['blue', 'red'], title='ACHA - BestFit', x_axis_label='BIAS', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [spd_bias_r, spd_bias_g], ['RAOB', 'GFS'], ['blue', 'red'], title='ACHA - BestFit', x_axis_label='BIAS (m/s)', y_axis_label='hPa', invert=True, flip=True)
do_plot(x_values, [num_vals_r, num_vals_g, num_vals], ['ICE: '+str(num_r), 'NOT ICE: '+str(num_g), 'ALL: '+str(num)], ['blue', 'red', 'black'], title='ACHA - RAOB BestFit', x_axis_label='log(Count)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [std_r, std_g, std], ['ICE', 'NOT ICE', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB ', x_axis_label='STD (hPa)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [bias_r, bias_g, bias], ['ICE', 'NOT ICE', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB Pres Match', x_axis_label='BIAS (m/s)', y_axis_label='hPa', invert=True, flip=True)
do_plot(x_values, [bias_r, bias_g, bias], ['ICE', 'NOT ICE', 'ALL'], ['blue', 'red', 'black'], title='ACHA - GFS BestFit', x_axis_label='BIAS (m/s)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [mad_r, mad_g, mad], ['ICE', 'NOT ICE', 'ALL'], ['blue', 'red', 'black'], title='ACHA - RAOB Pres Match', x_axis_label='MAD (m/s)', y_axis_label='hPa', invert=True, flip=True)
#do_plot(x_values, [num_vals_r, num_vals_g, num_vals], ['ICE: '+str(num_r), 'NOT ICE: '+str(num_g), 'ALL: '+str(num)], ['blue', 'red', 'black'], title='ACHA - RAOB BestFit', x_axis_label='log(Count)', y_axis_label='hPa', invert=True, flip=True)
def make_plot2(bin_pres_r, bin_ranges):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment