Beispiel #1
0
                       hydroset='', suffix='radar_regrid.h5', minhour=6.0,
                       varlist=['Z10', 'Z35', 'Z94', 'T',
                                'W10', 'W35', 'W94', 'quality_x', 'quality_w'])

radarw = slice_data(radar, 'quality_w', maxvalue=8192)
radarx = slice_data(radar, 'quality_x', maxvalue=8192)

logrule = True
density = False
CFAD = True
inverty = True
bins = 100
stats = ['mean', 'median', 'quartile']

r = hist_and_plot(pamtra, 'Simulated CFAD   T - SW',
                              yvar='T', xvar='W35',
                              xlabel='Spectral Width Ka   [m/s]', ylabel='T   [K]',
                              vminmax=[0.1, 40],
                              xlim=[0, 3], ylim=[-30, 10], lognorm=logrule,
                              savename='pamtra_T_SWk.png',
                              inverty=inverty, figax=None, stats=stats,
                              bins=bins, density=density, CFAD=CFAD)

r = hist_and_plot(radar, 'Measured CFAD   T- SW',
                              yvar='T', xvar='W35',
                              xlabel='Spectral Width Ka   [m/s]', ylabel='T   [K]',
                              vminmax=[0.1, 40],
                              xlim=[0, 3], ylim=[-30, 10], lognorm=logrule,
                              savename='radar_T_SWk.png',
                              inverty=inverty, figax=None, stats=stats,
                              bins=bins, density=density, CFAD=CFAD)
#%% Z CFAD Height
lognormrule = True
density = True
bins = 50
stats = ['mean', 'median', 'quartile']

r = hist_and_plot(pamtra,
                  'CFAD Zx hgt',
                  yvar='Hgt',
                  xvar='Z10',
                  xlabel='Zx   [dBZ]',
                  ylabel='Hgt   [m]',
                  vminmax=[0.1, 100],
                  xlim=[-60, 50],
                  ylim=[0, 12000],
                  lognorm=lognormrule,
                  savename='pamtraCFAD_Zx_H.png',
                  inverty=False,
                  figax=None,
                  stats=stats,
                  bins=(bins, icon150heights[::-1]),
                  density=density,
                  CFAD=True)

r = hist_and_plot(pamtra,
                  'CFAD Zk hgt',
                  yvar='Hgt',
                  xvar='Z35',
                  xlabel='Zk   [dBZ]',
                  ylabel='Hgt   [m]',
Beispiel #3
0
logrule = True
density = True
CFAD = True
bins = (np.arange(-5, 15, 0.35), np.arange(-45, 1, 0.6))
vminmax = [0.1, 20]
stats = ['mean', 'median', 'quartile', 'decile']

r = hist_and_plot(pamtra,
                  'Simulated CFAD T - DWRxk',
                  yvar='T',
                  xvar='DWRxk',
                  xlabel='DWRxk   [dB]',
                  ylabel='T   [deg C]',
                  vminmax=vminmax,
                  xlim=[-5, 15],
                  ylim=[-30, 0],
                  lognorm=logrule,
                  savename='pamtra_T_DWRxk.png',
                  inverty=True,
                  figax=None,
                  stats=stats,
                  bins=bins,
                  density=density,
                  CFAD=CFAD)

r = hist_and_plot(radarx,
                  'Measured CFAD T - DWRxk',
                  yvar='T',
                  xvar='DWRxk',
                  xlabel='DWRxk   [dB]',
                  ylabel='T   [deg C]',
Beispiel #4
0
bins = 100
stats = ['mean', 'median', 'quartile']

pamtra = slice_data(pamtra, 'DWRkw', maxvalue=4)
ice = slice_data(ice, 'DWRkw', maxvalue=4)
snow = slice_data(snow, 'DWRkw', maxvalue=4)
radar = slice_data(radar, 'DWRkw', maxvalue=4)

r = hist_and_plot(
    slice_data(pamtra, 'T', maxvalue=-2),
    'Simulated MDVk - Zk',
    yvar='V35',
    xvar='Z35',
    xlabel='Zk   [dBZ]',
    ylabel='MDV Ka   [m/s]',  #vminmax=[0.1, 100],
    xlim=[-40, 30],
    ylim=[-2, 1],
    lognorm=lognormrule,
    savename='pamtra_Vk_Zk.png',
    inverty=False,
    figax=None,
    bins=bins,
    density=density,
    CFAD=CFAD)

r = hist_and_plot(
    slice_data(ice, 'T', maxvalue=-2),
    'Simulated MDVk - Zk only ICE',
    yvar='V35',
    xvar='Z35',
    xlabel='Zk   [dBZ]',
    ylabel='MDV Ka   [m/s]',  #vminmax=[0.1, 100],
Beispiel #5
0
    N[~np.isfinite(N)] = np.nan
    df['N'] = N
    df.dropna(inplace=True, subset=['Ze'])
    df.to_hdf('joyrad94snr.h5', key='stat', mode='a', append=True)

print('done')
df = pd.read_hdf('joyrad94snr.h5', key='stat')
df['SNR'] = df['Ze'] - df['N']
hist_and_plot(df.dropna(subset=['SNR']),
              'SNR Joyrad94',
              yvar='Hgt',
              xvar='SNR',
              xlabel='SNRW   [dB]',
              ylabel='Hgt   [m]',
              xlim=[-30, 60],
              ylim=[0, 12000],
              lognorm=True,
              savename='SNRw.png',
              inverty=False,
              figax=None,
              bins=100,
              density=False,
              CFAD=False)

hist_and_plot(df.dropna(subset=['N']),
              'Noise Joyrad94',
              yvar='Hgt',
              xvar='N',
              xlabel='NoiseW   [dB]',
              ylabel='Hgt   [m]',
              xlim=[-60, -10],
Beispiel #6
0
density = False
CFAD = False
inverty = True
bins = 100
lw = 3

vminmax = [1e2, 7e5]
pamtra = slice_data(pamtra, 'Z10', -14)
r = hist_and_plot(slice_data(pamtra, 'T', -20, -5),
                  'Simulated -20<T<-5',
                  yvar='V35',
                  xvar='DWRxk',
                  xlabel='DWRxk   [dB]',
                  ylabel='MDV   [m/s]',
                  vminmax=vminmax,
                  xlim=[-5, 15],
                  ylim=[-3, 0],
                  lognorm=logrule,
                  savename='pamtra_Vk_DWRxk.png',
                  inverty=inverty,
                  figax=None,
                  bins=bins,
                  density=density,
                  CFAD=CFAD)
plt.gca().set_prop_cycle(color=colors[1:])
plt.plot(Zi[:, 0] - Zi[:, 1], -Vi[:, 0], label='ice crystals', lw=lw)
plt.plot(Zr[:, 0] - Zr[:, 1], -Vr[:, 0], label='raindrops', lw=lw)
plt.plot(Zs[:, 0] - Zs[:, 1], -Vs[:, 0], label='snowflakes', lw=lw)
plt.plot(Zg[:, 0] - Zg[:, 1], -Vg[:, 0], label='graupel', lw=lw)
plt.plot(Zh[:, 0] - Zh[:, 1], -Vh[:, 0], label='hail', lw=lw)
plt.savefig('pamtra_Vk_DWRxk.png', dpi=300)
Beispiel #7
0
  pamtra[col] = pam[col].values

radarw = slice_data(radar, 'quality_w', maxvalue=8192)
radarx = slice_data(radar, 'quality_x', maxvalue=8192)

logrule = True
density = False
CFAD = True
inverty = True
bins = 100
stats = ['mean', 'median', 'quartile', 'decile']

r = hist_and_plot(pamtra, 'Simulated CFAD   T - MDV',
                              yvar='T', xvar='V35',
                              xlabel='MDV ka   [m/s]', ylabel='T   [K]',
                              vminmax=[0.1, 30],
                              xlim=[-5, 1], ylim=[-30, 10], lognorm=logrule,
                              savename='pamtra_T_Vk.png',
                              inverty=inverty, figax=None, stats=stats,
                              bins=bins, density=density, CFAD=CFAD)

r = hist_and_plot(radar, 'Measured CFAD   T- MDV',
                              yvar='T', xvar='V35m5',
                              xlabel='MDV ka   [m/s]', ylabel='T   [K]',
                              vminmax=[0.1, 30],
                              xlim=[-5, 1], ylim=[-30, 10], lognorm=logrule,
                              savename='radar_T_Vk.png',
                              inverty=inverty, figax=None, stats=stats,
                              bins=bins, density=density, CFAD=CFAD)

r = hist_and_plot(pamtra, 'Simulated CFAD   T - SW',
                              yvar='T', xvar='W35',
Beispiel #8
0
pamtra['SWa'] = qN2SWa(pamtra['QR'], pamtra['QNR'])
pamtra['SKa'] = qN2SKa(pamtra['QR'], pamtra['QNR'])

f, ((ax11, ax12), (ax21, ax22), (ax31, ax32)) = plt.subplots(3,
                                                             2,
                                                             figsize=(10.5,
                                                                      9.))
r = hist_and_plot(slice_data(pamtra, 'RR', minvalue=minRR, left=True),
                  'Simulated MDV Ka',
                  yvar='T',
                  xvar='V35',
                  xlabel='MDV   [m/s]',
                  ylabel='T   [deg C]',
                  vminmax=[0.1, 30],
                  xlim=[-10, 0],
                  ylim=[0, 10],
                  lognorm=logrule,
                  savename=pre + 'pamRad_T_VSD.png',
                  inverty=inverty,
                  figax=(f, ax11),
                  stats=stats,
                  bins=bins,
                  density=density,
                  CFAD=CFAD)

r = hist_and_plot(slice_data(radar, 'RR', minvalue=minRR, left=True),
                  'Measured MDV Ka',
                  yvar='T',
                  xvar='V35avg',
                  xlabel='MDV   [m/s]',
                  ylabel='T   [deg C]',
Beispiel #9
0
radar = read_radar(campaign=campaign, minhour=minhour, avg='_avg')
radarw = slice_data(radar, 'quality_w', maxvalue=8192)
radarx = slice_data(radar, 'quality_x', maxvalue=8192)
radarxw = slice_data(radarw, 'quality_x', maxvalue=8192)
#%% Triple frequency
xlim = [-5, 20]
ylim = [-5, 20]
lw = 3
hist_and_plot(pamtra,
              '3f plot all',
              yvar='DWRxk',
              xvar='DWRkw',
              xlabel='DWR Ka W   [dB]',
              ylabel='DWR X Ka   [dB]',
              xlim=xlim,
              ylim=ylim,
              lognorm=lognormrule,
              savename='ISTP/pamtra3f_all.png',
              inverty=False,
              figax=None,
              bins=100,
              density=False,
              CFAD=False)
plt.plot(Zc[:, 1] - Zc[:, 2],
         Zc[:, 0] - Zc[:, 1],
         label='cloud droplets',
         lw=lw)
plt.plot(Zi[:, 1] - Zi[:, 2], Zi[:, 0] - Zi[:, 1], label='ice crystals', lw=lw)
plt.plot(Zr[:, 1] - Zr[:, 2], Zr[:, 0] - Zr[:, 1], label='raindrops', lw=lw)
plt.plot(Zs[:, 1] - Zs[:, 2], Zs[:, 0] - Zs[:, 1], label='snowflakes', lw=lw)
plt.plot(Zg[:, 1] - Zg[:, 2], Zg[:, 0] - Zg[:, 1], label='graupel', lw=lw)
    suffix='pamtra_icon.h5',
    varlist=varlist,
    minhour=6.0)

#pamtra[pamtra==9999.0] = np.nan
lognormrule = True
data = 1.0 * pamtra  #slice_data(pamtra, 'DWRxk', maxvalue=-2)

hxk, xxk, yxk = hist_and_plot(data,
                              'Nx Nk',
                              yvar='N10',
                              xvar='N35',
                              xlim=[-100, 100],
                              ylim=[-100, 100],
                              xlabel='Nx',
                              ylabel='Nk',
                              lognorm=lognormrule,
                              savename='pamtra3f_Nxk.png',
                              inverty=False,
                              figax=None,
                              bins=100,
                              density=False,
                              CFAD=False)

hkw, xkw, ykw = hist_and_plot(data,
                              'Nk Nw',
                              yvar='N35',
                              xvar='N94',
                              xlim=[-100, 100],
                              ylim=[-100, 100],
                              xlabel='Nk',
rad = slice_data(rad, 'maxDWRxk', maxvalue=13.5)
rpu = slice_data(rpu, 'maxDWRxk', maxvalue=13.5)

pam = slice_data(pam, 'maxDWRkw', maxvalue=13.5)
rad = slice_data(rad, 'maxDWRkw', maxvalue=13.5)
rpu = slice_data(rpu, 'maxDWRkw', maxvalue=13.5)

r = hist_and_plot(pam,
                  'Simulated Cloud Top Temperature - max DWRkw',
                  yvar='CTT',
                  xvar='maxDWRkw',
                  xlabel='max DWRkw   [dB]',
                  ylabel='CTT   [deg C]',
                  vminmax=vminmax,
                  xlim=[0, 20],
                  ylim=[-60, -10],
                  lognorm=logrule,
                  savename='pam_CTT_DWRkw.png',
                  inverty=inverty,
                  figax=None,
                  stats=stats,
                  bins=bins,
                  density=density,
                  CFAD=CFAD)

r = hist_and_plot(rad,
                  'Measured Regridded Cloud Top Temperature - max DWRkw',
                  yvar='CTT',
                  xvar='maxDWRkw',
                  xlabel='max DWRkw   [dB]',
                  ylabel='CTT   [deg C]',
Beispiel #12
0
radarw = slice_data(radar, 'quality_w', maxvalue=8192)
radarx = slice_data(radar, 'quality_x', maxvalue=8192)
radarxw = slice_data(radarw, 'quality_x', maxvalue=8192)

#%% Triple frequency
xlim = [-10, 20]
ylim = [-10, 20]
lw = 3
r = hist_and_plot(slice_data(pamtra, 'Z10', minvalue=-2),
                  '3f plot all',
                  yvar='DWRxk',
                  xvar='DWRkw',
                  xlabel='DWR Ka W   [dB]',
                  ylabel='DWR X Ka   [dB]',
                  xlim=xlim,
                  ylim=ylim,
                  lognorm=lognormrule,
                  savename='pamtra3f_all.png',
                  inverty=False,
                  figax=None,
                  bins=100,
                  density=True,
                  CFAD=False)
plt.plot(Zc[:, 1] - Zc[:, 2],
         Zc[:, 0] - Zc[:, 1],
         label='cloud droplets',
         lw=lw)
plt.plot(Zi[:, 1] - Zi[:, 2], Zi[:, 0] - Zi[:, 1], label='ice crystals', lw=lw)
plt.plot(Zr[:, 1] - Zr[:, 2], Zr[:, 0] - Zr[:, 1], label='raindrops', lw=lw)
plt.plot(Zs[:, 1] - Zs[:, 2], Zs[:, 0] - Zs[:, 1], label='snowflakes', lw=lw)
plt.plot(Zg[:, 1] - Zg[:, 2], Zg[:, 0] - Zg[:, 1], label='graupel', lw=lw)
Beispiel #13
0
pamtra['QNS'] = np.log10(pamtra['QNS'])
pamtra['QI'] = np.log10(pamtra['QI'])
pamtra['QS'] = np.log10(pamtra['QS'])
pamtra[~np.isfinite(pamtra)] = np.nan

data = 1.0 * pamtra  #slice_data(pamtra, 'DWRxk', maxvalue=-2)
#data = slice_data(pamtra, 'DWRxk', maxvalue=-2)

h, x, y = hist_and_plot(data,
                        '3f plot all',
                        yvar='QI',
                        xvar='QNI',
                        xlim=[-300, 0],
                        ylim=[-300, 0],
                        xlabel='QI',
                        ylabel='QNI',
                        lognorm=lognormrule,
                        savename='pamtra3f_ice.png',
                        inverty=False,
                        figax=None,
                        bins=100,
                        density=False,
                        CFAD=False)

h, x, y = hist_and_plot(data,
                        '3f plot all',
                        yvar='QS',
                        xvar='QNS',
                        xlim=[-300, 0],
                        ylim=[-300, 0],
                        xlabel='QS',