;+ ; eikp2fits.pro IDL procedure ; ; PURPOSE ; Read a raw MLSO Prominence Monitor image (digitized from film) ; in EIKP format and convert it to a file in FITS format. ; ; SYNTAX ; eikp2fits, 'eikp_list' ; ; OUTPUT ; Image(s) in FITS format. ; ; PROCEDURES USED ; fxhmake ; fxaddpar ; writefits ; ; HISTORY ; Author: Andrew L. Stanger 17 October 1997 ;- pro eikp2fits, file_list pmon_eikp = '' ; Define PM file name variable. xdim = 452 ydim = 452 xcen = 0 ycen = 0 xcen = xdim / 2 ycen = ydim / 2 roll = 0.0 eikp_hdr = BYTARR (xdim) imgbuf = BYTARR (xdim, ydim) ; Define image array. CLOSE, 1 CLOSE, 2 OPENR, 1, file_list ; Open list file. WHILE (NOT EOF (1)) DO $ ; File processing loop. BEGIN READF, 1, pmon_eikp ; Read PM file name from list file. OPENR, 2, pmon_eikp ; Open PM raw image file. READU, 2, eikp_hdr ; Read PM header into buffer. READU, 2, imgbuf ; Read PM pixels into buffer. CLOSE, 2 ; Close PM raw image file. imgbuf = reverse (imgbuf, 2) ; Flip image top to bottom. ; imgbuf (*,*) = 255 - imgbuf (*,*) ; Invert image intensities. dmin = float (MIN (imgbuf)) ; Intensity minimum. dmax = float (MAX (imgbuf)) ; Intensity maximum. vmin = dmin ; Display minimum. vmax = dmax ; Display maxiumum. vmin = 0.0 ; Display minimum. vmax = 255.0 ; Display maximum. print, 'pmon_eikp: ', pmon_eikp, ' dmin/dmax: ', dmin, dmax ; -- Create FITS header. fxhmake, hdu, imgbuf ; Make simple FITS header for PM image. date = '17/02/89' ; 17 Feb 1989 = DOY 48 1989 hour = strmid (pmon_eikp, 0, 2) minute = strmid (pmon_eikp, 2, 2) second = strmid (pmon_eikp, 4, 2) time = hour + ':' + minute + ':' + second date_time = date + ' ' + time ang = PB0R (date_time, /ARCSEC) ; rsun = ang (2) cdelt = 8.00 pixrs = rsun / cdelt fxaddpar, hdu, 'CRPIX1', xcen, 'SUN CENTER: X AXIS [PIXELS]' fxaddpar, hdu, 'CRPIX2', ycen, 'SUN CENTER: Y AXIS [PIXELS]' fxaddpar, hdu, 'CRVAL1', 0.0, 'SUN CENTER: X AXIS [ARCSEC]' fxaddpar, hdu, 'CRVAL2', 0.0, 'SUN CENTER: Y AXIS [ARCSEC]' fxaddpar, hdu, 'CDELT1', cdelt, 'SCALE SIZE: X AXIS [ARCSEC/PIXEL]' fxaddpar, hdu, 'CDELT2', cdelt, 'SCALE SIZE: Y AXIS [ARCSEC/PIXEL]' fxaddpar, hdu, 'CUNIT1', 'ARCSEC', 'COORDINATE UNITS: X AXIS [ARCSEC]' fxaddpar, hdu, 'CUNIT2', 'ARCSEC', 'COORDINATE UNITS: Y AXIS [ARCSEC]' fxaddpar, hdu, 'CROTA1', roll, 'SOLAR NORTH ANGLE W.R.T. +Y AXIS' fxaddpar, hdu, 'CROTA2', roll, 'SOLAR NORTH ANGLE W.R.T. +Y AXIS' fxaddpar, hdu, 'CRRADIUS', pixrs, 'SOLAR RADIUS [PIXELS]' fxaddpar, hdu, 'RSUN', rsun, 'SOLAR RADIUS [ARCSEC]' fxaddpar, hdu, 'ORIGIN', 'MLSO', 'MAUNA LOA SOLAR OBSERVATORY' fxaddpar, hdu, 'TELESCOP', 'PMON', 'Prominence Monitor' fxaddpar, hdu, 'INSTRUME', 'FILM', 'B/W film camera' fxaddpar, hdu, 'OBJECT', 'SUN' fxaddpar, hdu, 'TYPE-OBS', 'H-ALPHA' fxaddpar, hdu, 'DATE-OBS', date, 'DD/MM/YY' fxaddpar, hdu, 'TIME-OBS', time, 'HH:MM:SS' fxaddpar, hdu, 'DATAMIN', dmin, 'MINIMUM INTENSITY OF DATA' fxaddpar, hdu, 'DATAMAX', dmax, 'MAXIMUM INTENSITY OF DATA' fxaddpar, hdu, 'DISPMIN', vmin, 'MINIMUM INTENSITY FOR DISPLAY' fxaddpar, hdu, 'DISPMAX', vmax, 'MAXIMUM INTENSITY FOR DISPLAY' fxaddpar, hdu, 'DISPDIR', 'RU', 'DISPLAY DIR X: RIGHT, Y: UP' ; -- Write FITS image to disk. pmon_fits = 'eikp.890217.' + pmon_eikp + '.fts' ; Create output file name. writefits, pmon_fits, imgbuf, hdu END CLOSE, 1 END