Skip to content

Instantly share code, notes, and snippets.

@iancze
Last active November 18, 2019 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iancze/30b5a7194eee9151b788e0ef1310fa72 to your computer and use it in GitHub Desktop.
Save iancze/30b5a7194eee9151b788e0ef1310fa72 to your computer and use it in GitHub Desktop.
import numpy as np
c_kms = 2.99792458e5 # km/s
dv = 0.5 # km/s
wl_start = 5000.0
wl_end = 5100.0
CDELT1 = np.log10(dv/c_kms + 1.)
CRVAL1 = np.log10(wl_start)
CRVALN = np.log10(wl_end)
NAXIS1 = (CRVALN - CRVAL1) / CDELT1
p = np.arange(NAXIS1)
wl = 10 ** (CRVAL1 + CDELT1 * p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment