PRO lightcurve, w, t, f, lc, dm ;; extract lightcurve from 2d spectra ;; Input ; ; w wavelength array ; t timing array ; f 2d spectra f(w,t) ; ;; Output ; lc light curve F(t), where F = Int[ f(w)dw ] ; dm light curve in differential magnitudes ; ;; nw = n_elements(w) nt = n_elements(t) ;; trapezoidal integration lc = fltarr(nt) lc = 0. FOR iw = 0,nw-2 DO BEGIN lc = lc + ( w(iw+1)-w(iw) ) * ( f(iw,*)+f(iw+1,*) ) / 2. ENDFOR lc = lc / ( w(nw-1) - w(0) ) ;; normalize integral dm = 2.5 * alog10 ( lc / mean (lc ) ) ;; convert to differntial magnitudes END