diff --git a/modules/util/acspo_validate.py b/modules/util/acspo_validate.py index b8b896680cc3c958191cbb04e86ef93e66091ff1..a503e78d3cc407f057dfee264e1ce3af008fed7b 100644 --- a/modules/util/acspo_validate.py +++ b/modules/util/acspo_validate.py @@ -49,24 +49,31 @@ def acspo_validate(oper_file, cspp_file): print('oper start, stop ', start_idx_oper, stop_idx_oper) print('cspp start, stop ', start_idx_cspp, stop_idx_cspp) - lon_cspp = lon_cspp[start_idx_cspp:stop_idx_cspp, :].flatten() - lat_cspp = lat_cspp[start_idx_cspp:stop_idx_cspp, :].flatten() - lon_oper = lon_oper[start_idx_oper:stop_idx_oper, :].flatten() - lat_oper = lat_oper[start_idx_oper:stop_idx_oper, :].flatten() - - print(np.size(lon_cspp), np.size(lon_oper)) - print(np.size(lat_cspp), np.size(lat_oper)) + lon_cspp = lon_cspp[start_idx_cspp:stop_idx_cspp, :] + lat_cspp = lat_cspp[start_idx_cspp:stop_idx_cspp, :] + lon_oper = lon_oper[start_idx_oper:stop_idx_oper, :] + lat_oper = lat_oper[start_idx_oper:stop_idx_oper, :] + cspp_clear = cspp_clear[start_idx_oper:stop_idx_oper, :] + oper_clear = oper_clear[start_idx_oper:stop_idx_oper, :] + overlap_shape = lon_cspp.shape + print('overlap shape, size: ', overlap_shape, np.size(lon_cspp)) print(np.sum(np.isclose(lon_cspp, lon_oper, rtol=0.001))) print(np.sum(np.isclose(lat_cspp, lat_oper, rtol=0.001))) sst_cspp = sst_cspp[start_idx_cspp:stop_idx_cspp, :].flatten() sst_oper = sst_oper[start_idx_oper:stop_idx_oper, :].flatten() + oper_clear = oper_clear.flatten() + cspp_clear = cspp_clear.flatten() + both_clear = oper_clear & cspp_clear + sst_cspp = sst_cspp[both_clear] + sst_oper = sst_oper[both_clear] both_valid = np.invert(np.isnan(sst_cspp)) & np.invert(np.isnan(sst_oper)) - print('number of valid sst in both: ', np.sum(both_valid)) + print('number of clear and valid SSTs in both: ', np.sum(both_valid)) - print(np.sum(np.isclose(sst_cspp[both_valid], sst_oper[both_valid], rtol=0.001))) + print('fraction approx equal: ', + np.sum(np.isclose(sst_cspp[both_valid], sst_oper[both_valid], rtol=0.001))/np.sum(both_valid)) # print(np.histogram((sst_cspp[both_valid] - sst_oper[both_valid]), bins=10))