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

博文

由SDSS的测光坐标得到SDSS源的名字(IDL程序)

已有 2634 次阅读 2013-1-29 23:09 |个人分类:编程笔记|系统分类:科研笔记| Position, 程序

Function sdssname_radec, ra_sdss, dec_sdss

;+
;NAME:
;     sdssname_radec
;PURPOSE:
;     get SDSS name from RA and DEC for SDSS  PhotoObj position
;INPUT:
;     ra_sdss  ---  RA for SDSS  PhotoObj position in Unit:degree
;     dec_sdss ---  DEC for SDSS  PhotoObj position in Unit:degree
;OUTPUT:
;     sdssname
;REVISION HISTORY:
;     Originla by DL.Wang,Oct-16-2008
;-

if n_elements(ra_sdss) ne  n_elements(dec_sdss) then begin
   print,'please check the number of RA and DEC!!'
   return,-1
endif

num=n_elements(ra_sdss)
sdssname=strarr(num)
for i=0L,num-1 do begin
    ra=sixty(ra_sdss[i]/15.0)
    dec=sixty(dec_sdss[i])
    index=where(dec[0] ge 0,count)
    if count gt 0 then sign='+' else sign='-'
             radec=string(ra[0],format='(I2.2)')+string(ra[1],format='(I2.2)')+strmid(string(ra[2]),strpos(string(ra[2]),'.')-2,2)+'.'+strmid(string(ra[2]),strpos(string(ra[2]),'.')+1,2)+sign+string(dec[0],format='(I2.2)')+string(dec[1],format='(I2.2)')+strmid(string(dec[2]),strpos(string(dec[2]),'.')-2,2)+'.'+strmid(string(dec[2]),strpos(string(dec[2]),'.')+1,1)
    
    sdssname[i]='SDSS J'+strjoin(strsplit(radec,' ',/extract),'0')
endfor

return,sdssname

End



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

上一篇:写一个与2MASS数据库做位置匹配的上传文件的IDL程序
下一篇:写一个与NVSS做位置匹配的源列表文件(IDL程序)
收藏 IP: 123.86.144.*| 热度|

1 杨华磊

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

数据加载中...

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

GMT+8, 2024-4-20 00:20

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部