Skip to content

Instantly share code, notes, and snippets.

View Knusper's full-sized avatar
🚁
Working from a helicopter

E.C. Herenz Knusper

🚁
Working from a helicopter
View GitHub Profile
@Knusper
Knusper / wavel.py
Last active July 16, 2025 14:19
Quickly get wavelength axis from fits file
# function to create array containing all wavelength values
# of the grid where a spectrum has been sampled to
# from a fits header object
from astropy.io import fits
import numpy as np
def wavel(header, naxis=3, cdel_key="CD3_3"):
"""