Pro J1207_detailed_NIR_comp std_colors_def = ['deep pink', 'magenta', 'medium violet red', 'dark slate blue', 'deep sky blue', 'medium aquamarine', 'forest green', 'dark goldenrod', $ 'coral', 'sandy brown', 'saddle brown', 'dark red', 'firebrick', 'pink', 'misty rose', 'peach puff', 'lavender', 'light cyan'] colors_end = ['deep sky blue','coral','deep pink'] forward_function read_spectrum_sep, read_template_sep ;read_spectrum_sep,'/Users/gagne/Documents/Donnees/my_data/Collaborations/Jackie_Faherty/J1207/SpeX/Prism/proc/J1207_tellcor.fits', lamref, spr, espr ; read_spectrum_sep,'/Users/gagne/Documents/Donnees/my_reductions/MAGELLAN/FIRES/2013A/DONE-W1207-3900.fits', lamref, spr, espr ; bad = where(*lamref[2] lt 1.985 or (*lamref[2] gt 2.005 and *lamref[2] lt 2.04), nbad) ; if nbad ne 0L then begin & tmp = (*spr[2]) & tmp[bad]=!values.f_nan & *spr[2] = tmp & endif read_spectrum_sep,'/Users/gagne/Documents/Donnees/my_reductions/MAGELLAN/FIRES/2013A/DONE-W1247-3816.fits', lamref, spr, espr stop spt = 'M9' ;spt = 'L1' objname = 'J1247-3816' ;objname = 'J1207-3900' font_size = 16L win = window(dimensions=[650*3L,450*3L],location=[320,0]) thick = 2 nan = !values.f_nan tlim = [1.35,nan,nan] tlim2 = [nan,1.45,nan] for jj=0L, 2L do begin for ii=0L, 2L do begin nbad = 0L bad = where(*lamref[ii] gt tlim[ii] or *lamref[ii] lt tlim2[ii], nbad) if nbad ne 0 then begin tmp = *spr[ii] tmp[bad] = !values.f_nan *spr[ii] = tmp tmp = *espr[ii] tmp[bad] = !values.f_nan *espr[ii] = tmp endif ;Left,Down,Right,Up margin = [.12,.25,.025,.025] if jj ne 2L then margin[1] = 0. if jj ne 0L then margin[3] = 0. if ii ne 2L then margin[2] = 0.025 if ii ne 0L then margin[0] = 0.025 ntag = [6,4,5] if ii eq 0L then xtval = [0.8,0.9,1.,1.1,1.2,1.3] if ii eq 1L then xtval = [1.5,1.6,1.7,1.8] if ii eq 2L then xtval = [2.0,2.1,2.2,2.3,2.4] xtname = !NULL if jj ne 2L then xtname = strarr(ntag[ii]) ga = plot(*lamref[ii],*spr[ii],margin=margin,xticklen=.01,yticklen=.01, $ YTITLE=((ii eq 0 and jj eq 1L) ? 'Relative Flux F$_\lambda$' : ''), XTITLE=((jj eq 2L and ii eq 1L) ? 'Wavelength ($\mu$m)' : ''),$ XRANGE=[([0.8,1.44,1.95])[ii],([1.36,1.82,2.41])[ii]], layout=[3L,3L,1L+ii+jj*3L], /current, xtickname = xtname, xtickvalue = xtval, $ ytickname = strarr(6L), thick=thick, FONT_SIZE=font_size) gae = errorplot2(*lamref[ii],*spr[ii],finite(*spr[ii])*0.,*espr[ii], /overplot, thick=1, FONT_SIZE=font_size, color='black', xcapsize=0.,ycapsize=0.) for ki=0L, n_elements(gae)-1 do $ if gae[ki] ne !NULL then gae[ki].order, /send_backwards miny = min(*spr[ii],/nan) maxy = max(*spr[ii],/nan) if ii eq 0L then $ read_template_sep, spt, lam, sp, esp_pos, esp_neg, GAMMA=(jj eq 0L), BETA=(jj eq 1L) nbad = 0L bad = where(*lam[ii] gt tlim[ii] or *lam[ii] lt tlim2[ii], complement=g, nbad) g = where(~(*lam[ii] gt tlim[ii]) and ~(*lam[ii] lt tlim2[ii]) and finite((*lam[ii])*(*sp[ii])*(*esp_pos[ii])*(*esp_neg[ii]))) if nbad ne 0 then begin tmp = *sp[ii] tmp[bad] = !values.f_nan *sp[ii] = tmp tmp = *esp_pos[ii] tmp[bad] = !values.f_nan *esp_pos[ii] = tmp tmp = *esp_neg[ii] tmp[bad] = !values.f_nan *esp_neg[ii] = tmp endif xx = [(*lam[ii])[g], reverse((*lam[ii])[g])] yy = [(*sp[ii] + *esp_pos[ii])[g], reverse((*sp[ii] - *esp_neg[ii])[g])] egb = plot(xx, yy, /fill_background, fill_color='dark grey',$ transparency=100,fill_transparency=50., overplot=ga) gb = plot(*lam[ii],*sp[ii],overplot=ga,color=colors_end[jj], thick=thick) gb.order, /send_to_back egb.order, /send_to_back miny <= (min(*sp[ii],/nan) < min(yy,/nan)) maxy >= (max(*sp[ii],/nan) > max(yy,/nan)) ga.yrange = [miny,maxy]+[-1,1.]*(maxy-miny)*.01 ga.ymajor = 6L ga.yminor = 4L ga.ytickname = strarr(6L) if ii eq 0L then begin del = 0. if jj eq 2L then del = .04 xx = .14 yy = .78 - del*1.8 tt = text(xx,yy,spt+([' VL-G',' INT-G',' FLD-G'])[jj],target=ga,/relative,font_size=font_size-1) gl1 = plot(0.82 + [0,.05],((gb.yrange)[1]-(gb.yrange)[0])*(.82 - del*1.8)+(gb.yrange)[0] + [0,0],/overplot, thick=thick,color=colors_end[jj]) xx = .14 yy = .88 - del tt2 = text(xx,yy,objname,target=ga,/relative,font_size=font_size-1) gl2 = plot(0.82 + [0,.05],((gb.yrange)[1]-(gb.yrange)[0])*(.92 - del)+(gb.yrange)[0] + [0,0],/overplot, thick=thick) endif if ii ne 2L then begin ax = ga.axes ax[3].HIDE = 1 end if ii ne 0L then begin ax = ga.axes ax[1].HIDE = 1 end endfor endfor ;ga.save,'test.png' ;ga.save,'J1207_comp.eps',/bitmap, height=1024*3 ;ga.save,'J1247_comp.eps',/bitmap, height=1024*3 stop End