function fiss_raster_v3, file, wv1, hw1, wvband, refx, pca=pca, pixel=pixel ;+ ; Name: fiss_raster_v3 ; Construct a set of raster images at different wavelengths ; either from FITS file or PCA files ; ; ; Syntax: Result=fiss_raster( file, wv, hw, wvband, refx, /pca, /pixel) ; ; Returned Values: A set of raster images constructed at the specified wavelength(s) ; ; Arguments: ; file name of FISS file to be read ; wv wavelength(s) ; hw half-width(s) for wavelength integration ; in uint of angstrom ; ; Keywords: ; pca if set, coefficients of principal components are used for ; image construction (default is set). ; pixel if set, wavelengths and half-widths are in pixel units. ; Useful for data not calibrated for wavelength. ; ; Remarks: By default, wavelengths and half widths are in unit of angstrom, and wavelengths ; are measured from the center of the reference line.; ; if pixel keyword is set, wavelengths are measured in unit of pixels and ; are measured from the first pixel in the row. ; ; Required routines: fiss_read_frame, fiss_conf_wvcalib_v2 ; ; History: ; 2010 July, first coded (J. Chae) ; 2010 Oct. Dong-uk Song ; ;- on_error, 1 if n_elements(pca) eq 0 then pca=1 nsel= n_elements(wv1) if n_elements(hw1) ne nsel then hw1=replicate(hw1[0], nsel) null=fiss_read_frame(file, 0, h) nx=fxpar(h, 'NAXIS3') ny=fxpar(h, 'NAXIS2') nw=fxpar(h, 'NAXIS1') band=fxpar(h, 'WAVELEN') if keyword_set(pixel) then begin wv=wv1 hw=hw1 endif else begin fiss_conf_wvcalib_v2, FILE, wvband, refx, dldw, wwc, wvcen wc=wwc wl=(findgen(nw)-wc)*dldw wv=intarr(nsel) for l=0, nsel-1 do begin dwl=abs(wl-wv1[l]) wv[l]=(where(dwl eq min(dwl)))[0] endfor hw=round(abs(hw1/dldw)) endelse images= fltarr(nx, ny, nsel) for x=0, nx-1 do begin sp = fiss_read_frame(file, x, pca=pca) for l=0, nsel-1 do images[x,*,l]=total(sp[wv[l]-hw[l]:wv[l]+hw[l], *],1) endfor return, images end ;aa=fltarr(3,1) ;for i=0,2 do aa[i,*]=total(a[i,*])