Pro write_2mass_upfile,ra,dec,radius=radius,name=name, $
filename=filename,format=format
;+
;NAME:
; write_2mass_upfile
;PURPOSE:
; write a upfile for matched source list,matched with 2MASS
;CALLING SEQUENCE:
; write_2mass_upfile,ra,dec,radius=radius,filename=filename,format=format,
; /name
;INPUT:
; RA ----- RA for matched source list in Unit:degree
; DEC ----- DEC for matched source list in Unit:degree
;OPTIONAL KEYWORD INPUT:
; radius ----- match radius in Unit:arcsec
; default it,radius is 7.0 arcsec
; name ----- if set it,it will print source name.
; default it,it will print source sequence
;OPTIONAL KEYWORD OUTPUT:
; filename ----- name for output file
; default it,filename is '2mass_update.dat'
; format ----- format for output data
;
;EXAMPLE:
; IDL> write_2mass_upfile,ra,dec,filename='rgb_2mass_update.dat'
;
;REVISION HISTORY:
; Original by DL,Wang,Aug-17-2007
;-
Npar = N_params()
if ( Npar lt 2 ) then message, $
'ERROR - RA and Declination do not have equal number of elements'
if not keyword_set(radius) then radius=7.0
if not keyword_set(format) then format='(1x,A14,1x,F10.6,1x,F10.6,1x,F3.1)'
if not keyword_set(filename) then filename='2mass_update.dat'
openw,lun,filename,/get_lun
printf,lun,' Example of cone search'
printf,lun,"EQUINOX = 'J2000.0'"
printf,lun,'| objname | ra | dec | radius |'
printf,lun,'| string | double | double | double |'
printf,lun,'| unit | unit | unit | arcsec |'
if not keyword_set(name) then begin
for i=0L,n_elements(ra)-1 do begin
printf,lun,i+1,ra[i],dec[i],radius,F=format
endfor
endif else begin
for i=0L,n_elements(ra)-1 do begin
printf,lun,name[i],ra[i],dec[i],radius,F=format
endfor
endelse
free_lun,lun
End
https://blog.sciencenet.cn/blog-456360-657731.html
上一篇:
2MASS星等转化为流量的IDL程序下一篇:
由SDSS的测光坐标得到SDSS源的名字(IDL程序)