#filenames = glob('./matchup_synop_radval_npp.txt') filenames = glob('./matchup_synop_all_npp.txt') this = MatchupAnalysis(mtype='synop') #this = MatchupAnalysis(mtype='point') this.get_results(filenames) res = this.data[np.isfinite(this.data['sat'])] # Illumination filtering: # res = sunz_filter(res, [0, 80]) # Daytime # res = sunz_filter(res, [90, 180]) # Night # res = sunz_filter(res, [80, 90]) # Twilight hist1d_plot(res, 'sat', 'PPS cloud cover', color='blue') #synop_validation(res, './ppsval_nightime.txt') synop_validation(res, './ppsval.txt') x = res.date + res.delta_t.apply(lambda d: timedelta(minutes=d)) startdate = x.min() enddate = x.max() mydate = startdate delta_t = timedelta(minutes=60 * 24 * 10) # 10 days datelist = [] frequency = [] while mydate < enddate: mydate = mydate + delta_t a = np.where(np.logical_and(x.astype(datetime).values < mydate, x.astype(datetime).values > mydate - delta_t), 1, 0) frequency.append(np.repeat(a, a).sum())
r13 = np.array(res.loc[res.index, 'r13'].tolist()) ciwv = np.array(res.loc[res.index, 'ciwv'].tolist()) mask = np.logical_or( nodata, np.logical_or(cloudy == False, ppsclear == False)) r13 = np.ma.masked_array(r13, mask=mask) ciwv = np.ma.masked_array(ciwv, mask=mask) y = r13 x = ciwv plt.hexbin(x, y, cmap=mycmap) plt.axis([xmin, xmax, ymin, ymax]) plt.title('PPS clear and Synop cloudy') plt.xlabel('ciwv') plt.ylabel('r13') plt.ylim(ymax=ymax) cb = plt.colorbar() cb.set_label('N') plt.savefig(plotfile) # plt.show() idx = res[res['r13'] > 0.5].index idx2 = res[res['ciwv'] > 4.0].index idx3 = res[res['sat'] >= 0].index index = [x for x in idx if x in idx2] index = [x for x in index if x in idx3] save_pps = res.loc[index, 'sat'] res.loc[res[res['r13'] > 0.5].index, 'sat'] = 1 synop_validation(res, './ppsval_daytime_13boost.txt')
r13 = np.array(res.loc[res.index, 'r13'].tolist()) ciwv = np.array(res.loc[res.index, 'ciwv'].tolist()) mask = np.logical_or(nodata, np.logical_or(cloudy == False, ppsclear == False)) r13 = np.ma.masked_array(r13, mask=mask) ciwv = np.ma.masked_array(ciwv, mask=mask) y = r13 x = ciwv plt.hexbin(x, y, cmap=mycmap) plt.axis([xmin, xmax, ymin, ymax]) plt.title('PPS clear and Synop cloudy') plt.xlabel('ciwv') plt.ylabel('r13') plt.ylim(ymax=ymax) cb = plt.colorbar() cb.set_label('N') plt.savefig(plotfile) # plt.show() idx = res[res['r13'] > 0.5].index idx2 = res[res['ciwv'] > 4.0].index idx3 = res[res['sat'] >= 0].index index = [x for x in idx if x in idx2] index = [x for x in index if x in idx3] save_pps = res.loc[index, 'sat'] res.loc[res[res['r13'] > 0.5].index, 'sat'] = 1 synop_validation(res, './ppsval_daytime_13boost.txt')
#filenames = glob('./matchup_synop_radval_npp.txt') filenames = glob('./matchup_synop_all_npp.txt') this = MatchupAnalysis(mtype='synop') #this = MatchupAnalysis(mtype='point') this.get_results(filenames) res = this.data[np.isfinite(this.data['sat'])] # Illumination filtering: # res = sunz_filter(res, [0, 80]) # Daytime # res = sunz_filter(res, [90, 180]) # Night # res = sunz_filter(res, [80, 90]) # Twilight hist1d_plot(res, 'sat', 'PPS cloud cover', color='blue') #synop_validation(res, './ppsval_nightime.txt') synop_validation(res, './ppsval.txt') x = res.date + res.delta_t.apply(lambda d: timedelta(minutes=d)) startdate = x.min() enddate = x.max() mydate = startdate delta_t = timedelta(minutes=60 * 24 * 10) # 10 days datelist = [] frequency = [] while mydate < enddate: mydate = mydate + delta_t a = np.where( np.logical_and( x.astype(datetime).values < mydate, x.astype(datetime).values > mydate - delta_t), 1, 0)