;+ ; ;jfix,cubefromidl,file=file ; ; THIS IS A QUICK FIX FOR THE LATEST WEIRD STRIP OF BAD PIXELS IN JBB CUBES ; PASS IN THE NAME OF THE FILE OR A DATACUBE AND IT WILL FIX THE THREE BAD ROWS OF DATA ;- PRO zfix2,cubefromidl,file=file ;these are the bad pixels there are different sets try zfix and zfix2 ;X,Y,SPEC ;3 38 137:152 ;4 38 171:186 ;5:38 204:220 ;6,38,239:254 ;7 38 275:288 ;8:38 313:323 ;9,38,347:352 ;10,38,383:387 ;11,38,419:422 ;6,39,501:505 ;1,31,589:591 ;2,31:34,605:636 ;3,638:669 ;4,674:702 ;5,709:736 ;6,743:770 ;7,778:804 ;8,813:838 ;9,848:872 ;10,884:906 ;11,920:939 ;12,30:34,955:974 ;13,986:1012 ;14,1021:1046 ;15,1054:1080 ;16:1087:1115 ;17,32:34,1120:1150 ;bigset ;1,22,112:134 ;2,34:42,94:126 ;3,128:160 ;4,162:194 ;5,197:229 ;6,231:263 ;7,265:298 ;8,300:332 ;9,335:367 ;10,370:402 ;11,404:436 ;12,438:470 ;13,473:504 ;14,507:539 ;15,541:573 ;16,575:607 ;17,609:641 ;16,21,627:648 if (keyword_set(file)) then begin image=readfits(file,h,exten=0) noise=readfits(file,exten=1) flags=readfits(file,exten=2) dataset={image:ptr_new(image),noise:ptr_new(noise),flags:ptr_new(flags)} cube=*dataset.image endif else cube=cubefromidl start=[94,128,162,197,231,265,300,335,370,404,438,473,507,541,575,609] final=[126,160,194,229,263,298,332,367,402,436,470,504,539,573,607,641] xrow=[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17] for col=0,15 do begin i=xrow[col] for j=start[col],final[col] do begin for k=34,42 do begin cube[j,k,i]=median([cube[j,k+1,i-1],cube[j,k+1,i+1],cube[j,k-1,i-1],cube[j,k-1,i+1],cube[j,k,i-1],cube[j,k,i+1]],/even) endfor endfor endfor ;one pix at x=16, y=21 for j=627,648 do begin cube[j,21,16]=median([cube[j,22,15],cube[j,20,15],cube[j,21,15],cube[j,20,16],cube[j,22,16]],/even) endfor ;one pix at x=1, y=22 for j=112,134 do begin cube[j,22,1]=median([cube[j,23,2],cube[j,21,2],cube[j,22,2],cube[j,21,1],cube[j,23,1]],/even) endfor if (keyword_set(file)) then begin sxaddpar,h,'JFIX',1.0,'Bad rows fixed by jfix2.pro' file='fixed_'+file writefits,file,cube,h writefits,file,*dataset.noise,/append writefits,file,*dataset.flags,/append endif else cubefromidl=cube ;tvscl,rebin(total(cube,1),640,190)<100000 end