import matplotlib.pyplot as plt
from disser.io import NetCDFRadarData
from disser.plots import get_cmap
from disser import datatypes
import disser.plots.defaults as defaults

data = NetCDFRadarData('Sband_3600_20111010_210552.nc')

datatypes.TypePlotInfo[datatypes.Reflectivity].update(cmap=get_cmap('ScharfRefScaled'),
    norm=plt.Normalize(-20, 80))

moments = [data.fields.grab(moment, pol='H', source=src)
           for src in ('ts', 'average') for moment in (datatypes.Reflectivity,
           datatypes.DopplerVelocity, datatypes.SpectrumWidth)]

fig = plt.figure()

grid = defaults.multipanel_cbar_column(fig, (2,3), moments, data)
ax = grid[0]

ax.xaxis.set_major_locator(plt.MultipleLocator(10))
ax.set_ylim(0, 50)
ax.set_xlim(-20, 20)

plt.show()
import numpy as np
import matplotlib.pyplot as plt
import quantities as pq
from disser.io import NetCDFRadarData
from disser.plots import PPIPlot, get_cmap
from disser import datatypes

data = NetCDFRadarData("Sband_3600_20111010_210552.nc")

rings = np.arange(10, 60, 10) * pq.kilometer

datatypes.TypePlotInfo.set_defaults(cmap=get_cmap("Carbone42"))
datatypes.TypePlotInfo[datatypes.Reflectivity] = dict(norm=plt.Normalize(-30, 80), cmap=get_cmap("Carbone42"))

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.set_aspect("equal", "datalim")
varinfo = data.fields.grab(datatypes.Reflectivity, pol="V", source="ts")
ppi = PPIPlot(data.fields, var=varinfo, ax=ax, rings=rings, labels=[])
plt.show()
Exemple #3
0
import disser.plots.defaults as defaults
from disser import plots, datatypes, atten

# <codecell>

AttenDelta = datatypes.DataType('Attenuation Difference', r'$\Delta A$')
SpecAttenDelta = datatypes.DataType('Specific Attenuation Difference', r'$\Delta \alpha$')
DiffAttenDelta = datatypes.DataType('Differential Attenuation Difference', r'$\Delta A_D$')
SpecDiffAttenDelta = datatypes.DataType('Specific Differential Attenuation Difference', r'$\Delta \alpha_D$')
PhiDelta = datatypes.DataType('Differential Phase Difference', r'$\Delta \Phi_{DP}$')

# <codecell>

#bidi_cmap = plt.get_cmap('Spectral')
bidi_cmap = plots.get_cmap('Carbone42')
datatypes.TypePlotInfo[AttenDelta].update(norm=plt.Normalize(-10, 10), cmap=bidi_cmap)
datatypes.TypePlotInfo[SpecAttenDelta].update(norm=plt.Normalize(-1, 1), cmap=bidi_cmap)
datatypes.TypePlotInfo[DiffAttenDelta].update(norm=plt.Normalize(-2, 2), cmap=bidi_cmap)
datatypes.TypePlotInfo[SpecDiffAttenDelta].update(norm=plt.Normalize(-0.5, 0.5), cmap=bidi_cmap)
datatypes.TypePlotInfo[PhiDelta].update(norm=plt.Normalize(-50, 50), cmap=bidi_cmap)

# <headingcell level=2>

# Attenuation Algorithm Results

# <codecell>

def run_attenuation_algs(data):
    from disser.atten import attenAlgs
    attenAlgs.runAll(data, var='H')