Skip to content

Instantly share code, notes, and snippets.

View andrewcharles's full-sized avatar

Andrew C. andrewcharles

View GitHub Profile
@andrewcharles
andrewcharles / map_tunnel_coords.py
Last active February 25, 2020 03:33
Find the closest grid point to a set of points
import numpy as np
import math
from scipy.spatial import cKDTree as KDTree
WGS84_A = 6378137.0 # semi major axis in metres
def tunnel_coords(lats, lons, elev=0.0, rearth=WGS84_A):
"""
Transforms lat/lon coordinates to tunnel coordinates.