;------------------------------------------------------------------ ;+ ; NAME: ; LCSETUP ; PURPOSE: ; This procedure accepts two BBSO VMG FITS files, one V ; image (magnetogram) and one J or I image (direct image). ; A 50 x 50 boxcar smoothed image is generated and subtracted ; from the magnetogram to remove large-scale non-uniformities ; in the magnetogram (often due to KDP fringes). Then, ; both the V and the J (or I) images are rebinned from ; 512 x 481 to 512 x 384 to make the pixels square. ; The resulting images are written back to the disk as FITS ; images. The letters "ss" are put in the file name before ; the extension (before the first "." in the file name or ; at the end of the name). ; ; Note that the old IRAF version deleted the original FITS ; files. This version does not. ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; LCSETUP(vfile,jfile) ; INPUTS: ; vfile = file name for input magnetogram (FITS format). ; jfile = file name for input direct image (FITS format). ; KEYWORD PARAMETERS: ; OUTPUTS: ; vfiless = FITS file of rebinned and "flattened" magnetogram ; jfiless = FITS file of rebinned direct image ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; J. Varsik, 13 Oct. 1995 --- Port from IRAF task ;- ;------------------------------------------------------------------- pro lcsetup,vfinam,jfinam ; Display IDL header if help is required. if (keyword_set(help)) then begin get_idlhdr,'lcsetup.pro' goto,finishup endif ; Make output file names. dotpos = STRPOS(vfinam,".") vflen = dotpos vfin1 = STRMID(vfinam,0,vflen) exlen = STRLEN(vfinam) - vflen ext = STRMID(vfinam,dotpos,exlen) vfonam = vfin1 + 'ss' + ext dotpos = STRPOS(jfinam,".") jflen = dotpos jfin1 = STRMID(jfinam,0,jflen) exlen = STRLEN(jfinam) - jflen ext = STRMID(jfinam,dotpos,exlen) jfonam = jfin1 + 'ss' + ext ; Read V file vi = READFITS(vfinam,vih,/NOSCALE) vixa = make_array(640,640,/int,value=0) vixa(64,64) = vi ; Generate boxcar smoothed file and subtract. s = SMOOTH(vixa,50) vo = vixa - s vos = vo(64:575,64:544) ; Read J file ji = READFITS(jfinam,jih,/NOSCALE) ; Rebin images vs = CONGRID(vos,512,384) js = CONGRID(ji,512,384) ; Write files CHECK_FITS,vs,vih,/UPDATE,/FITS CHECK_FITS,js,jih,/UPDATE,/FITS WRITEFITS,vfonam,vs,vih WRITEFITS,jfonam,js,jih finishup: return end