def test4(band, lname='ohlines'): if band == 'H': ap_num = 23 else: ap_num = 20 cwv, cflx = ip.read_lines(lname + '.dat') for k in range(ap_num): strdesc = 'IGRINS_%s_%s.%03d' % (band, lname, k) strip, hdr = ip.readfits(MANUAL_PATH + strdesc + '.fits') z1, z2 = ip.zscale(strip) f2 = plt.figure(2, figsize=(12, 5), dpi=200) a1 = f2.add_subplot(211, aspect='auto') ny, nx = strip.shape a1.imshow(strip, cmap='hot', aspect=nx / 1000.0, vmin=z1, vmax=z2) a1.set_xlim((0, nx)) a1.set_ylim((0, ny)) a1.set_title('%s' % (strdesc, )) f2.savefig(PNG_PATH + strdesc + '.png') strdesc = 'tIGRINS_%s_%s.%03d' % (band, lname, k) strip, hdr = ip.readfits(MANUAL_PATH + strdesc + '.fits') wave = np.loadtxt(MANUAL_PATH + strdesc + '.wave') draw_strips(strip, wave, desc=strdesc, linedata=[cwv, cflx])
def test4(band, lname='ohlines'): if band == 'H': ap_num = 23 else: ap_num = 20 cwv, cflx = ip.read_lines(lname+'.dat') for k in range(ap_num): strdesc = 'IGRINS_%s_%s.%03d' % (band, lname, k) strip, hdr = ip.readfits(MANUAL_PATH+strdesc+'.fits') z1, z2 = ip.zscale(strip) f2 = plt.figure(2,figsize=(12,5),dpi=200) a1 = f2.add_subplot(211, aspect='auto') ny, nx = strip.shape a1.imshow(strip, cmap='hot', aspect=nx/1000.0, vmin=z1, vmax=z2) a1.set_xlim((0,nx)) a1.set_ylim((0,ny)) a1.set_title('%s' % (strdesc,)) f2.savefig(PNG_PATH+strdesc+'.png') strdesc = 'tIGRINS_%s_%s.%03d' % (band, lname, k) strip, hdr = ip.readfits(MANUAL_PATH+strdesc+'.fits') wave = np.loadtxt(MANUAL_PATH+strdesc+'.wave') draw_strips(strip, wave, desc=strdesc, linedata=[cwv, cflx])
def test3(band, lname='ohlines'): ''' Draw the extracted strip images with wavelength ''' onum, odesc, owv1, owv2 = ip.read_orderinfo(band) cwv, cflx = ip.read_lines(lname+'.dat') wticks = np.arange(1.5, 2.5, 0.005) for desc in odesc: strdesc = 'IGRINS_%s_%s_%s' % (band, lname, desc) strip, shdr = ip.readfits(ONESTEP_PATH+'IGRINS_%s_%s.fits' % (desc,lname)) wave = np.loadtxt(ONESTEP_PATH+'IGRINS_%s_%s.wave' % (desc,lname)) draw_strips(strip, wave, desc=strdesc, linedata=[cwv, cflx])
def test3(band, lname='ohlines'): ''' Draw the extracted strip images with wavelength ''' onum, odesc, owv1, owv2 = ip.read_orderinfo(band) cwv, cflx = ip.read_lines(lname + '.dat') wticks = np.arange(1.5, 2.5, 0.005) for desc in odesc: strdesc = 'IGRINS_%s_%s_%s' % (band, lname, desc) strip, shdr = ip.readfits(ONESTEP_PATH + 'IGRINS_%s_%s.fits' % (desc, lname)) wave = np.loadtxt(ONESTEP_PATH + 'IGRINS_%s_%s.wave' % (desc, lname)) draw_strips(strip, wave, desc=strdesc, linedata=[cwv, cflx])
def draw_strips_file(stripfile, wavefile, linefile='ohlines.dat', \ desc='', target_path=PNG_PATH): ''' Draw the strips with wavelength - INPUTS: 1. strip file name (.fits) 2. wavelength file name (.wave) 3. line data file - OUTPUTS: PNG files ''' strip, hdr = ip.readfits(stripfile) wave = np.loadtxt(wavefile) cwv, cflx = ip.read_lines(linefile) linedata = (cwv, cflx) draw_strips(strip, wave, linedata=linedata, \ desc=desc, lampname=linefile[:-9], target_path=target_path)
def test5(): stripfile=MANUAL_PATH+'IGRINS_H_ohlines.000.fits' cwv, cflx = ip.read_lines('ohlines.dat') line_identify(stripfile, linedata=(cwv, cflx), thres=12000)
def test5(): stripfile = MANUAL_PATH + 'IGRINS_H_ohlines.000.fits' cwv, cflx = ip.read_lines('ohlines.dat') line_identify(stripfile, linedata=(cwv, cflx), thres=12000)