已有 2626 次阅读2013-1-30 12:36|个人分类:编程笔记|系统分类:科研笔记|程序, write, Source, Dec
Pro nvss_upfile,ra,dec,radius=radius,filename=filename,format=format
;+ ;NAME: ; nvss_upfile ;PURPOSE: ; write a upfile for NVSS matched source ;CALLING SEQUENCE: ; nvss_upfile,ra,dec,filename=filename ; ;INPUT: ; ra ----- RA for source in Unit:degree ; dec ----- DEC for source in Unit:degree ;OPTIONAL KEYWORD INPUT: ; radius ---- matched radius in Unit:arcsec ; default it,it will set it 15 arcsec ; format ---- if set it,it will output according to format ;OPTIONAL KEYWORD OUT: ; filename ---- upfile name ;EXAMPLE: ; IDL> nvss_upfile,ra,dec,filename='NVSS_update.dat' ; ;REVISION HISTORY: ; Original by DL.Wang,Aug-30-2007 ;-
if ( N_PARAMS() lt 2 ) then begin message,'Syntax:nvss_upfile,ra,dec,[ radius=radius, .... ]' return endif
if not keyword_set(radius) then radius=15
openw,lun,filename,/get_lun n=n_elements(ra) for i=0L,n-1 do begin if not keyword_set(format) then begin printf,lun,adstring(ra[i],dec[i],1),' ',radius,' ','0' endif else begin printf,lun,adstring(ra[i],dec[i],1),radius,'0',format=format endelse endfor free_lun,lun