make_dir(dirname) # # select a sub region that goes from -120 -> -115 deg lon and # 20 - 25 deg lat # lon_hit = np.logical_and(lon_centers > -120, lon_centers < -115) lon_indices = np.where(lon_hit)[0] lat_hit = np.logical_and(lat_centers > 20, lat_centers < 25) lat_indices = np.where(lat_hit)[0] sub_lons = lon_centers[lon_indices] sub_lats = lat_centers[lat_indices] sub_chan1ref = chan1ref_grid[lat_indices[0] : lat_indices[-1], lon_indices[0] : lon_indices[-1]] sub_chan31 = chan31_grid[lat_indices[0] : lat_indices[-1], lon_indices[0] : lon_indices[-1]] bin_chan1ref = fastbin(0.05, 0.6, 50.0, -999, -888) bin_chan31 = fastbin(2.0, 18.0, 50.0, -999, -888) chan1_centers = bin_chan1ref.get_centers() chan31_centers = bin_chan31.get_centers() the_hist = fh.pyhist(sub_chan31, sub_chan1ref, bin_chan31, bin_chan1ref) counts = the_hist.get_hist2d() cmap = cm.RdBu_r cmap.set_over("y") cmap.set_under("k") vmin = 10.0 vmax = 400.0 the_norm = Normalize(vmin=vmin, vmax=vmax, clip=False) counts = counts.astype(np.float32)
# select none here to see the full image # max_rows= None max_cols= None partLats=fullLats[:max_rows,:max_cols] partLons=fullLons[:max_rows,:max_cols] partRads=chan31[:max_rows,:max_cols] partMask=maskout[:max_rows,:max_cols] partLand=landout[:max_rows,:max_cols] partChan1rad=chan1[:max_rows,:max_cols] partChan1ref=chan1ref[:max_rows,:max_cols] numlatbins=800 numlonbins=600 bin_lats=fastbin(south,north,numlatbins,-999,-888) bin_lons=fastbin(west,east,numlonbins,-999,-888) lon_centers=bin_lons.get_centers() lat_centers=bin_lats.get_centers() new_hist=fh.pyhist(partLats,partLons,bin_lats,bin_lons) chan31_grid=new_hist.get_mean(partRads) mask_grid=new_hist.get_mean(partMask) land_grid=new_hist.get_mean(partLand) chan1rad_grid=new_hist.get_mean(partChan1rad) chan1ref_grid=new_hist.get_mean(partChan1ref) fig1=plt.figure(1) fig1.clf()
crosspol = MPLfile.data[1] copolvals = np.hstack(copol.values).astype('float32') crosspolvals = np.hstack(crosspol.values).astype('float32') depolMPL = crosspolvals/copolvals depolvals = depolMPL/(depolMPL+1) copol_mean = np.mean(copolvals) copol_std = np.std(copolvals) copol_min = copol_mean-copol_std copol_max = copol_mean+copol_std bin_copol=fastbin(0.,0.002,100.,-999,-888) bin_depol=fastbin(0.,2.0,100.,-999,-888) copol_centers=bin_copol.get_centers() depol_centers=bin_depol.get_centers() the_hist=fh.pyhist(depolvals,copolvals,bin_depol,bin_copol) counts=the_hist.get_hist2d() cmap=cm.RdBu_r cmap.set_over('y') cmap.set_under('k') counts=counts.astype(np.float32) vmin= 0. vmax= 4 the_norm=Normalize(vmin=vmin,vmax=vmax,clip=False)