pro add_vel_map,files ; ; if no file names given then do the latest 20 SYNOPs ; if n_elements(files) eq 0 then begin headcat,cat,/lat n = where(strpos(cat.obs_prog,'SYNOP') ge 0,cc) if cc eq 0 then return files = cat(n).filename nf = n_elements(files) files = files((0 > (nf-20)):*) endif nf = n_elements(files) for i=0,nf-1 do begin a = readcdsfits(files(i)) if datatype(a,1) eq 'Structure' then begin cds_new_spike,a nis_calib,a,/erg,/ster,/slit d = gt_windata(a,4) aa = [0.68,0.00,0.0,78.036,629.820,0.228] wr = indgen(22) fp = [1,2] w = pix2wave('n2',indgen(22)+998) multi_fit,d+100.,w,aa,fp,wr,out,line=1,lim=115 veloc = out(*,*,4) break_file,files(i),disk,dir,f,ext atf = '/archive/private/data/cds/atlas/'+f+'.jpg' window,0,xs=600,ys=650 window,1,xs=235,ys=260 wset,0 loadct,0 cds_snapshot,a,/noclean,/wavesort,/quasi,/large,chars=1.5,/roll atlas = tvrd() wset,1 s = size(veloc) n = where(veloc lt 629.2 or veloc gt 630.2,cc) for ii=0,s(2)-1 do begin veloc(*,ii) = veloc(*,ii) + 0.0045*ii*0.1175 endfor if cc gt 0 then begin veloc(n) = -100. nn = where(veloc gt 0) vav = mean(veloc(nn),/doub) veloc(n) = vav endif setflag,miss=-100. if s(1) eq 120 then sx = 2.0 else sx = 4.0 ; ; determine roll from image being processed ; DD = GT_WINDESC(A,0) IF DD.SPACING(1) LT 0 THEN ROLL = '180' ELSE ROLL = '0' if roll eq '180' then veloc = rotate(veloc,2) plot_image,sigrange(veloc),sca=[sx,1.68],tit='OV Velocity' v = tvrd() v = bytscl(v(60:220,62:246),top=max(atlas)) erase tvscl,v atlas(415,145) = v wset,0 tvscl,atlas ; write_gif,atf,atlas ; mk_jpg,atf tvlct,r,g,b,/get x2jpeg,atf,r,g,b,window=0 endif endfor end