polyfemos.util.coordinator

Coordinate transformation functions

copyright

2019, University of Oulu, Sodankyla Geophysical Observatory

license

GNU Lesser General Public License v3.0 or later (https://spdx.org/licenses/LGPL-3.0-or-later.html)

Public Functions

polyfemos.util.coordinator.ddm2dd(degs, mins, letter)[source]
Parameters
  • degs (numlike) – coordinate degrees

  • mins (numlike) – coordinate decimal minutes

  • letter (str) – N, S, E, or W

Return type

float

Returns

coordinate as decimal degrees

polyfemos.util.coordinator.get_transform(from_epsg, to_epsg)[source]
Parameters
  • from_epsg (str) – EPSG code of the original coordinate system

  • to_epsg (str) – EPSG code of the resulting coordinate system

Return type

func

Returns

A coordinate transformation function taking xy-coordinates in from_epsg coordinate system and returning xy-coordinates in to_epsg coordinate system

polyfemos.util.coordinator.transform_from_ozi_map(mapfile)[source]

Reads OziExplorer map files and returns a function to convert WGS84 coordinates to pixels.

The map file can be created manually and it should contain at least the following mandatory lines:

Point01,xy, 110, 159,in, deg, 68, 47.222,N, 22, 46.498,E, grid, , , , N
Point02,xy, 219, 159,in, deg, 68, 50.001,N, 25, 32.324,E, grid, , , , N
Point03,xy, 329, 159,in, deg, 68, 50.063,N, 28, 20.055,E, grid, , , , N
Point04,xy, 110, 318,in, deg, 67, 19.826,N, 23, 2.020,E, grid, , , , N
Point05,xy, 219, 318,in, deg, 67, 22.408,N, 25, 37.707,E, grid, , , , N
Point06,xy, 329, 318,in, deg, 67, 22.466,N, 28, 15.139,E, grid, , , , N
Point07,xy, 110, 476,in, deg, 65, 52.937,N, 23, 15.536,E, grid, , , , N
Point08,xy, 219, 476,in, deg, 65, 55.346,N, 25, 42.393,E, grid, , , , N
Point09,xy, 329, 476,in, deg, 65, 55.401,N, 28, 10.860,E, grid, , , , N
MMPLL,1, 19.499680, 70.147437
MMPLL,2, 31.374991, 70.251143
MMPLL,3, 30.424810, 64.431702
MMPLL,4, 21.120046, 64.353722

Each line is treated as a list of elements separated with commas, whitespaces are removed. The ‘Point’ entries are used to create the conversion and the ‘MMPLL’ entries define the extrapolation area. In ‘Point’ entries indices 2 and 3 are pixel coordinates and indices from 6 to 11 are the corresponding WGS84 coordinates (indices 2 and 3 in the ‘MMPLL’ entry).

Lines that do not start with either ‘MMPLL’ or ‘Point’ are skipped.

Parameters

mapfile (str) – path to OziExplorer map file

Return type

func

Returns

A function taking WGS84 longitude and latitude as arguments and returning pixel xy-coordinates as a tuple.