import_locations(self,
baken_file)
|
|
Import baken data files
import_locations() returns a dictionary with keys containing the
section title, and values consisting of a collection Baken objects.
It expects data files in the format used by the baken amateur radio
package, which is Windows INI style files such as:
[Abeche, Chad]
latitude=14.460000
longitude=20.680000
height=0.000000
[GB3BUX]
frequency=50.000
locator=IO93BF
power=25 TX
antenna=2 x Turnstile
height=460
mode=A1A
The reader uses Python's ConfigParser
module, so should be reasonably robust against encodings and such. The
above file processed by import_locations() will return the following
dict object:
{"Abeche, Chad": Baken(14.460, 20.680, None, None, None, 0.000,
None, None, None, None, None),
"GB3BUX": : Baken(None, None, "2 x Turnstile", None, 50.000,
460.000, "IO93BF", "A1A", None, 25, None)}
>>> locations = Bakens(open("baken_data"))
>>> for key, value in sorted(locations.items()):
... print("%s - %s" % (key, value))
Abeche, Chad - 14°27'36"N, 020°40'48"E
GB3BUX - IO93BF (53°13'45"N, 001°52'30"W)
IW1RCT - JN44FH (44°18'45"N, 008°27'29"E)
>>> locations = Bakens(open("no_valid_baken"))
>>> len(locations)
0
- Parameters:
baken_file (file , list or str ) - Baken data to read
- Returns:
dict
- Named locations and their associated values
- Overrides:
point.KeyedPoints.import_locations
|