pro colors_blk_intrp,cblock,teffu,loggu,logzu,teffi,loggi,logzi,colsout,$ xform=xform ; This routine accepts the color block data cblock, defined on a ; grid with coordinates teffu, loggu, logzu ; (typically obtained from a file written by color_block.pro, ; color_fillin.pro, or ; color_fillout.pro), and three vectors of length npt of parameters ; teffi, loggi, logzi for which colors are desired. It interpolates into ; the color block to generate the corresponding colors colsout(nc,npt). ; If keyword xform is set, it transforms the colors according to the ; transformations in file xform before returning. ; find indices into the color block for the desired inputs sz=size(cblock) lteffu=alog10(teffu) nc=sz(1) nt=sz(2) nlg=sz(3) nlz=sz(4) iit=findgen(nt) iig=findgen(nlg) iiz=findgen(nlz) npt=n_elements(teffi) jt=interpol(iit,lteffu,alog10(teffi)) jg=interpol(iig,loggu,loggi) jz=interpol(iiz,logzu,logzi) colsout=fltarr(nc,npt) for i=0,nc-1 do begin uu=reform(cblock(i,*,*,*),nt,nlg,nlz) cv=interpolate(uu,jt,jg,jz) colsout(i,*)=reform(cv,1,npt) endfor if(keyword_set(xform)) then begin xform_colors,colsout,xform,colsoutt colsout=colsoutt endif end