Документ взят из кэша поисковой машины. Адрес оригинального документа : http://hea-www.harvard.edu/PINTofALE/pro/dummyid.pro
Дата изменения: Fri Feb 24 00:35:39 2006
Дата индексирования: Tue Oct 2 00:33:49 2012
Кодировка:

Поисковые слова: aldebaran
function dummyid,AA, _extra =e
;+
;function dummyid
; Convert a RD_LINE() style emissivity structure into a dummy
; ID structure such as that generated by LINEID()
;
;syntax
; idstr=dummyid(linstr,DEM=DEM,/temp,abund=abund,/noph,$
; nhne=nhne,effar=effar,wvlar=wvlar,/ikeV,/noabund)
;
;parameters
; linstr [INPUT; required] RD_LINE() or RD_LIST() style line
; emissivity structure
;
;keywords
; _extra [INPUT ONLY] use this to pass defined keywords to subroutines
; LINEFLX: DEM,ABUND,EFFAR,WVLAR,NOABUND,NHNE,NOPH,TEMP,IKEV
;
;subroutines
; LINEFLX()
;history
; liwei lin (Feb06) lift parameter check from cat_ln()
; cleaned up a bit (VK; Feb06)
;-

; usage
ok='ok' & np=n_params() & sza=size(AA) & nsa=n_elements(sza)
if np eq 0 then ok='Insufficient parameters' else $
if sza[0] eq 0 then ok='Input line structure is undefined' else $
if sza[nsa-2] ne 8 then ok='Input must be a structure'
if ok ne 'ok' then begin
print,'Usage: idstr=dummyid(linstr,DEM=DEM,/temp,abund=abund,/noph,$'
print,' nhne=nhne,effar=effar,wvlar=wvlar,/ikeV,/noabund)
print,' convert emissivity structure to id structure'
if np ne 0 then message,ok,/informational
return,-1L
endif
A=AA

; catch input errors
c1='ok'
;
tagA=tag_names(A)
if tagA[0] eq 'WVL' and tagA[1] eq 'ID0' then return,AA ;no need to change
if tagA[0] ne 'LINE_INT' or tagA[1] ne 'LOGT' then c1=$
'Structure not in right format'
;
if c1 ne 'ok' then begin & message,c1,/informational & return,-1L & endif
str1 = AA

nln = n_elements(str1.wvl)
; compute fluxes
afx = lineflx(aa.line_int, aa.logt, aa.wvl, aa.z, _extra=e)
afxe= 0*afx

; check desig and config and make labl
tst = strarr(1) & tstf = 'no'
tst1 = where( str1.config eq tst, ntst1)
tst2 = where( str1.desig eq tst, ntst2)

if ntst1 le 0 and ntst2 le 0 then begin
labl=['('+str1.config[0,*]+')'+' '+str1.desig[0,*], $
' ('+str1.config[1,*]+') '+str1.desig[1,*]]
endif else labl = strarr(2,nln)

; for rspstr entered in str1
for j = 0, nln-1 do begin
; construct an ID for each line
nstr1c = {wvl:str1.wvl(j),$
z:[str1.z(j)],$
ion:[str1.ion(j)],$
labl:labl[*,j],$
flux:afx(j),$
fluxerr:afxe(j),$
logt:str1.logt,$
emis:str1.line_int[*,j]}
if j eq 0 then nstr1 = create_struct('ID0',nstr1c) else $
nstr1=create_struct(nstr1,'ID'+strtrim(j,2),nstr1c)
endfor
wvl=str1.wvl & nstr1=create_struct('wvl',wvl,nstr1)

return, nstr1
end