Ejemplo n.º 1
0
        map_times.append(datetime.datetime(2013, 5, 13, 15, 5))
        map_times.append(datetime.datetime(2013, 5, 13, 16, 5))
        for kk, map_sTime in enumerate(map_times):
            plt_inx = kk + 1
            ax0 = fig.add_subplot(3, 1, plt_inx)

            map_eTime = map_sTime + datetime.timedelta(minutes=15)

            print ''
            print '################################################################################'
            print 'Plotting RBN Map: {0} - {1}'.format(
                map_sTime.strftime('%d %b %Y %H%M UT'),
                map_eTime.strftime('%d %b %Y %H%M UT'))

            rbn_df = rbn_lib.read_rbn(map_sTime,
                                      map_eTime,
                                      data_dir='data/rbn')

            # Figure out how many records properly geolocated.
            good_loc = rbn_df.dropna(
                subset=['dx_lat', 'dx_lon', 'de_lat', 'de_lon'])
            good_count_map = good_loc['callsign'].count()
            total_count_map = len(rbn_df)
            good_pct_map = float(good_count_map) / total_count_map * 100.

            good_count += good_count_map
            total_count += total_count_map

            print 'Geolocation success: {0:d}/{1:d} ({2:.1f}%)'.format(
                good_count_map, total_count_map, good_pct_map)
Ejemplo n.º 2
0
#!/usr/bin/env python
import os
import datetime

import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt

import rbn_lib

sTime = datetime.datetime(2010, 11, 19)
eTime = datetime.datetime(2010, 11, 19)

data_dir = os.path.join('data', 'rbn')
rbn_df = rbn_lib.read_rbn(sTime, eTime, data_dir=data_dir)
import ipdb
ipdb.set_trace()

fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111)

rbn_lib.rbn_map_plot(rbn_df, legend=False, ax=ax)
outfile = os.path.join('output', 'rbn', 'rbn_test.png')
fig.savefig(outfile, bbox_inches='tight')