;+ ; smmcpcor.pro IDL procedure ; ; PURPOSE ; Read an SMM C/P FITS image and remove stray light & vignetting. ; ; SYNTAX ; smmcpcor, 'fits_list' ; ; PROCEDURES USED ; readfits ; writefits ; fxaddpar ; cpstray ; cpvignet ; fcorona ; rcoord ; ; HISTORY ; Author: Andrew L. Stanger 16 June 1999 ; 17 Aug 2001 : Read & write FITS extension. ;- pro smmcpcor, fits_list fits_name = '' ; Define FITS file name variable. xdim = 0 ydim = 0 xcen = 0 ycen = 0 roll = 0.0 mag = 1.0 r = 0.0 th = 0.0 str = 0.0 vig = 1.0 fc = 0.0 cc = 2.0 ; Jupiter calibration correction factor. CLOSE, 1 CLOSE, 2 print, 'fits_list: ', fits_list OPENR, 1, fits_list ; Open list file. WHILE (NOT EOF (1)) DO $ ; File processing loop. BEGIN READF, 1, fits_name ; Read FITS file name from list file. PRINT, fits_name img = readfits (fits_name, hdu) ; Read FITS image & header. ; hk = readfits (fits_name, ext, /noscale, exten_no=1) ; Read extension. xdim = fxpar (hdu, 'NAXIS1') ydim = fxpar (hdu, 'NAXIS2') xcen = fxpar (hdu, 'CRPIX1') ycen = fxpar (hdu, 'CRPIX2') roll = -fxpar (hdu, 'CROTA2') pixrs = fxpar (hdu, 'CRRADIUS') rsun = fxpar (hdu, 'RSUN') print, 'xdim, ydim: ', xdim, ydim ; -- Remove Stray Light & Vignetting. FOR iy = 0, ydim - 1 DO $ BEGIN PRINT, 'row: ', iy FOR ix = 0, xdim - 1 DO $ BEGIN ierr = rcoord (r, th, float (ix), float (iy), -1, $ roll, xcen, ycen, pixrs) str = cpstray (r * rsun) vig = cpvignet (r * rsun) fc = fcorona (r, th) img [ix, iy] = ((img [ix, iy] * cc - str) * vig) - fc END END ; -- Modify FITS header. fxaddpar, hdu, 'BSCALE', 1.0, ' BSUN = DATA * BSCLAE + BZERO fxaddpar, hdu, 'BZERO', 0.0, '' fxaddpar, hdu, 'STRAY', 'REMOVED', ' STRAY LIGHT REMOVED' fxaddpar, hdu, 'VIGNET', 'REMOVED', ' VIGNETTING LIGHT REMOVED' fxaddpar, hdu, 'FCORONA', 'REMOVED', ' F-CORONA REMOVED' fxaddpar, hdu, 'HISTORY', 'STRAY LIGHT, VIGNETTING & F-CORONA REMOVED.' ; -- Write FITS image to disk. sloc = RSTRPOS (fits_name, '.fts') rfits_name = strmid (fits_name, 0, sloc) + '.svf.fts' ; Create output file name. print, 'rfits_name: ', rfits_name writefits, rfits_name, imgout, hdu ; writefits, rfits_name, hk, ext, /APPEND END CLOSE, 1 END