;------------------------------------------------------------------ ;+ ; NAME: ; LCSETUP ; PURPOSE: ; This procedure accepts two BBSO VMG FITS files, one V ; image (magnetogram) and one J or I image (direct image). ; A flat-field magnetogram generated from Jongchul Chae's ; vmg_flat procedure is subtracted from the magentogram ; to remove large-scale non-uniformities in the magnetogram. ; ; 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 returned in the viss and jiss ; variables. ; ; Note that the old IRAF version deleted the original FITS ; files. This version does not. ; ; Note that the old version (using the boxcar smoothing) ; did not scale the VMG image when it was loaded. This ; version does. ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; LCSETUP,vfile,jfile,vih,jih,viss,jiss,flatfile,jflat ; INPUTS: ; vfile = file name for input magnetogram (FITS format). ; jfile = file name for input direct image (FITS format). ; flatfile = IDL variable containing VMG flatfield image. ; jflat = IDL variable containing J flatfield image. ; KEYWORD PARAMETERS: ; OUTPUTS: ; viss = IDL variable containing rebinned and "flattened" magnetogram ; jiss = IDL variable containing rebinned, flattened direct image ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; J. Varsik, 13 Oct. 1995 --- Port from IRAF task ; J. Varsik, 08 Jan. 1999 --- Change to use flatfield image. ; J. Varsik, 24 Feb. 1999 --- Add J flatfield. ;- ;------------------------------------------------------------------- pro lcsetup,vfinam,jfinam,vih,jih,viss,jiss,ffimg,jfimg ; Display IDL header if help is required. if (keyword_set(help)) then begin get_idlhdr,'lcsetup.pro' goto,finishup endif ; Read V file vi = READFITS(vfinam,vih) vo = vi - ffimg ; Normalize J flat jmean = mean(jfimg) jn = jfimg / jmean ; Read J file ji = READFITS(jfinam,jih,/NOSCALE) nz = where(jn ne 0.) z = where(jn eq 0., numzeros) if (numzeros gt 0) then begin jo(nz) = ji(nz) / jn(nz) jo(z) = 0. endif else begin jo = ji / jn endelse ; Rebin images viss = CONGRID(vo,512,384) jiss = CONGRID(jo,512,384) finishup: return end