일단은 IR1 체널만 그리는 걸로... --;
이 프로그램의 중요한 것은 바이너리 파일을 읽을 때 8비트로 읽어서 10비트로 변환하는 거랑 tv 시킬 때 컬러 테이블 반전해서 그리는데 map_patch 후에 rgb reverse를 해야지 에러가 안남...
pro test1
a=1024L ; 데이터가 1024X1024
g_matrix=strarr(a*a)
geofile='c:\test\mtsat_geo_asia'
sat_data_ir1='c:\test\r200610280533.ir1'
tb_index_ir1='c:\test\ctbl_1024.ir1'
sat_data_ir2='c:\test\r200610280533.ir2'
tb_index_ir2='c:\test\ctbl_1024.ir2'
sat_data_ir3='c:\test\r200610280533.ir3'
tb_index_ir3='c:\test\ctbl_1024.ir3'
sat_data_ir4='c:\test\r200610280533.ir4'
tb_index_ir4='c:\test\ctbl_1024.ir4'
sat_data_vis='c:\test\r200610280533.vis'
tb_index_vis='c:\test\ctbl_1024.vis'
str='' ;필요없는 첫줄을 읽기 위한 변수설정
g_matrix=fltarr(4,a*a)
openr, lun, geofile,/get_lun
readf, lun, str
readf, lun, format='(i4,i4,1x,f5.2,1x,f6.2)', g_matrix
free_lun, lun
lat=reform(g_matrix(2,*),a,a)
lon=reform(g_matrix(3,*),a,a)
openr,lun1,tb_index_ir1,/get_lun
openr,lun2,tb_index_ir2,/get_lun
openr,lun3,tb_index_ir3,/get_lun
openr,lun4,tb_index_ir4,/get_lun
openr,lun5,tb_index_vis,/get_lun
index_ir1=fltarr(2,a) & index_ir2=index_ir1 & index_ir3=index_ir1 & index_ir4=index_ir1 & index_vis=fltarr(2,63)
readf, lun1, index_ir1
readf, lun2, index_ir2
readf, lun3, index_ir3
readf, lun4, index_ir4
readf, lun5, index_vis
free_lun, lun1
free_lun, lun2
free_lun, lun3
free_lun, lun4
free_lun, lun5
openr, lun1, sat_data_ir1,/get_lun
openr, lun2, sat_data_ir2,/get_lun
openr, lun3, sat_data_ir3,/get_lun
openr, lun4, sat_data_ir4,/get_lun
openr, lun5, sat_data_vis,/get_lun
sat_tmp_ir1=fix(read_binary(lun1,data_dims=[a*2,a],data_type=1))
sat_tmp_ir2=fix(read_binary(lun2,data_dims=[a*2,a],data_type=1))
sat_tmp_ir3=fix(read_binary(lun3,data_dims=[a*2,a],data_type=1))
sat_tmp_ir4=fix(read_binary(lun4,data_dims=[a*2,a],data_type=1))
sat_tmp_vis=fix(read_binary(lun5,data_dims=[a*2,a],data_type=1))
conv1=intarr(a,a) & conv2=conv1
tb_ir1=fltarr(a,a) & tb_ir2=tb_ir1 & tb_ir3=tb_ir1 & tb_ir4=tb_ir1 & tb_vis=tb_ir1 & ttt=tb_ir1
tt=conv1
for j=0, a-1 do begin
for i=0, a-1 do begin
conv1(i,j)=sat_tmp_ir1(i*2,j)*256
conv2(i,j)=sat_tmp_ir1(i*2+1,j)
tb_ir1(i,j)=index_ir1(1,conv1(i,j)+conv2(i,j))
conv1(i,j)=sat_tmp_ir2(i*2,j)*256
conv2(i,j)=sat_tmp_ir2(i*2+1,j)
tb_ir2(i,j)=index_ir2(1,conv1(i,j)+conv2(i,j))
conv1(i,j)=sat_tmp_ir3(i*2,j)*256
conv2(i,j)=sat_tmp_ir3(i*2+1,j)
tb_ir3(i,j)=index_ir3(1,conv1(i,j)+conv2(i,j))
conv1(i,j)=sat_tmp_ir4(i*2,j)*256
conv2(i,j)=sat_tmp_ir4(i*2+1,j)
tb_ir4(i,j)=index_ir4(1,conv1(i,j)+conv2(i,j))
conv1(i,j)=sat_tmp_vis(i*2,j)*256
conv2(i,j)=sat_tmp_vis(i*2+1,j)
tb_vis(i,j)=index_vis(1,conv1(i,j)+conv2(i,j))
endfor
endfor
free_lun, lun1
free_lun, lun2
free_lun, lun3
free_lun, lun4
free_lun, lun5
b=bytscl(tb_ir1,min=200, max=300, top=60)
device, decomposed=0
loadct, 0, ncolors=60
window, xsize=600, ysize=600
map_set, 35, 127, limit=[10,100,65,155],/continent,/noerase, standard_parallels=[30,60],/isotropic
kkk=map_patch(255-60+b,lon,lat,xstart=xx, ystart=yy,xsize=xsize,ysize=ysize)
tvlct, r,g,b,/get
tvlct, reverse(r),reverse(g),reverse(b)
tvlct, 255,255,255,195
tv, kkk,xx,yy,xsize=xsize,ysize=ysize
map_continents,/noerase,color=196
map_grid,/box_axes,label=2,latdel=3, londel=5,latnames=name3,$
lonnames=name4,color=196
end