====================================================

An example which creates a plot containing multiple moments taken from a
NEXRAD Archive file.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data

filename = get_test_data('KATX20130717_195021_V06')
radar = pyart.io.read_nexrad_archive(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=(10, 10))

ax = fig.add_subplot(221)
display.plot('velocity',
             1,
             ax=ax,
             title='Doppler Velocity',
             colorbar_label='',
             axislabels=('', 'North South distance from radar (km)'))
display.set_limits((-300, 300), (-300, 300), ax=ax)

ax = fig.add_subplot(222)
display.plot('differential_reflectivity',
Example #2
0
"""
=================================
Create a RHI plot from a MDV file
=================================

An example which creates a RHI plot of a MDV file using a RadarDisplay object.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data

filename = get_test_data('110041.mdv')

# create the plot using RadarDisplay
radar = pyart.io.read_mdv(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=[5, 5])
ax = fig.add_subplot(111)
display.plot('reflectivity', 0, vmin=-16, vmax=64.0)
plt.show()
Map the reflectivity field of a single radar from Antenna coordinates to a
Cartesian grid.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import numpy as np
import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data

# read in the data
file = get_test_data('110635.mdv')
radar = pyart.io.read_mdv(file)

# mask out last 10 gates of each ray, this removes the "ring" around the radar.
radar.fields['reflectivity']['data'][:, -10:] = np.ma.masked

# exclude masked gates from the gridding
gatefilter = pyart.filters.GateFilter(radar)
gatefilter.exclude_transition()
gatefilter.exclude_masked('reflectivity')

# perform Cartesian mapping, limit to the reflectivity field.
grid = pyart.map.grid_from_radars(
    (radar,), gatefilters=(gatefilter, ),
    grid_shape=(1, 241, 241),
    grid_limits=((2000, 2000), (-123000.0, 123000.0), (-123000.0, 123000.0)),
An example which creates an RHI plot of reflectivity using a RadarDisplay object
and adding differnential Reflectivity contours from the same MDV file.

"""
print(__doc__)

# Author: Cory Weber ([email protected])
# License: BSD 3 clause
import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data
import numpy as np
import scipy.ndimage as ndimage

filename = get_test_data('220629.mdv')

# create the plot using RadarDisplay
sweep = 0
# read file
radar = pyart.io.read_mdv(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=[20, 5])
ax = fig.add_subplot(111)

# plot reflectivity
# alpha=0.25 sets the transparency of the pcolormesh to 75% transparent against
# the default white. matplolib overlaps the edges of the pcolormesh and creates
# a visable border around the edge, even with the default of edgecolor set to
# 'none' the transparancy is effected. the flowing paramters are designed to
# compensate for that:
Example #5
0
In this example doppler velocities are dealiased using the Univ. of
Washington FourDD algorithm implemented in Py-ART.  Sounding data is
used for the initial condition of the dealiasing.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import netCDF4
import pyart
from pyart.testing import get_test_data

radar_file = get_test_data('095636.mdv')
sonde_file = get_test_data('sgpinterpolatedsondeC1.c1.20110510.000000.cdf')

# read in the data
radar = pyart.io.read_mdv(radar_file)

# read in sonde data
dt, profile = pyart.io.read_arm_sonde_vap(sonde_file, radar=radar)

# create a gate filter which specifies gates to exclude from dealiasing
gatefilter = pyart.filters.GateFilter(radar)
gatefilter.exclude_transition()
gatefilter.exclude_invalid('velocity')
gatefilter.exclude_invalid('reflectivity')
gatefilter.exclude_outside('reflectivity', 0, 80)
Example #6
0
"""

print(__doc__)

#Author: Jason Hemedinger
#License: BSD 3 clause

import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import pyart
from pyart.testing import get_test_data

# Read in the file, create a RadarMapDisplay object
filename = get_test_data('nsaxsaprppiC1.a1.20140201.184802.nc')
radar = pyart.io.read(filename)
display = pyart.graph.RadarMapDisplay(radar)

# Setting projection and ploting the second tilt
projection = ccrs.LambertConformal(
    central_latitude=radar.latitude['data'][0],
    central_longitude=radar.longitude['data'][0])

fig = plt.figure(figsize=(6, 6))
display.plot_ppi_map('reflectivity_horizontal',
                     1,
                     vmin=-20,
                     vmax=20,
                     min_lon=-157.1,
                     max_lon=-156,
Example #7
0
An example which creates a two panel RHI plot of a Sigmet file.  The fields
included in the two panels are reflectivity and doppler velocity.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data
import netCDF4

# read the data and create the display object
filename = get_test_data('XSW110520113537.RAW7HHL')
radar = pyart.io.read_rsl(filename)
display = pyart.graph.RadarDisplay(radar)

# fields to plot and ranges
fields_to_plot = ['reflectivity', 'velocity']
ranges = [(-32, 64), (-17.0, 17.0)]

# plot the data
nplots = len(fields_to_plot)
plt.figure(figsize=[5 * nplots, 4])

# plot each field
for plot_num in range(nplots):
    field = fields_to_plot[plot_num]
    vmin, vmax = ranges[plot_num]
An example which creates an RHI plot of velocity using a RadarDisplay object
and adding Reflectivity contours from the same MDV file.

"""
print(__doc__)

# Author: Cory Weber ([email protected])
# License: BSD 3 clause
import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data
import numpy as np
import scipy.ndimage as spyi

filename = get_test_data('034142.mdv')

# create the plot using RadarDisplay
sweep = 2
# read file
radar = pyart.io.read_mdv(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=[20, 5])
ax = fig.add_subplot(111)

# plot velocity
# cmap is the color ramp being used in this case blue to red no 18
# https://github.com/ARM-DOE/pyart/blob/master/pyart/graph/cm.py
# for more information

display.plot('velocity',
"""

print(__doc__)

# Author: Jason Hemedinger
# License: BSD 3 clause

import cartopy.crs as ccrs
import numpy as np
import matplotlib.pyplot as plt

import pyart
from pyart.testing import get_test_data

# Read in the gridded file, create GridMapDisplay object
filename = get_test_data('20110520100000_nexrad_grid.nc')
radar = pyart.io.read_grid(filename)
display = pyart.graph.GridMapDisplay(radar)

# Setting projection, figure size, and panel sizes.
projection = ccrs.PlateCarree()

fig = plt.figure(figsize=[15, 7])

map_panel_axes = [0.05, 0.05, .4, .80]
x_cut_panel_axes = [0.55, 0.10, .4, .25]
y_cut_panel_axes = [0.55, 0.50, .4, .25]

# Set parameters.
level = 1
vmin = -8
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np
import warnings

import pyart
from pyart.testing import get_test_data
warnings.filterwarnings("ignore")

######################################
# **Read in the Data**
#
# For this example, we use two XSAPR radars from our test data.

# read in the data from both XSAPR radars
xsapr_sw_file = get_test_data('swx_20120520_0641.nc')
xsapr_se_file = get_test_data('sex_20120520_0641.nc')
radar_sw = pyart.io.read_cfradial(xsapr_sw_file)
radar_se = pyart.io.read_cfradial(xsapr_se_file)

######################################
# **Filter and Configure the GateMapper**
#
# We are interested in mapping the southwestern radar to the
# southeastern radar. Before running our gatemapper, we add a
# filter for only positive reflectivity values.
# We also need to set a distance (meters) and time (seconds)
# between the source and destination gate allowed for an
# adequate match), using the distance_tolerance/time_tolerance variables.

gatefilter = pyart.filters.GateFilter(radar_sw)
Example #11
0
"""
====================================
Create a PPI plot from a Sigmet file
====================================

An example which creates a PPI plot of a Sigmet file.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data

filename = get_test_data('XSW110520105408.RAW7HHF')

# create the plot using RadarDisplay (recommended method)
radar = pyart.io.read_rsl(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure()
ax = fig.add_subplot(111)
display.plot('reflectivity', 0, vmin=-32, vmax=64.)
display.plot_range_rings([10, 20, 30, 40])
display.plot_cross_hair(5.)
plt.show()
Example #12
0
An example which creates a plot containing the first collected scan from a
NEXRAD file.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import pyart
from pyart.testing import get_test_data

# open the file, create the displays and figure
filename = get_test_data('Level2_KATX_20130717_1950.ar2v')
radar = pyart.io.read_nexrad_archive(filename)
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=(6, 5))

# plot super resolution reflectivity
ax = fig.add_subplot(111)
display.plot('reflectivity',
             0,
             title='NEXRAD Reflectivity',
             vmin=-32,
             vmax=64,
             colorbar_label='',
             ax=ax)
display.plot_range_ring(radar.range['data'][-1] / 1000., ax=ax)
display.set_limits(xlim=(-500, 500), ylim=(-500, 500), ax=ax)
Example #13
0
An example which creates a multiple panel RHI plot of a CF/Radial file using
a RadarDisplay object.

"""
print(__doc__)

# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause

import matplotlib.pyplot as plt
import netCDF4
import pyart
from pyart.testing import get_test_data

filename = get_test_data('sgpxsaprrhicmacI5.c0.20110524.015604_NC4.nc')

# create the plot using RadarDisplay
radar = pyart.io.read_cfradial(filename)
radar.metadata['instrument_name'] = 'XSARP'
display = pyart.graph.RadarDisplay(radar)

fig = plt.figure(figsize=[12, 17])
fig.subplots_adjust(hspace=0.4)
xlabel = 'Distance from radar (km)'
ylabel = 'Height agl (km)'
colorbar_label = 'Hz. Eq. Refl. Fac. (dBZ)'
nplots = radar.nsweeps

for snum in radar.sweep_number['data']: