Created on Jul 30, 2013
@author: Christoph Paulik christoph.paulik@geo.tuwien.ac.at
Bases: object
class that takes lat,lon coordinates, transformes them to cartesian (X,Y,Z) coordinates and provides a interface to scipy.spatial.kdTree as well as pykdtree if installed
Parameters : | lon : numpy.array or list
lat : numpy.array or list
R : float, optional
grid : boolean, optional
kd_tree_name : string, optional
|
---|
Attributes
R | float | earth radius to use in computation of x,y,z coordinates |
coords | numpy.array | 3D array of cartesian x,y,z coordinates |
kd_tree_name: string | name of kdTree implementation to use, either ‘pykdtree’ to use pykdtree or ‘scipy’ to use scipy.spatial.kdTree Fallback is always scipy if any other string is given or if pykdtree is not installed | |
kdtree: object | kdTree object that is built only once and saved in this attribute |
Methods
finds nearest index, builds kdTree if it does not yet exist
Parameters : | lon : float, list or numpy.array
lat : float, list or numpy.array
|
---|---|
Returns : | d : float, numpy.array
ind : int, numpy.array
index_lon : numpy.array, optional
index_lat : numpy.array, optional
|