This notebook introduces the high-level python interface with the radar.dat and hdw.dat content.
For more in-depth access (i.e., your own hdw.dat), look at the radInfoIO module:
radInfoIo?
# Import radar module
%pylab inline
from davitpy.pydarn.radar import *
Populating the interactive namespace from numpy and matplotlib
This could be used to iterate through radars, plot them all on a map, find radars in view of specific points...
radars = network()
print radars
Network information object: Total radars: 52 (North) - [0][tst] Test Radar (planned) (North) - [1][gbr] Goose Bay (active) (North) - [2][sch] Schefferville (offline) (North) - [3][kap] Kapuskasing (active) (South) - [4][hal] Halley (active) (North) - [5][sas] Saskatoon (active) (North) - [6][pgr] Prince George (active) (North) - [7][kod] Kodiak (active) (North) - [8][sto] Stokkseyri (active) (North) - [9][pyk] Pykkvibaer (active) (North) - [10][han] Hankasalmi (active) (South) - [11][san] SANAE (active) (South) - [12][sys] Syowa South (active) (South) - [13][sye] Syowa East (active) (South) - [14][tig] TIGER (active) (South) - [15][ker] Kerguelen (active) (North) - [16][ksr] King Salmon (active) (South) - [18][unw] Unwin (active) (South) - [19][zho] Zhongshan Station (active) (South) - [20][mcm] McMurdo (active) (South) - [21][fir] Falkland Islands (offline) (South) - [22][sps] South Pole Station (active) (South) - [24][bpk] Buckland Park (active) (North) - [32][wal] Wallops Island (active) (North) - [33][bks] Blackstone (active) (North) - [40][hok] Hokkaido (active) (North) - [41][hkw] Hokkaido West (planned) (North) - [64][inv] Inuvik (active) (North) - [65][rkn] Rankin Inlet (active) (North) - [66][cly] Clyde River (active) (South) - [96][dce] Dome C East (active) (North) - [128][svb] Svalbard (planned) (North) - [204][fhw] Fort Hays West (active) (North) - [205][fhe] Fort Hays East (active) (North) - [206][cvw] Christmas Valley West (active) (North) - [207][cve] Christmas Valley East (active) (North) - [208][adw] Adak West (active) (North) - [209][ade] Adak East (active) (North) - [210][azw] Azores West (planned) (North) - [211][aze] Azores East (planned) (North) - [501][sve] Svedlovsk East (planned) (North) - [502][svw] Svedlovsk West (planned) (North) - [504][ire] Irkutsk East (planned) (North) - [505][irw] Irkutsk West (planned) (North) - [506][kae] Kashi East (planned) (North) - [507][kaw] Kashi West (planned) (North) - [508][eje] Ejina East (planned) (North) - [509][ejw] Ejina West (planned) (North) - [510][she] Shenyang East (planned) (North) - [511][shw] Shenyang West (planned) (North) - [512][ekb] EKB Radar (planned) (North) - [513][jia] Jiamusi (planned)
# How to get the total number of radars
print len(radars)
print radars.nradar
52 52
# How to get a specific radar from the mountain of recorded radars
print radars.getRadarByCode("bks")
# is equivalent to...
#print radars.getRadarById(33)
#print, radars.getRadarByName("Blackstone")
id: 33 status: 1 cnum: 2 code: [u'bks', u'i'] name: Blackstone operator: Virginia Tech hdwfname: hdw.dat.bks stTime: 2008-02-02 edTime: 2500-01-01 snum: 12 sites: 12 elements
# How to get a specific radar site information at a given date
from datetime import datetime
print radars.getRadarByName('Goose Bay').getSiteByDate(datetime(2011,1,4))
tval: 3000-01-01 00:00:00 geolat: 53.32 geolon: -60.46 alt: 50.00 boresite: 5.00 bmsep: 3.24 vdir: 1 atten: 0.00 tdiff: 0.4780 phidiff: 1.0 interfer: [ 1.50, 100.00, 0.00] recrise: 0.000 maxatten: 0.0 maxgate: 100 maxbeam: 16
Saves memory and time
# How to get only one radar without getting all the other radars
rad = radar(code='bks')
print rad
id: 33 status: 1 cnum: 2 code: [u'bks', u'i'] name: Blackstone operator: Virginia Tech hdwfname: hdw.dat.bks stTime: 2008-02-02 edTime: 2500-01-01 snum: 12 sites: 12 elements
Saves even more memory and time
# How to get a site without going trhough the whole network or radar classes
print site(code='bks', dt=datetime(2010,11,17))
tval: 2011-09-12 00:00:00 geolat: 37.10 geolon: -77.95 alt: 50.00 boresite: -32.00 bmsep: 3.86 vdir: 1 atten: 0.00 tdiff: -0.3240 phidiff: 1.0 interfer: [ 0.00, -58.90, -2.70] recrise: 0.000 maxatten: 0.0 maxgate: 110 maxbeam: 16