;;
;; 2次元配列のCSVを読み込む
;;
function read_csv_2d,ifname_csv, line_count = line_count, row_count=row_count, n_header=n_header
tmp_l=''
close,1
openr,1,ifname_csv
;; ヘッダ部分読み飛ばす ;;
if n_elements(n_header) ne 0 then begin
for i=0, n_header-1, 1 do begin
readf,1,tmp_l
endfor
endif
line_count=0l
while(not eof(1)) do begin
readf,1,tmp_l
tmp = STRSPLIT(tmp_l,',',count=row_count)
if line_count eq 0 then begin
tmp_value = dblarr(row_count,65535l)
endif
for i=0, row_count-2, 1 do begin
tmp_value[i,line_count] = double(strmid(tmp_l,tmp[i],tmp[i+1]-tmp[i]))
endfor
tmp_value[row_count-1,line_count] = double(strmid(tmp_l,tmp[row_count-1],strlen(tmp_l)-tmp[row_count-1]))
line_count++
endwhile
close,1
tmp_value = tmp_value[*,0:line_count-1]
return,tmp_value
end