Skip to content

Commit

Permalink
file for readingin a HRS MIDAS file
Browse files Browse the repository at this point in the history
  • Loading branch information
crawfordsm committed Jan 15, 2018
1 parent a0081f1 commit 51e2ad0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/read_midas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os, sys
import specutils
import numpy as np

import pylab as pl

# Read in and then print out a MIDAS spectra file.
# Only works with python 2.7 and specutils <= 0.2

s = specutils.io.read_fits.read_fits_spectrum1d(sys.argv[1])
flux = s.data
xarr = np.arange(len(flux))
warr = s._wcs(xarr)
for i in range(len(flux)):
print warr[i], flux[i]

0 comments on commit 51e2ad0

Please sign in to comment.