已有 2896 次阅读2013-1-30 12:48|个人分类:编程笔记|系统分类:科研笔记|银河系, 程序, result, Dec
;+ ;NAME: ; querynednh ;PURPOSE: ; Query the HI column density of the LAB Survey for given position ;CALLING SEQUENCE: ; result=querynednh(ra,dec) ;EXAMPLE: ; IDL> ra=2.018361*15 ; IDL> dec=0.56667 ; IDL> result=querynednh(ra,dec) ; IDL> print,result ; 2.1600001e+20 ; ; IDL> result=querynednh(ra,dec,/two) ; IDL> print,result ; 2.1600001 ; ;PROCESS: ; webget( ),Euler ;INPUT: ; ra ---- right Longitude in degrees (sclar or veltor) ; dec ---- Latitude in degrees (sclar or veltor) ;OPTIONAL KEYWORD INPUT: ; /nearest ----- if set it, will give the HI column density of the ; nearest position of the selected position. ; default it, will give the HI column density of the ; selected position. ; /two ---- if set it, will give the HI column density in ; Unit :10^20 cm^-2 ; default it, will give the HI column density in cm^-2 ;OUTPUT: ; nh ---- the HI column density of line-of-sight ;METHOD: ; see: ; http://www.astro.uni-bonn.de/%7Ewebrai/english/tools_labsurvey.php ; by integrating over the velocity range from -400 to +400 km/s in ; the LSR frame. ; ; Kalberla,P.M.W.,Burton,W.B.,Hartmann,Dap,Arnal,E.M.,Bajaja,E., ; Morras,& Poppel,W.G.L.(2005),A&A,440,775 ; ; Bajaja,E.,Arnal, E.M., Larrarte,J.J., Morras, R., Poppel, ; W.G.L.,& Kalberla, P.M.W. 2005, A&A, 440, 767 ; ; Arnal, E. M., Bajaja, E., Larrarte, J. J., Morras, R., & ; Poppel, W. G. L. 2000, A&AS, 142, 35 ; ; Hartmann & Burton 1997, Cambridge University Press, ISBN ; 0521471117 ; ;REVISIONHISTORY: ; ORiginal by DL.Wang,26-Jun-2007 ; chage the weblink as follow: ; http://www.astro.uni-bonn.de/~webaiub/english/tools_labsearch.php ; by DL.Wang,Sep-22-2008 ; add !VERSION.OS check by DL.Wang,Oct-27-2011 ;-
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Function querynednh_lab, ra, dec, nearest=nearest, two=two
if N_params() lt 2 then begin print,'Syntax - info = querynednh(ra, dec)' print,' RA (degrees), Dec (degrees) -- search coordinates' endif
na=n_elements(result.text) ear=strarr(na) for i=0L,na-1 do begin ear[i]=result.text[i] print,i,' ',ear[i] endfor
t=result.text
if not keyword_set(nearest) then begin t[66]=strtrim(t[66],1) nh0=strmid(t[66],18,5) nh1=strmid(t[66],38,2) nh=float(nh0)*10.0D0^float(nh1) endif else begin t[74]=strtrim(t[74],1) nh0=strmid(t[74],18,5) nh1=strmid(t[74],38,2) nh=float(nh0)*10.0D0^float(nh1) endelse
if not keyword_set(two) then begin nh=nh endif else begin nh=nh*1.0D-20 endelse
return,nh
End ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function querynednh,ra, dec, nearest=nearest, two=two
n=n_elements(ra) nh=dblarr(n) if not keyword_set(nearest) and not keyword_set(two) then begin for i=0L,n-1 do begin nh[i]=querynednh_lab(ra[i],dec[i]) endfor endif
if not keyword_set(nearest) and keyword_set(two) then begin for i=0L,n-1 do begin nh[i]=querynednh_lab(ra[i],dec[i],/two) endfor endif
if keyword_set(nearest) and not keyword_set(two) then begin for i=0L,n-1 do begin nh[i]=querynednh_lab(ra[i],dec[i],/nearest) endfor endif
if keyword_set(nearest) and keyword_set(two) then begin for i=0L,n-1 do begin nh[i]=querynednh_lab(ra[i],dec[i],/nearest,/two) endfor endif