;+ ;NAME: ; nvss_read ;PURPOSE: ; read data from outfile by NVSSlist ;CLING SEQUENCE: ; nvss_read,filename, ra, dec, dist, flux, major, minor, pa, res, $ ; p_flux, p_ang, field, xpix, ypix, $ ; nvss, not_nvss ;CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ;CC ;CC Waring: ;CC ;CC This code is used under the condition that one source have ;CC only one matched source in the NVSS catalog ;CC ;CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ;INPUT: ; filename -- name of NVSSlist outfile ;OUTPUT: ; ra --- RA in h:m:s ; dec --- DEC in d:m:s ; dist --- distance between matched source & NVSS source ; in Unit: arcsec ; flux --- flux in Unit: mJy ; major --- ; minor --- ; pa --- ; res --- Residual (Res) code ; P* => high peak, ; R* => high RMS, ; S* => high integral ; p_flux --- ; p_ang --- ; field --- ; xpix --- ; ypix --- ; nvss --- index of detected source ; not_nvss --- index of not detected source ; ;OPTIONAL KEYWORD OUTPUT: ; type_trans --- if set it,dist,flux,p_flux will be float, ; default it,they will be string ; ;EXAMPLE: ; IDL> filename='rgb_nvss.dat' ; IDL> nvss_read,filename, ra, dec, dist, flux, major, minor, pa, res, ; p_flux, p_ang, field, xpix, ypix, nvss, not_nvss ; ;PROCESS: ; extract_multarr ;REVISION HISTORY: ; Original by DL.Wang,Aug-29-2007 ; ;-
temp = '' openr,lun,filename,/get_lun for j = 0L, nlines-1 do begin
readf, lun, temp
;########################################### ;########### blank row pos=strpos(temp,'') if pos eq -1L then begin ; length=strlen(temp) ; if length eq 0L then begin index0[j]=0L keep[j]=0L ra[j]='' dec[j]='' dist[j]='' flux[j]='' major[j]='' minor[j]='' pa[j]='' res[j]='' p_flux[j]='' p_ang[j]='' field[j]='' xpix[j]='' ypix[j]=''
endif ;########################################### ;######### Source row unpos=strpos(temp,'SOURCE NOT FOUND') if unpos ne -1L then begin index0[j]=1L keep[j]=0L ra[j]='' dec[j]='' dist[j]='' flux[j]='' major[j]='' minor[j]='' pa[j]='' res[j]='' p_flux[j]='' p_ang[j]='' field[j]='' xpix[j]='' ypix[j]=''
endif
rapos=strpos(temp,'|') if rapos ne -1 then begin dat=strsplit(temp,'|',/extract)
if n_elements(dat) eq 13 then begin index0[j]=1L keep[j]=1L ra[j]=dat[0] dec[j]=dat[1] dist[j]=dat[2] flux[j]=dat[3] major[j]=dat[4] minor[j]=dat[5] pa[j]=dat[6] res[j]=dat[7] p_flux[j]=dat[8] p_ang[j]=dat[9] field[j]=dat[10] xpix[j]=dat[11] ypix[j]=dat[12] ;print,ra[j] ;pause endif
if n_elements(dat) ne 13 then begin index0[j]=0L keep[j]=0L ra[j]='' dec[j]='' dist[j]='' flux[j]='' major[j]='' minor[j]='' pa[j]='' res[j]='' p_flux[j]='' p_ang[j]='' field[j]='' xpix[j]='' ypix[j]='' endif
endif endfor free_lun,lun
;###################################################### ;######### pick out needed data nvssindex=where(index0 eq 1L and ra ne ' RA_2000 ' and ra ne ' h m s ',cp) print,'match',cp
;##################################################### ;######## data type transformation if keyword_set(type_trans) then begin ;removes leading and trailing blank from the input String for i=0L,n_elements(ra)-1 do begin dist[i]=strtrim(dist[i],2) flux[i]=strtrim(flux[i],2) p_flux[i]=strtrim(p_flux[i],2) endfor
dist=float(dist) flux=float(flux) p_flux=float(p_flux) endif ;stop End