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程序)