Created
April 1, 2013 15:40
-
-
Save gabraganca/5285645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyraf import iraf | |
def sep_spec(spec, aperture): | |
"""Separate the multi spectrum in its orders""" | |
nslits = int(iraf.imhead(spec, Stdout=1)[0].split(',')[1]) | |
for i in xrange(1, nslits+1): | |
spec_in = spec+'[*,'+str(i)+','+aperture+']' | |
if i<10: | |
spec_out = './'+spec.split('.fits')[0]+'_000'+str(i)+'.fits' | |
else: | |
spec_out = './'+spec.split('.fits')[0]+'_00'+str(i)+'.fits' | |
iraf.imcopy(spec_in, spec_out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment