define char ispec*100[6] ispecout*100 linefilename*100 gregfilename*100 source*20 define double fluxmin fluxpeak ylabel yendline freqlow[2] freqhigh[2] xoffusb[3] beam[2] define char command*200 f*100 ispec2*100 ispecjoin*100[3] filename*100 define real fluxoffset fluxoffsetsma4 let fluxoffset = 1.0 let fluxoffsetsma4 = -0.5 let ispec[1] = "IVEX_221L.LOWGEO.ISPEC.138.195" ! sma1 line peak let ispec[2] = "IVEX_221L.HIGGEO.ISPEC.138.195" ! sma1 line peak let ispec[3] = "IVEX_221L.LOWGEO.ISPEC.186.168" ! sma2 cont peak let ispec[4] = "IVEX_221L.HIGGEO.ISPEC.186.168" ! sma2 cont peak let ispec[5] = "IVEX_221L.LOWGEO.ISPEC.204.100" ! sma4 cont peak let ispec[6] = "IVEX_221L.HIGGEO.ISPEC.204.100" ! sma4 cont peak let linefilename = "Lines_n6334i.221" let source = "sma1_221" let xoffusb[1] = +0.0095 ! GHz let xoffusb[2] = +0.007 ! GHz let xoffusb[3] = 0.5*(xoffusb[1]+xoffusb[2]) ! GHz let fluxmin = -0.35+fluxoffsetsma4 ! Jy let fluxpeak = 3.69 ! Jy let yendline = 2.25 ! Jy let ylabel = fluxpeak-0.7 !let freqlow[1] = 220.61 ! top panel !let freqhigh[1] = 221.101 !let freqlow[2] = 220.12 ! second panel !let freqhigh[2] = 220.62 ! let freqlow[1] = 220.34 ! top panel let freqhigh[1] = 220.76 let freqlow[2] = 219.92 ! second panel let freqhigh[2] = 220.34 ! let beam[1] = 0.89 ! arcsec let beam[2] = 0.38 ! arcsec ! ! Don't change lines below this point. ! let ispecjoin[1] = 'ispec[1]'"."'ispec[2]' let command = "./combineispec "'ispec[1]'" "'ispec[2]' sys 'command' let ispecjoin[2] = 'ispec[3]'"."'ispec[4]' let command = "./combineispec "'ispec[3]'" "'ispec[4]' sys 'command' let ispecjoin[3] = 'ispec[5]'"."'ispec[6]' let command = "./combineispec "'ispec[5]'" "'ispec[6]' sys 'command' let f = "sma12lsb34_220cont.ps" let ispecout = 'ispecjoin[1]'".shifted" let gregfilename = "Lines_n6334i.221.custom.greg" define double xl height sep kperjy freqpad freqpadtail let freq = 0.5*(freqlow[1]+freqhigh[2]) /new double let kperjy = 1224000*1|(freq*freq*beam[1]*beam[2]) say Kelvin per Jansky = 'kperjy' let drawline = &1 /new int let drawchannelnum = 0 /new int ! tick 0 0 0 0 let yoff = 0 /new real set coord user cle p pen /wei 2 /dash 1 /col 0 set plot land set char .55 let sep = 1.0 let top = 20 /new int let height = 8.5 ! 1.5 to 14.5, 16 to 29 = top-2*height-sep top-height-sep top-height top set box box_xmin-0.5 box_xmax top-height top say "If you get an error here, you may have forgotten to delete the last few junk lines of the ISPEC file = "'ispec' column x 2 y 3 z 1 /file 'ispecjoin[1]' /lines 3 let jymax = 0 /new real for i 1 to nxy if (y[i].gt.jymax) then let jymax = y[i] endif next let tbinc = 25 /new int let maxkelvin = jymax*kperjy+2*tbinc /new real define int firstchan lastchan let x = x*0.000000001 let x = x+xoffusb[1] lim freqlow[1] freqhigh[1] fluxmin fluxpeak pen /col 3 histo pen /col 0 box column x 2 y 3 z 1 /file 'ispecjoin[2]' /lines 3 let x = x*0.000000001 let x = x+xoffusb[2] let y = y+fluxoffset pen /col 1 histo pen /col 0 if (drawline.eq.1) then let command = "./makemolecules.pl "'linefilename'" "'ylabel' sys 'command' @drawlines3 'freqlow[1]' 'freqhigh[1]' 'linefilename' 'yendline' set char .40 @'gregfilename' 'freqlow[1]' 'freqhigh[1]' 'yendline' set char .55 endif if (drawchannelnum.eq.1) then set orien 90 pen /col 1 for j 1 to 2 let filename = 'ispec[j]' column x 2 y 3 z 1 /file 'filename' /lines 3 let x = x*0.000000001 let x = x+xoffusb[1] let firstchan = z[nxy] for i 1 to nxy if ((x[i].ge.freqlow[1]).and.(x[i].le.freqhigh[1])) then let firstchan = z[i] break endif next i lastchan = z[nxy] for i 1 to nxy if (x[i].ge.freqhigh[1]) then lastchan = z[i] break endif next i let freqpad = 0 let freqpadtail = freqhigh[1]-x[nxy] for i 100*nint(0.01*firstchan) to lastchan by 100 let xl = freqpad+freqlow[1]+(freqhigh[1]-freqlow[1]-freqpadtail)*(i-firstchan)|(lastchan-firstchan) if ((xl.ge.freqlow[1]).and.(xl.le.freqhigh[1])) then draw text xl user_ymin+(user_ymax*.06) 'nint(i|100)' draw relo xl user_ymin draw line xl user_ymin+user_ymax*0.03 endif next i ! draw ticks every 20 channels for i 100*nint(0.01*firstchan) to lastchan by 20 let xl = freqpad+freqlow[1]+(freqhigh[1]-freqlow[1]-freqpadtail)*(i-firstchan)|(lastchan-firstchan) if ((xl.ge.freqlow[1]).and.(xl.le.freqhigh[1]).and.(i.ne.100*nint(i*0.01))) then draw relo xl user_ymin+user_ymax*0.04 draw line xl user_ymin+user_ymax*0.07 endif next i next j endif pen /col 2 column x 2 y 3 z 1 /file 'ispecjoin[3]' /lines 3 let x = x*0.000000001 let x = x+xoffusb[3] let y = y+fluxoffsetsma4 histo pen /col 0 ! ! set orien 0 !endif set orien 90 draw text -1.2 3.0 "Flux density (Jy beam\u-\u1)" /box 4 draw text 1.7 -3.5 "Brightness temperature (K)" /box 6 set orien 0 for i 0 to maxkelvin by tbinc draw text user_xmax+0.009 i*1.0|kperjy 'i' draw relo user_xmax i*1.0|kperjy draw line user_xmax+0.005 i*1.0|kperjy next !pen /col 0 !draw text 0 0.1 "SMA1 = black, SMA2 = red, SMA4 = green" /box 8 set char 1 pen /col 0 draw text -9 0.02 "NGC6334I" /box 8 pen /col 3 draw text -4 0.02 "SMA1" /box 8 pen /col 1 draw text 0 0.02 "SMA2" /box 8 pen /col 2 draw text 4 0.02 "SMA4" /box 8 set char 0.55 ! !pause ! set box box_xmin box_xmax top-2*height-sep top-height-sep column x 2 y 3 z 1 /file 'ispecjoin[1]' /lines 3 let x = x*0.000000001 let x = x+xoffusb[1] lim freqlow[2] freqhigh[2] fluxmin fluxpeak pen /col 3 histo pen /col 0 column x 2 y 3 z 1 /file 'ispecjoin[2]' /lines 3 let x = x*0.000000001 let x = x+xoffusb[2] let y = y+fluxoffset pen /col 1 histo pen /col 0 box if (drawline.eq.1) then @drawlines3 'freqlow[2]' 'freqhigh[2]' 'linefilename' 'yendline' set char .40 @'gregfilename' 'freqlow[2]' 'freqhigh[2]' 'yendline' set char .55 endif if (drawchannelnum.eq.1) then set orien 90 pen /col 1 for j 1 to 2 ! j=1 will finish the plotting of data from the first ispec file ! in this case, x[1] will be < freqlow[2], so firstchan will be ~2135 ! j=2 will begin the plotting of data from the second ispec file ! in this case, x[1] will be > freqlow[2], so firstchan will be 1 let filename = 'ispec[j]' column x 2 y 3 z 1 /file 'filename' /lines 3 let x = x*0.000000001 let x = x+xoffusb[1] let firstchan = z[nxy] for i 1 to nxy if ((x[i].ge.freqlow[2]).and.(x[i].le.freqhigh[2])) then let firstchan = z[i] break endif next i let lastchan = z[nxy] for i 1 to nxy if (x[i].ge.freqhigh[2]) then let lastchan = z[i] break endif next i if (j.eq.2) then let freqpadtail = 0 if (firstchan.ge.1) then let freqpad = x[firstchan]-freqlow[2] else let freqpad = 0 endif else ! j==1 let freqpad = 0 if (firstchan.lt.z[nxy]) then let freqpadtail = freqhigh[2]-x[nxy] else let freqpadtail = 0 endif endif ! draw labels every 20 channels for i 100*nint(0.01*firstchan) to lastchan by 100 let xl = freqpad+freqlow[2]+(freqhigh[2]-freqlow[2]-freqpadtail-freqpad)*(i-firstchan)|(lastchan-firstchan) if ((xl.ge.freqlow[2]).and.(xl.le.freqhigh[2])) then draw text xl user_ymin+(user_ymax*.06) 'nint(i|100)' draw relo xl user_ymin draw line xl user_ymin+user_ymax*0.03 endif next i ! draw ticks every 20 channels for i 100*nint(0.01*firstchan) to lastchan by 20 let xl = freqpad+freqlow[2]+(freqhigh[2]-freqlow[2]-freqpadtail-freqpad)*(i-firstchan)|(lastchan-firstchan) if ((xl.ge.freqlow[2]).and.(xl.le.freqhigh[2]).and.(i.ne.100*nint(i*0.01))) then draw relo xl user_ymin+user_ymax*0.04 draw line xl user_ymin+user_ymax*0.07 endif next i next j endif pen /col 2 column x 2 y 3 z 1 /file 'ispecjoin[3]' /lines 3 let x = x*0.000000001 let x = x+xoffusb[3] let y = y+fluxoffsetsma4 histo set orien 90 pen /col 0 draw text -1.2 3.0 "Flux density (Jy beam\u-\u1)" /box 4 draw text 1.7 -3.5 "Brightness temperature (K)" /box 6 set orien 0 let z = y*kperjy ! convert to brightness temperature sys "rm "'ispecout' write column 'ispecout' for i 0 to maxkelvin by tbinc draw text user_xmax+0.009 i*1.0|kperjy 'i' draw relo user_xmax i*1.0|kperjy draw line user_xmax+0.005 i*1.0|kperjy next label "Rest Frequency (GHz)" /x ! ! pen /col 0 /dash 1 sys "rm -f "'f' hard 'f' /dev ps c sys "ps2pdf "'f' !