;------------------------------------------------------------------ ;+ ; NAME: ; LCQXSETUP ; 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. ; ; Modified version for old QX images. Assumes 12-bit images. ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; LCQXSETUP,vfile,jfile,zpoff ; INPUTS: ; vfile = file name for input magnetogram (FITS format). ; jfile = file name for input direct image (FITS format). ; zpoff = zero-point offset for Quantex I image. ; KEYWORD PARAMETERS: ; OUTPUTS: ; vfiless = FITS file of rebinned and "flattened" magnetogram ; This image is also divided by intensity. ; jfiless = FITS file of rebinned direct image ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; J. Varsik, 18 Dec. 1995 --- Modified from LCSETUP ; for old QX images. ;- ;------------------------------------------------------------------- pro lcqxsetup,vfinam,jfinam,zpoff ; Display IDL header if help is required. if (keyword_set(help)) then begin get_idlhdr,'lcqxsetup.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) vib = make_array(640,640,/byte,value=128) vib(64,64) = vi ; Unwrap, subtract 128, rescale viuw = unwrap(fix(vib)) vii = viuw - 128 vix = 16 * vii ; Generate boxcar smoothed file and subtract. s = SMOOTH(vix,50) vo = vix - s vos = vo(64:575,64:544) ; Read J file ji = READFITS(jfinam,jih,/NOSCALE) ; Rebin images vs = fix(CONGRID(vos,512,384)) js = byte( CONGRID(ji,512,384)) ; Divide by intensity vsd = fix((256.0 * vs)/(fix(js) + zpoff)) ; Write files CHECK_FITS,vsd,vih,/UPDATE,/FITS CHECK_FITS,js,jih,/UPDATE,/FITS WRITEFITS,vfonam,vsd,vih WRITEFITS,jfonam,js,jih finishup: return end