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 subprocess import Popen, PIPE | |
def run_idl(inp, do_log = False): | |
"""Run IDL""" | |
if do_log: | |
with open('idl.log', 'w') as log: | |
idl = Popen(['nice','-n0','idl'],stdin = PIPE, \ | |
stdout=log,stderr=log) | |
idl.communicate(inp) |
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' |
NewerOlder