Документ взят из кэша поисковой машины. Адрес оригинального документа : http://star.arm.ac.uk/~csj/idl/lightcurve.pro
Дата изменения: Fri Apr 4 19:53:42 2008
Дата индексирования: Sun Apr 10 02:42:30 2016
Кодировка:

Поисковые слова: integral
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
dm = lc / mean (lc ) - 1 ;; convert to fractional light variation

END