;CATEGORY: tool for analyzing the velocity flows ; that are generated by the ringpipeline of GONG data. ;PURPOSE: read the ring inversion files ; input: file -- string containing file name ; output: xq -- array of data for velocity x-component ; yq -- array of data for velocity y-component ; lambda -- smoothness paramater ; format of xq, yq,: ; xq(nlam,0,nz): target depth in r/R ; xq(nlam,1,nz): actual depth from 0.5 area point of resol. kernels ; xq(nlam,2,nz): actual depth from centroid of resol. kernels ; xq(nlam,3,nz): resolution width from difference of 0.75 and 0.25 area ; points of resol. kernels ; xq(nlam,4,nz): resolution width from second moment of resol. kernels ; xq(nlam,5,nz): skewness of resol. kernels ; xq(nlam,6,nz): inferred velocity ; m/s ; xq(nlam,7,nz): Error estimate #1 ; xq(nlam,8,nz): Error estimate #2 ; xq(nlam,9,nz): Error magnification ; ; In practice, the best quantities to use are: ; depth: xq(nlam,1,nz) ; width: xq(nlam,3,nz) ; velocity: xq(nlam,6,nz) ; error in velocity: xq(nlam,8,nz) ; ;Author : T. Corbard 2003 ;updates: A. Zaatri 07/2007 ; 07/2008: output smoothness parameter 'lambda' ; 11/2008: find the first line 'SOLUTION for UX' ; to start reading the data velocity files from ; GONG starting on 16/05/2007 are adding the splitup header. ; ; EXAMPLE (added by H. Schunker): ; After running this file successfully you can do something similar to ; this to plot the meridional velocity: ; IDL> plot,yq(9,1,*)*696-696,yq(9,6,*),xtit='z (Mm)',ytit='Vy (m/s)',charsize=2,charthick=2,thick=3 ; IDL> oploterr,yq(9,1,*)*696-696,yq(9,6,*),yq(9,8,*) ; PRO rdsol2,file,xq,yq,lambda ;open the file in a free unit openr,lun,file,/get_lun ;find the line where the path is given (always starts with /) walou='' & n=0 WHILE ~ EOF(lun) DO BEGIN readf,lun,walou n=n+1 IF strmid(walou,0,1) eq '/' THEN ns=n ENDWHILE ;go to the line of dimensions point_lun,lun,0 walou=strarr(ns) st='' readf,lun,walou readf,lun,st reads,st,nlam,nz ;read data xq=fltarr(nlam,10,nz) yq=fltarr(nlam,10,nz) utmp=fltarr(10,nz) lambda=fltarr(nlam) for il=0,nlam-1 do begin readf,lun,st readf,lun,st lambda(il)=float(strmid(st,11,8)) readf,lun,st readf,lun,utmp for iq=0,9 do xq(il,iq,*)=utmp(iq,*) endfor readf,lun,st for il=0,nlam-1 do begin readf,lun,st readf,lun,st readf,lun,st readf,lun,utmp for iq=0,9 do yq(il,iq,*)=utmp(iq,*) endfor free_lun,lun return end