;+ ; NAME stam.pro ; ; PURPOSE Read Mk4 FITS images & plot sky transmission vs airmass. ; ; SYNTAX stam, fits_list ; ; HISTORY Andrew L. Stanger HAO/NCAR 20 June 2002 ; 21 Sep 2001: recompute rmin & rmax. ;- PRO stam, fits_list stab = FLTARR (120) atab = FLTARR (120) CLOSE, 11 fits_name = '' ;--- File list loop. i = 0 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. dateobs = fxpar (hdu, 'DATE-OBS') timeobs = fxpar (hdu, 'TIME-OBS') dataform = fxpar (hdu, 'DATAFORM') dataform = STRTRIM (dataform, 2) syear = STRMID (dateobs, 0, 4) smonth = STRMID (dateobs, 5, 2) sday = STRMID (dateobs, 8, 2) IF (i EQ 0) THEN plotfile = syear + smonth + sday + '.mk4.st_am.ps' skytx = fxpar (hduext, 'SKYTX') amass = fxpar (hduext, 'AMASS') print, 'skytx/amass: ', skytx, amass ;--- Save sky transmission & airmass values. stab [i] = skytx atab [i] = amass i = i + 1 END ;} CLOSE, 11 ;--- Set postscript device. ;window, xsize = 640, ysize = 480, RETAIN=2 set_plot, 'PS' device, filename = plotfile print, 'plotfile: ', plotfile nimg = i st = stab [0:nimg-1] am = atab [0:nimg-1] ste = FLTARR (nimg) ;--- Compute Elmore's sky transmission based upon airmass. FOR i = 0, nimg -1 DO $ BEGIN ste [i] = -11.0 * am [i] + 376.0 END ;--- Plot airmass versus sky transmission. ptitle = dateobs + ' Mk4 Airmass vs. Sky Transmission' PLOT, am, st, $ xrange = [1.0, 6.0], $ yrange = [280.0, 380.0], $ psym = 1, $ title = ptitle, $ xtitle = 'Air Mass', $ ytitle = 'Sky Transmission' ;--- Overplot Sky transmission function (based on airmass). OPLOT, am, ste XYOUTS, 0.2, 0.15, 'line: y = -11 * airmass + 376', /normal device, /close set_plot, 'X' END