In [2]:
# Load the needed packages
from glob import glob
import os
import matplotlib.pyplot as plt
from awot.io import read_p3_radar
from awot.graph.common import create_basemap
from awot.graph import RadarHorizontalPlot
from awot.graph import FlightLevel
%matplotlib inline
Set variables
In [3]:
# Set some required information
# Choose the date of flight and module name
yymmdd, modn = '030610', '0528hn'
# Set the project name
Project="BAMEX"
# Set Directory path for data
fDir = "/Users/guy/data/bamex/radar"
# Construct the full path name for windsyn NetCDF file
P3Radf = fDir+modn+"hn"
In [4]:
# Set map projection to use
proj = 'cea'
Wbarb_Spacing = 300 # Spacing of wind barbs along flight path (sec)
# Choose the X-axis time step (in seconds) where major labels will be
XlabStride = 3600
start_time = "2003-06-10 05:28:00"
end_time = "2003-06-10 05:38:00"
corners = [-96.5, 40.0, -95., 41.5]
# Set the lon/lat spacing for basemap
dLon = 0.3
dLat = 0.3
Create a map plot
In [5]:
# Creating axes outside seems to screw up basemap
fig, ax = plt.subplots(1, 1, figsize=(7, 7))
# Get the tail radar data
# When the binary file_format is selected AWOT looks for a .dpw and .hdr file,
# both of which are produced by windsyn and are needed for program to work properly
r = read_p3_radar.read_windsyn_binary(os.path.join(fDir,modn))
# Set the map for plotting
bm = create_basemap(proj=proj, resolution='l', area_thresh=1.,corners=corners,
lat_spacing=dLat, lon_spacing=dLon, ax=ax)
# Create a RadarGrid
rgp = RadarHorizontalPlot(r, basemap=bm)
rgp.plot_cappi('reflectivity', 2., vmin=15., vmax=60.,
color_bar=True, cb_pad="10%")#, ax=fl.basemap.ax)
In [6]:
# Creating axes outside seems to screw up basemap
fig, ax = plt.subplots(1, 1, figsize=(7, 7))
# Get the tail radar data
# When the binary file_format is selected AWOT looks for a .dpw and .hdr file,
# both of which are produced by windsyn and are needed for program to work properly
r = read_p3_radar.read_windsyn_binary(os.path.join(fDir,modn))
# Set the map for plotting
bm = create_basemap(proj=proj, resolution='l', area_thresh=1.,corners=corners,
lat_spacing=dLat, lon_spacing=dLon, ax=ax)
# Create a RadarGrid
rgp = RadarHorizontalPlot(r, basemap=bm)
rgp.plot_cappi('reflectivity', 2., vmin=15., vmax=60., color_bar=True, cb_pad="10%",
save_kmz=True)