pro get_data,name,y,column=column,rowmax=rowmax,errornum=errornum ; rowmax-- given row max number; default is that the row number is given in the file ; column --- should be given in the file other wise use load.pro ; name- file name get_lun,unit out_error=0 ;good print,'Loading '+name openr,unit,name,error=out_error errornum=out_error IF out_error NE 0 THEN BEGIN print,'no such file ,errornum=',out_error free_lun,unit return ;stop ENDIF nx=0 & str_col='' ny=0 & str_row='' if N_elements(column) ne 0 then begin nx=column endif else begin readf,unit,nx,str_col ;column endelse if n_elements(rowmax) ne 0 then begin ny=rowmax endif else begin readf,unit,ny,str_row ;row if strtrim(str_row,2) ne 'row' then begin print,'The estimated max row number should be provided for this data file, e.g., rowmax=1000' free_lun,unit stop endif endelse work=fltarr(nx) array=fltarr(nx,ny) index=0L WHILE NOT eof(unit) DO BEGIN if index ge ny then goto,ccc ; in case the estimated row number less than data row number readf,unit,work array(*,index)=work(*) ;print,index,work index=index+1 ENDWHILE ccc: free_lun,unit ; determine the real col, row numbers if keyword_set(rowmax) then begin ; ny is not given in the file nrow=index