Commit 5f81c932 authored by Manolo Collados's avatar Manolo Collados
Browse files

Tenerife updates from Tue Sep 14 01:00:02 WEST 2021

parent 3434a00a
......@@ -71,7 +71,7 @@ function mpfit_fts,par,xval=x,yval=y,errval=err,wgt=wgt,_extra=_extra, $
;interpolate fts to same grid as observation
ftsip=interpol(fts[4,*],fts[1,*],wlobs)
atmip=interpol(fts[3,*],fts[1,*],wlobs)
wgt=atmip ge 0.95
wgt=atmip ge 0.95 ;remove telluric blends
;remove first & last nb points from
;fitting (at
; nb=15
......@@ -89,6 +89,9 @@ function mpfit_fts,par,xval=x,yval=y,errval=err,wgt=wgt,_extra=_extra, $
kernel=exp(-0.5*(kernelx/sigma)^2)
kernel=kernel/total(kernel)
ftscon=convol(ftsip,kernel,/edge_truncate)
;apply convolution also for telluric line removal
wgtcon=convol(float(wgt),kernel,/edge_truncate)
wgt=wgtcon ge .99
if fitset.strayfit then if np gt 3 then begin
;add white light
......@@ -241,6 +244,7 @@ function fit2fts,iprof,show=show,lambda=lambda,order=order,npoly=npoly, $
common oldfit,oldfitpar
show=keyword_set(show)
show=1b
print,strjoin(replicate('=',80))
print,'FTS-fitting, please wait...'
if keyword_set(show) eq 0 then $
......@@ -275,7 +279,7 @@ function fit2fts,iprof,show=show,lambda=lambda,order=order,npoly=npoly, $
minfit=1
repeat begin
infts=where(ftsfull[1,*] ge wl-wlrg and ftsfull[1,*] le wl+wlrg)
infts=where(ftsfull[1,*] ge wl-wlrg and ftsfull[1,*] le wl+wlrg) ;take only in WL-range
if infts[0] eq -1 then message,'wavelength not coverd by FTS spectrum'
fts=ftsfull[*,infts]
......@@ -339,7 +343,7 @@ function fit2fts,iprof,show=show,lambda=lambda,order=order,npoly=npoly, $
print,strjoin(replicate('=',80))
if fitness lt minfit then begin
print,'Bad FTS fitting.
print,'Bad FTS fitting.'
if repeatfit lt 5 and not keyword_set(lazy) then begin
print,'Trying again.'
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment