baken
¶
baken - Imports baken data files.
-
class
upoints.baken.
Baken
(latitude, longitude, antenna=None, direction=None, frequency=None, height=None, locator=None, mode=None, operator=None, power=None, qth=None)[source]¶ Bases:
upoints.point.Point
Class for representing location from baken data files.
New in version 0.4.0.
Initialise a new
Baken
object.Parameters: - latitude (float) – Location’s latitude
- longitude (float) – Location’s longitude
- antenna (str) – Location’s antenna type
- direction (tuple of int) – Antenna’s direction
- frequency (float) – Transmitter’s frequency
- height (float) – Antenna’s height
- locator (str) – Location’s Maidenhead locator string
- mode (str) – Transmitter’s mode
- operator (tuple of str) – Transmitter’s operator
- power (float) – Transmitter’s power
- qth (str) – Location’s qth
Raises: LookupError
– No position data to use
-
class
upoints.baken.
Bakens
(baken_file=None)[source]¶ Bases:
upoints.point.KeyedPoints
Class for representing a group of
Baken
objects.New in version 0.5.1.
Initialise a new Bakens object.
-
import_locations
(baken_file)[source]¶ Import baken data files.
import_locations()
returns a dictionary with keys containing the section title, and values consisting of a collectionBaken
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 the
configparser
module, so should be reasonably robust against encodings and such. The above file processed byimport_locations()
will return the followingdict
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)}
- Args::
- baken_file (iter): Baken data to read
Returns: Named locations and their associated values Return type: dict
-