%pylab inline
import datetime as dt
from davitpy.models import raydarn
Populating the interactive namespace from numpy and matplotlib
sTime = dt.datetime(2006, 2, 22, 22)
eTime = dt.datetime(2006, 2, 23, 5)
radar = 'wal'
beam = 3
freq = 10.5
# Run the ray tracing for the specified period, radar, beam and frequency
# Use 4 threads (MPI) and output everything to /tmp
rto = raydarn.RtRun(sTime, eTime,
rCode=radar, beam=beam, freq=freq,
outDir='/tmp', nprocs=4)
# Read rays into memory
rto.readRays()
# Plot rays with refractive index color scale
# Plot 1 ray in 10 (1deg increment)
# Plot at start time
figure(figsize=(15,5))
rcParams.update({'font.size': 14})
ax, aax, cbax = rto.rays.plot(sTime,
step=10, showrefract=True, nr_lim=[.85,1])
ax.grid()
/usr/local/lib/python2.7/dist-packages/matplotlib/text.py:52: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if rotation in ('horizontal', None): /usr/local/lib/python2.7/dist-packages/matplotlib/text.py:54: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal elif rotation == 'vertical':
# Read electron densities into memory
rto.readEdens()
# Plot rays and electron densities together
# Plot at start time
# Plot range markers (every 250 km)
figure(figsize=(15,5))
rcParams.update({'font.size': 14})
ax, aax, cbax = rto.ionos.plot(sTime)
ax, aax, cbax = rto.rays.plot(sTime,
step=10, ax=ax, aax=aax)
rto.rays.showRange()
ax.grid()
/usr/local/lib/python2.7/dist-packages/davitpy-0.2-py2.7-linux-x86_64.egg/davitpy/models/raydarn/rt.py:454: RuntimeWarning: invalid value encountered in log10 im = aax.pcolormesh(X, Y, np.log10( self.edens[time][beam]['nel'] ), /usr/local/lib/python2.7/dist-packages/matplotlib/colors.py:584: RuntimeWarning: invalid value encountered in less cbook._putmask(xa, xa < 0.0, -1)
# Read ionospheric and ground scatter into memory
rto.readScatter()
# Plot ionospheric and ground scatter together
# Plot at start time
# Plot relative strength of ionospheric scatter
figure(figsize=(15,5))
rcParams.update({'font.size': 14})
ax, aax, cax = rto.scatter.plot(sTime,
title=True, weighted=True)
ax.grid()