deliangwang的个人博客分享 http://blog.sciencenet.cn/u/deliangwang

博文

网站文本抽取方法获得河外天体的银河系中性氢柱密度-IDL程序

已有 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
if !VERSION.OS_family eq 'Windows' then stop
euler,ra,dec,glon,glat,select=1
glon0=string(glon)
glat0=string(glat)
QueryURL = 'http://www.astro.uni-bonn.de/~webaiub/english/tools_labsearch.php?alpha='+strtrim(glon0,2)+'&beta='+strtrim(glat0,2)
result=webget(QueryURL)
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
  return,nh
End


https://blog.sciencenet.cn/blog-456360-657866.html

上一篇:读取NVSSlist的输出文件(IDL程序)
下一篇:天文学学生的IDL语言编程菜鸟笔记(六)巧妙判断操作系统
收藏 IP: 159.226.148.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-23 18:42

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部