def statplot(cor, err, Z): from pcc import get_my_cmap plt.errorbar(range(0, len(cor)), cor, yerr=err, fmt='o', zorder=1, color='grey') plt.scatter(range(0, len(cor)), cor, c=Z, vmin=100, vmax=1000, cmap=get_my_cmap(), zorder=2) cb = plt.colorbar(shrink=0.5) cb.set_label("Hits in #", fontsize=ff) cb.ax.tick_params(labelsize=ff) #plt.show() plt.ylim(-1, 1) plt.xlim(0, len(cor)) plt.grid() plt.ylabel('Correlation', fontsize=ff) plt.xlabel('overpasses with time', fontsize=ff) plt.title('Overpass statistics betwen DPR and RADOLAN', fontsize=ff)
def statplot(cor, err, Z): from pcc import get_my_cmap plt.errorbar(range(0,len(cor)),cor, yerr=err, fmt='o', zorder=1, color='grey') plt.scatter(range(0,len(cor)),cor,c=Z, vmin=100, vmax=1000, cmap=get_my_cmap(), zorder=2) cb = plt.colorbar(shrink=0.5) cb.set_label("Hits in #",fontsize=ff) cb.ax.tick_params(labelsize=ff) #plt.show() plt.ylim(-1,1) plt.xlim(0,len(cor)) plt.grid() plt.ylabel('Correlation',fontsize=ff) plt.xlabel('overpasses with time',fontsize=ff) plt.title('Overpass statistics betwen DPR and RADOLAN',fontsize=ff)
cbar.set_label('#'+ str(TH), rotation=270) plt.grid() plt.ylabel('y') plt.xlabel('Ref') plt.title('RADOLAN REF Hist') plt.show() maskr = ~np.isnan(r_sat) & ~np.isnan(r_rad) from pcc import get_my_cmap fig = plt.figure(figsize=(12,12)) ax1 = fig.add_subplot(111, aspect='auto') plt.hist2d(r_sat[maskr],r_rad[maskr],bins=bbb, cmap=get_my_cmap(), vmin=0.1) cbar = plt.colorbar() cbar.set_label('#'+ str(TH), rotation=270) plt.grid() plt.xlabel('x') plt.ylabel('Ref') plt.title('GPM NS REF Hist') plt.show() A, B = r_rad[maskr],r_sat[maskr] """ extrema = 40 popo = np.where((A>extrema)&(B>extrema)) fig = plt.figure(figsize=(12,12))
from pcc import get_time_of_gpm from pcc import cut_the_swath ## Landgrenzenfunktion ## ------------------- from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] from pcc import plot_borders from pcc import plot_radar from pcc import get_miub_cmap my_cmap = get_miub_cmap() from pcc import get_my_cmap my_cmap2 = get_my_cmap() GGG = [] RRR = [] # Ref.Threshold nach RADOLAN_Goudenhoofdt_2016 TH_ref = 12#18#7 ''' zz = np.array([20140609, 20140610, 20140629, 20140826, 20140921, 20141007, 20141016, 20150128, 20150227, 20150402, 20150427, 20160405, 20160607, 20160805, 20160904, 20160917, 20161001, 20161024, 20170113, 20170203,20170223]) ''' ZP = '20141007'
""" import numpy as np import h5py import matplotlib.pyplot as plt import wradlib import pandas as pd import pcc as pcc from pcc import boxpol_pos from pcc import plot_radar from pcc import plot_borders from time import * my_cmap = pcc.get_my_cmap() cmap2 = pcc.get_miub_cmap() from pcc import get_radar_locations radar = get_radar_locations() from pcc import zeitschleife as zt bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] blat, blon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] import os #kometar t1 = clock() zeit = zt(2013,05,28,00,00,0, 2013,05,28,23,55,0,
gn.reshape(gn.shape[0] * gn.shape[1], 1), wrl.ipol.Idw, nnearest=4) res_gpm = res_gpm.reshape(xx_new.shape) res_gpm[res_gpm != 0] = 1 # Randkorrektur from pcc import get_my_cmap #result_gpm[np.where(xx_new < gpm_x[:,0])] = np.nan #result_gpm[np.where(yy_new < gpm_y[:,-1])] = np.nan plt.subplot(2, 3, 1) plt.pcolormesh(gpm_x, gpm_y, np.ma.masked_invalid(rrr), cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:, 0], gpm_y[:, 0], color='black', lw=1) plt.plot(gpm_x[:, -1], gpm_y[:, -1], color='black', lw=1) plt.subplot(2, 3, 2) plt.pcolormesh(gpm_x, gpm_y, np.ma.masked_invalid(bpp), cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:, 0], gpm_y[:, 0], color='black', lw=1) plt.plot(gpm_x[:, -1], gpm_y[:, -1], color='black', lw=1) plt.subplot(2, 3, 4)
res_gpm = wrl.ipol.interpolate(grid_gpm_xy, xy_new, gn.reshape(gn.shape[0]*gn.shape[1],1), wrl.ipol.Idw, nnearest=4) res_gpm = res_gpm.reshape(xx_new.shape) res_gpm[res_gpm!=0]= 1 # Randkorrektur from pcc import get_my_cmap #result_gpm[np.where(xx_new < gpm_x[:,0])] = np.nan #result_gpm[np.where(yy_new < gpm_y[:,-1])] = np.nan plt.subplot(2,3,1) plt.pcolormesh(gpm_x, gpm_y, np.ma.masked_invalid(rrr), cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:,0],gpm_y[:,0], color='black',lw=1) plt.plot(gpm_x[:,-1],gpm_y[:,-1], color='black',lw=1) plt.subplot(2,3,2) plt.pcolormesh(gpm_x, gpm_y, np.ma.masked_invalid(bpp), cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:,0],gpm_y[:,0], color='black',lw=1) plt.plot(gpm_x[:,-1],gpm_y[:,-1], color='black',lw=1) plt.subplot(2,3,4) plt.pcolormesh(xx_new, yy_new, result_rad, cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:,0],gpm_y[:,0], color='black',lw=1) plt.plot(gpm_x[:,-1],gpm_y[:,-1], color='black',lw=1) plt.subplot(2,3,5) plt.pcolormesh(xx_new, yy_new, np.ma.masked_invalid(result_gpm*res_gpm), cmap=get_my_cmap(), vmin=0.01, vmax=50) plt.plot(gpm_x[:,0],gpm_y[:,0], color='black',lw=1)
plot_radar(bonnlon, bonnlat, ax1, reproject=False, cband=False,col='black') #ax1 = plt.scatter(lon_ppi, lat_ppi, c=50 ,s=50, color='red') plt.scatter(k1,l1, c=50 ,s=50, color='red') plt.scatter(k2,l1, c=50 ,s=50, color='red') plt.scatter(k1,l2, c=50 ,s=50, color='red') plt.scatter(k2,l2, c=50 ,s=50, color='red') plt.grid() plt.xlim(-420,390) plt.ylim(-4700, -3700) ################## ax2 = fig.add_subplot(222, aspect='auto') plt.hist2d(ppp[maske],hhh[maske], bins=30, cmap=get_my_cmap(), vmin=0.1) plt.ylim(0,5000) plt.xlim(-10,10) print pp.shape plt.plot(np.nanmean(pp[:,:],axis=0),hdpr, color='red', lw=2) plt.plot(np.nanmedian(pp[:,:],axis=0),hdpr, color='green', lw=2) #plt.plot(np.nanmax(pp[:,:],axis=0),hdpr, color='red', lw=2) #plt.plot(np.nanmin(pp[:,:],axis=0),hdpr, color='red', lw=2) #plt.plot(np.nanmean(pp[:,:],axis=0),hdpr, color='red', lw=2) #plt.plot(np.nanmedian(pp[:,:],axis=0),hdpr, color='green', lw=2) cbar = plt.colorbar() cbar.set_label('#')
color='black', lw=1, ls='--') plt.plot(dpr_lon[:, cut1], dpr_lat[:, cut1], color='red', lw=2, ls='--') plt.plot(dpr_lon[cut2, :], dpr_lat[cut2, :], color='green', lw=2, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50, s=50, color='red') plt.grid() plt.xlim(-350, -100) plt.ylim(-4350, -4100) ##################exit() hhh = hhh / 1000. ax2 = fig.add_subplot(222, aspect='auto') ax2.hist2d(ppp[maske], hhh[maske], bins=30, cmap=get_my_cmap(), vmin=0.1) #plt.plot(np.nanmax(pp[:,:],axis=0),hdpr, color='red', lw=2) ax2.plot(np.nanmean(pp[:, :, :], axis=(0, 1)), hdpr / 1000., color='red', lw=2) plt.plot(np.nanmedian(pp[:, :, :], axis=(0, 1)), hdpr / 1000., color='green', lw=2) cbar = plt.colorbar() cbar.set_label('number of samples') #plt.title('DPR Ref. in Box') plt.xlabel('Reflectivity (dBZ)') plt.ylabel('Height (km)') plt.grid()
import scipy as sp import wradlib as wrl from osgeo import osr from pcc import get_time_of_gpm from pcc import cut_the_swath ## Landgrenzenfunktion ## ------------------- from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] from pcc import plot_borders from pcc import plot_radar from pcc import get_my_cmap my_cmap = get_my_cmap() from pcc import get_my_cmap my_cmap2 = get_my_cmap() GGG = [] RRR = [] from pcc import get_radar_locations from pcc import plot_radar2 def plot_all_cband(ax): for i in get_radar_locations().keys(): plot_radar2(get_radar_locations()[i]['lon'],
cbar = plt.colorbar() cbar.set_label('#' + str(TH), rotation=270) plt.grid() plt.ylabel('y') plt.xlabel('Ref') plt.title('RADOLAN REF Hist') plt.show() maskr = ~np.isnan(r_sat) & ~np.isnan(r_rad) from pcc import get_my_cmap fig = plt.figure(figsize=(12, 12)) ax1 = fig.add_subplot(111, aspect='auto') plt.hist2d(r_sat[maskr], r_rad[maskr], bins=bbb, cmap=get_my_cmap(), vmin=0.1) cbar = plt.colorbar() cbar.set_label('#' + str(TH), rotation=270) plt.grid() plt.xlabel('x') plt.ylabel('Ref') plt.title('GPM NS REF Hist') plt.show() A, B = r_rad[maskr], r_sat[maskr] """ extrema = 40 popo = np.where((A>extrema)&(B>extrema)) fig = plt.figure(figsize=(12,12)) ax1 = fig.add_subplot(111, aspect='auto')
plt.plot(dpr_lon[:,0],dpr_lat[:,0], color='black',lw=1) plt.plot(dpr_lon[:,-1],dpr_lat[:,-1], color='black',lw=1) plt.plot(dpr_lon[:,dpr_lon.shape[1]/2],dpr_lat[:,dpr_lon.shape[1]/2], color='black',lw=1, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50 ,s=50, color='red') plt.grid() plt.xlim(-420,390) plt.ylim(-4700, -3700) ##################exit() hhh = hhh/1000. ax2 = fig.add_subplot(222, aspect='auto') ax2.hist2d(ppp[maske],hhh[maske], bins=30, cmap=get_my_cmap(), vmin=0.1) print pp.shape print ppp.shape #plt.plot(np.nanmax(pp[:,:],axis=0),hdpr, color='red', lw=2) ax2.plot(np.nanmean(pp[:,:,:],axis=(0,1)),hdpr/1000., color='red', lw=2) plt.plot(np.nanmedian(pp[:,:,:],axis=(0,1)),hdpr/1000., color='green', lw=2) cbar = plt.colorbar() cbar.set_label('number of samples') #plt.title('DPR Ref. in Box') plt.xlabel('Reflectivity (dBZ)') plt.ylabel('Height (km)') plt.grid()
t1, t2 = "20170307024500", "20170307025000" x, y, z, bz = read_rado(t1, 'rx') x1, y1, z1, bz1 = read_rado(t2, 'rx') from pcc import get_my_cmap import pcc from scipy import stats, linspace ff = 15 cc = 0.5 fig = plt.figure(figsize=(12,12)) ax1 = fig.add_subplot(221, aspect='equal')#------------------------------------ pm1 = plt.pcolormesh(x, y, z, cmap=get_my_cmap(), vmin=0.01, vmax=50, zorder=2) cb = plt.colorbar(shrink=cc) cb.set_label("Reflectivity [dBZ]",fontsize=ff) cb.ax.tick_params(labelsize=ff) pcc.plot_borders(ax1) plt.title('RADOLAN Reflectivity:\n '+ t1+' UTC',fontsize=ff) plt.grid(color='r') plt.tick_params( axis='both', which='both', bottom='off', top='off', labelbottom='off', right='off',
def gpm_bb(dates, pn=0): zt = dates pfad = ('/automount/ags/velibor/gpmdata/dpr/2A.GPM.DPR.V6-20160118.' + zt + '*.HDF5') dpr_pfad = sorted(glob.glob(pfad))[pn] print dpr_pfad scan = 'NS' #or MS # Einlesen dpr = h5py.File(dpr_pfad, 'r') dpr_lat = np.array(dpr[scan]['Latitude']) dpr_lon = np.array(dpr[scan]['Longitude']) dpr_pp = np.array(dpr[scan]['SLV']['zFactorCorrected']) dpr_pp[dpr_pp < 0] = np.nan dpr_pp_surf = np.array(dpr[scan]['SLV']['zFactorCorrectedNearSurface']) dpr_pp_surf[dpr_pp_surf < 0] = np.nan dpr_bbh = np.array(dpr[scan]['CSF']['heightBB'], dtype=float) dpr_bbh[dpr_bbh < 0] = np.nan dpr_bbw = np.array(dpr[scan]['CSF']['widthBB'], dtype=float) dpr_bbw[dpr_bbw < 0] = np.nan dpr_time = dpr['NS']['ScanTime'] proj_stereo = wrl.georef.create_osr("dwd-radolan") proj_wgs = osr.SpatialReference() proj_wgs.ImportFromEPSG(4326) from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] blat, blon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] dpr_lon, dpr_lat = wradlib.georef.reproject(dpr_lon, dpr_lat, projection_target=proj_stereo, projection_source=proj_wgs) bonnlon, bonnlat = wradlib.georef.reproject(bonnlon, bonnlat, projection_target=proj_stereo, projection_source=proj_wgs) print '-------->', bonnlon, bonnlat lon0, lat0, radius = bonnlon, bonnlat, 100 r = np.sqrt((dpr_lat - lat0)**2 + (dpr_lon - lon0)**2) position = r < radius lat = dpr_lat[position] lon = dpr_lon[position] dpr_pp[np.where(r > radius)] = np.nan pp = dpr_pp dpr_pp_surf[np.where(r > radius)] = np.nan dpr_bbw[np.where(r > radius)] = np.nan dpr_bbh[np.where(r > radius)] = np.nan # Zeitstempel erstellen l2, l1 = -190, -250 k2, k1 = -4210, -4270 # BoxPol #l2, l1 = -110, -320 #k2, k1 = -4130, -4340 # pos = np.where((dpr_lat < k2) & (dpr_lat > k1) & (dpr_lon < l2) & (dpr_lon > l1)) stunde = np.array(dpr_time['Hour'])[pos[0]][0] minute = np.array(dpr_time['Minute'])[pos[0]][0] sekunde = np.array(dpr_time['Second'])[pos[0]][0] jahr = np.array(dpr_time['Year'])[pos[0]][0] monat = np.array(dpr_time['Month'])[pos[0]][0] tag = np.array(dpr_time['DayOfMonth'])[pos[0]][0] zeit = (str(jahr) + '.' + str(monat) + '.' + str(tag) + ' -- ' + str(stunde) + ':' + str(minute) + ':' + str(sekunde)) print zeit h = np.arange(150, 4800, 150) if scan == 'HS': hdpr = 1000 * (np.arange(88, 0, -1) * 0.250) else: hdpr = 1000 * (np.arange(176, 0, -1) * 0.125) hhh = np.array(pp.shape[0] * pp.shape[1] * list(hdpr)) ppp = pp.reshape(pp.shape[0] * pp.shape[1] * pp.shape[2]) maske = ~np.isnan(hhh) & ~np.isnan(ppp) fig = plt.figure(figsize=(14, 12)) zzz = str(jahr) + '-' + str(monat) + '-' + str(tag) + '--' + str( stunde) + ':' + str(minute) + ' UTC' fig.suptitle(zzz + ' UTC') ################### ax1 = fig.add_subplot(221, aspect='auto') #plt.subplot(2,2,1) plt.pcolormesh(dpr_lon, dpr_lat, np.ma.masked_invalid(dpr_pp_surf), vmin=np.nanmin(dpr_pp_surf), vmax=np.nanmax(dpr_pp_surf), cmap=get_miub_cmap()) cbar = plt.colorbar() cbar.set_label('Ref. in dbz') plot_borders(ax1) plot_radar(blon, blat, ax1, reproject=True, cband=False, col='black') plt.plot(dpr_lon[:, 0], dpr_lat[:, 0], color='black', lw=1) plt.plot(dpr_lon[:, -1], dpr_lat[:, -1], color='black', lw=1) plt.plot(dpr_lon[:, dpr_lon.shape[1] / 2], dpr_lat[:, dpr_lon.shape[1] / 2], color='black', lw=1, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50, s=50, color='red') plt.grid() plt.xlim(-420, 390) plt.ylim(-4700, -3700) ################## ax2 = fig.add_subplot(222, aspect='auto') plt.hist2d(ppp[maske], hhh[maske], bins=30, cmap=get_my_cmap(), vmin=0.1) print pp.shape #plt.plot(np.nanmax(pp[:,:],axis=0),hdpr, color='red', lw=2) plt.plot(np.nanmean(pp[:, :, :], axis=(0, 1)), hdpr, color='red', lw=2) plt.plot(np.nanmedian(pp[:, :, :], axis=(0, 1)), hdpr, color='green', lw=2) cbar = plt.colorbar() cbar.set_label('#') plt.title('DPR Ref. in Box') plt.xlabel('Reflectivity in dBZ') plt.grid() plt.xticks() plt.yticks() #plt.ylim(0,6000) #plt.xlim(0,50) ################## #print np.uniforn(bbh) #mini = np.nanmin(bbh[bbh>0]) ax3 = fig.add_subplot(223, aspect='auto') plt.pcolormesh(dpr_lon, dpr_lat, np.ma.masked_invalid(dpr_bbh), vmin=np.nanmin(dpr_bbh[dpr_bbh > 0]), vmax=np.nanmax(dpr_bbh), cmap='jet') cbar = plt.colorbar() cbar.set_label('BB Hight in m') plot_borders(ax3) plot_radar(blon, blat, ax3, reproject=True, cband=False, col='black') plt.plot(dpr_lon[:, 0], dpr_lat[:, 0], color='black', lw=1) plt.plot(dpr_lon[:, -1], dpr_lat[:, -1], color='black', lw=1) plt.plot(dpr_lon[:, dpr_lon.shape[1] / 2], dpr_lat[:, dpr_lon.shape[1] / 2], color='black', lw=1, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50, s=50, color='red') plt.grid() #plt.title('BB Hight') plt.xlim(-420, 390) plt.ylim(-4700, -3700) ################## ax4 = fig.add_subplot(224, aspect='auto') plt.pcolormesh(dpr_lon, dpr_lat, np.ma.masked_invalid(dpr_bbw), vmin=np.nanmin(dpr_bbw[dpr_bbh > 0]), vmax=np.nanmax(dpr_bbw), cmap='jet') cbar = plt.colorbar() cbar.set_label('BB Width in m') plot_borders(ax4) plot_radar(blon, blat, ax4, reproject=True, cband=False, col='black') plt.plot(dpr_lon[:, 0], dpr_lat[:, 0], color='black', lw=1) plt.plot(dpr_lon[:, -1], dpr_lat[:, -1], color='black', lw=1) plt.plot(dpr_lon[:, dpr_lon.shape[1] / 2], dpr_lat[:, dpr_lon.shape[1] / 2], color='black', lw=1, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50, s=50, color='red') plt.grid() #plt.title('BB Width') plt.xlim(-420, 390) plt.ylim(-4700, -3700) plt.tight_layout() plt.show()
from pcc import get_time_of_gpm from pcc import cut_the_swath ## Landgrenzenfunktion ## ------------------- from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] from pcc import plot_borders from pcc import plot_radar #from pcc import get_miub_cmap #my_cmap = get_miub_cmap() from pcc import get_my_cmap my_cmap = get_my_cmap() GGG = [] RRR = [] #Alle Zeitpunkte #''' zz = np.array([20140826])#, #20141016, 20150128, 20150227, 20150402, 20150427, 20160405, #20160607, 20160805, 20160904, 20160917, 20161001, 20161024, #20170113, 20170203,20170223]) #''' #Alle rz rx zeitpunkte #zz = np.array([20140921, 20141007,20140826, # 20141016, 20150128, 20150227, 20150402, 20150427]) #zz = np.array([20170223])
from pcc import get_time_of_gpm from pcc import cut_the_swath ## Landgrenzenfunktion ## ------------------- from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] from pcc import plot_borders from pcc import plot_radar #from pcc import get_miub_cmap #my_cmap = get_miub_cmap() from pcc import get_my_cmap my_cmap = get_my_cmap() GGG = [] RRR = [] #Alle Zeitpunkte #''' zz = np.array([20140826]) #, #20141016, 20150128, 20150227, 20150402, 20150427, 20160405, #20160607, 20160805, 20160904, 20160917, 20161001, 20161024, #20170113, 20170203,20170223]) #''' #Alle rz rx zeitpunkte #zz = np.array([20140921, 20141007,20140826, # 20141016, 20150128, 20150227, 20150402, 20150427]) #zz = np.array([20170223])
## Landgrenzenfunktion ## ------------------- from pcc import boxpol_pos bonn_pos = boxpol_pos() bx, by = bonn_pos['gkx_ppi'], bonn_pos['gky_ppi'] bonnlat, bonnlon = bonn_pos['lat_ppi'], bonn_pos['lon_ppi'] from pcc import plot_borders from pcc import plot_radar from pcc import get_miub_cmap my_cmap = get_miub_cmap() from pcc import get_my_cmap my_cmap2 = get_my_cmap() ZP = '20141007' year, m, d = ZP[0:4], ZP[4:6], ZP[6:8] ye = ZP[2:4] ## Read GPM Data ## ------------- pfad2 = ('/home/velibor/shkgpm/data/' + str(year) + str(m) + str(d) + '/dpr/*.HDF5') pfad_gpm = glob.glob(pfad2) pfad_gpm_g = pfad_gpm[0] # GPM Lage und Zeit gpmdpr = h5py.File(pfad_gpm_g, 'r')
plt.plot(dpr_lon[:, dpr_lon.shape[1] / 2], dpr_lat[:, dpr_lon.shape[1] / 2], color='black', lw=1, ls='--') ax1 = plt.scatter(bonnlon, bonnlat, c=50, s=50, color='red') plt.grid() plt.xlim(-420, 390) plt.ylim(-4700, -3700) ##################exit() hhh = hhh / 1000. ax2 = fig.add_subplot(222, aspect='auto') ax2.hist2d(ppp[maske], hhh[maske], bins=30, cmap=get_my_cmap(), vmin=0.1) print pp.shape print ppp.shape #plt.plot(np.nanmax(pp[:,:],axis=0),hdpr, color='red', lw=2) ax2.plot(np.nanmean(pp[:, :, :], axis=(0, 1)), hdpr / 1000., color='red', lw=2) plt.plot(np.nanmedian(pp[:, :, :], axis=(0, 1)), hdpr / 1000., color='green', lw=2) cbar = plt.colorbar() cbar.set_label('number of samples') #plt.title('DPR Ref. in Box')
#df[np.where(df['N']<300)] = np.nan# A = df['r_value'].values.copy() B = df['std_err'].values.copy() C = df['H'].values.copy() T = 100 A[np.where(C<T)] = np.nan B[np.where(C<T)] = np.nan C[np.where(C<T)] = np.nan from pcc import get_my_cmap plt.errorbar(range(0,len(A)),A, B, fmt='o', zorder=1, color='grey') plt.scatter(range(0,len(A)),A,c=C,s=300,linewidths=0.001, vmin=T, vmax=1000, cmap=get_my_cmap(), zorder=2) cb = plt.colorbar(shrink=0.5) cb.set_label("Hits in #",fontsize=ff) cb.ax.tick_params(labelsize=ff) plt.ylim(-1,1) plt.xlim(0,len(A)) plt.grid() plt.ylabel('Correlation',fontsize=ff) plt.xlabel('overpasses with time',fontsize=ff) plt.title('Overpass statistics betwen DPR and RADOLAN, \n Threshold: N = '+str(T),fontsize=ff) plt.show() dataframes = [df, df2] names = ['RADOLAN','BoXPol'] for j in range(2):