;+ ; NAME fixhsh_minmax.pro ; ; PURPOSE Read CHIP hsh FITS images & modifies dispmin & dispmax. ; ; SYNTAX fixhsh_minmax, fits_list ; ; HISTORY Andrew L. Stanger HAO/NCAR 14 Dec 2001 ;- pro fixhsh_minmax, fits_list dmin = -900.0 dmax = 100.0 comment_dispmin = '' comment_dispmax = '' CLOSE, 11 fits_name = '' ;--- File list loop. OPENR, 11, fits_list WHILE (NOT EOF (11)) DO $ BEGIN ;{ ;--- Read FITS image header & pixel data. READF, 11, fits_name ; Get file name. print, 'fits_name: ', fits_name ftspos = STRPOS (fits_name, '.fts') img = readfits (fits_name, hdu, /noscale) ; Read image. ext = readfits (fits_name, hduext, exten_no=1) ; Read extension. ;--- Extract information from header. bscale = fxpar (hdu, 'BSCALE') bzero = fxpar (hdu, 'BZERO') dispmin = fxpar (hdu, 'DISPMIN', comment_dispmin) dispmax = fxpar (hdu, 'DISPMAX', comment_dispmax) sdmin = (dmin - bzero) / bscale sdmax = (dmax - bzero) / bscale cdmin = STRTRIM (STRING (dmin, FORMAT='(F8.2)'), 2) cdmax = STRTRIM (STRING (dmax, FORMAT='(F8.2)'), 2) comment_dispmin = ' MIN. DISPLAY VALUE (' + cdmin + ')' comment_dispmax = ' MAX. DISPLAY VALUE (' + cdmax + ')' fxaddpar, hdu, 'DISPMIN', dmin, comment_dispmin fxaddpar, hdu, 'DISPMAX', dmax, comment_dispmax ;--- Write modified FITS file to disk. writefits, fits_name, img, hdu writefits, fits_name, ext, hduext, /APPEND END ;} CLOSE, 11 END