Skip to content

Instantly share code, notes, and snippets.

View malcolmrh's full-sized avatar

Malcolm malcolmrh

  • Anchorage, Alaska
View GitHub Profile
@dbuscombe-usgs
dbuscombe-usgs / hillshade.py
Created March 27, 2015 12:48
shaded relief algorithm in python
import numpy as np
def cart2pol(x, y):
'''
cartesian to polar coordinates
'''
theta = np.arctan2(y, x)
rho = np.sqrt(x**2 + y**2)
return (theta, rho)
#!/usr/bin/python
# https://timwise.co.uk/2014/02/03/converting-kml-to-gpx-with-python/
# https://gist.github.com/timabell/8791116
import argparse
import xml.sax
parser = argparse.ArgumentParser(description='Convert annoying google android my tracks kml data to sensible gpx files')
parser.add_argument('input_file')
@kevana
kevana / MagDec.py
Last active September 28, 2023 15:53
Script to retrieve Magnetic declination data from www.ngdc.noaa.gov. Retrieves specified latitude and longitude ranges (CONUS by default) and stores them in a cfg style text file
#
# Script to retrieve magnetic declination data from www.ngdc.noaa.gov
# Retrieves specified latitude and longitude ranges (CONUS by default)
# and stores them in a cfg style text file
#
# Usage: Run script with no arguments, it will output declination.cfg
# in the current directory
#
# Tested with Python 3.3.1
#