datestr = datestr6_pwd() echo=1 NCP = nsxng_load_ncp() redo = 0 c = nsxng_constants() ; load NSX contants (were globals) ncp = nsxng_load_ncp() ; load NSX edge of slit polynomials nsxng_load_WSC, c.nsxdir, WSC ; read the shortlog file... nsets = rd_2_shortlog(datestr, sets, /nocal) colors = [x11rgb('black'), x11rgb('DarkGray'), x11rgb('sienna'), x11rgb('red'), $ x11rgb('orange'), x11rgb('DarkGreen'), x11rgb('DarkBlue'), x11rgb('purple'), $ x11rgb('black'), x11rgb('DarkGray'), x11rgb('sienna'), x11rgb('red') ] line = [replicate(0,8), replicate(2,4) ] nsolist = [3,4,5,6,7,0] nnso = n_elements(nsolist) window, xs=840, ys=1000 !p.multi=[0,1,nnso] for iset = 4, nsets-1 do begin ;for iset = 2,2 do begin set = sets[iset] count = rd_2_position(datestr, set.setno, seqno, object, dpatname, beam) if strtrim(dpatname[0],2) eq 'ABBA' then begin beamarr = ['ABEAM','BBEAM'] endif else begin beamarr = ['CENTER','SKY'] endelse for ibeam = 0, 1 do begin beammatch = beamarr[ibeam] indx = where(beam eq beammatch, nim) if nim gt 0 then begin fnout = 'sav/'+'3_profile_'+string(set.setno,for='(I03)')+'_'+beammatch+'.sav' restore, fnout for inso = 0, nnso-1 do begin nso = nsolist[inso] nmax = max( (spxim[nso,*].pro_apn) ) xmax = max ( (spxim[nso,*].pro_apx)[nmax-1,*,*] ) ymin = min((spxim[nso,*].pro_apymed)[0:nmax-1,*,*]) ymax = max((spxim[nso,*].pro_apymed)[0:nmax-1,*,*]) for iim = 0, nim-1 do begin spxn = spxim[nso, iim] if iim eq 0 then begin plot, [0, xmax], [ymin, ymax], /xs, /ys, /nodata xyouts, 0, (ymin+ymax)/2, string(nso) endif xx = (spxn.pro_apx)[0:spxn.pro_apn-1] yy = (spxn.pro_apymed)[0:spxn.pro_apn-1] oplot, xx, yy, color=colors[iim], line=line[iim] oplot, [1,1]*spxn.pro_cen, minmax(yy), color=colors[iim], line=line[iim] oplot, [1,1]*spxn.pro_cen, minmax(yy), color=colors[iim], line=line[iim] xyouts, xmax-5*ch_size(/x), ymax-(iim+1)*ch_size(/y), seqno[indx[iim]], color=colors[iim], /align endfor endfor fnout = 'fig/'+'3_profile_'+string(set.setno,for='(I03)')+'_'+beammatch+'.png' tv2png, fnout, /co, /tr endif ; any valid images endfor ; loop over beams print, 'end of set ', set.setno endfor ; loop over the sets end