加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

[转载]利用IDL程序重采样(resample)MODIS影像

(2011-07-12 09:02:52)
标签:

转载

分类: 3S

1、inputs.pro

calcu,2008144,2008233,'G:tangronglinTangrlmod03'

2、calcu.pro

pro calcu,startday,endday,path;,prefix
a=systime(1)
daystart=long(startday)

dayend=long(endday)

while(daystart le dayend) do begin
arg1=strtrim(string(daystart),2)

suffix='SolarZenith'
;-----------------------------------------------------------
file=file_search(path+'MOD03.A'+arg1+'.'+suffix+'.tif',COUNT=count1);to be modified
;-----------------------------------------------------------
if count1 ne 0 then begin
fill_value=255
example_resize_doit,arg1,path,suffix,fill_value
endif

suffix='View_time'
file=file_search(path+arg1+'.*_'+suffix+'.tif',COUNT=count1);to be modified
;-----------------------------------------------------------
if count1 ne 0 then begin
fill_value=255
example_resize_doit,arg1,path,suffix,fill_value
endif

daystart=daystart+1

endwhile
b=systime(1)
print,b-a
end
stop

3、example_resize_doit.pro

pro example_resize_doit,day,path,suffix,fill_value
  ;
  ; First restore all the base save files.
  ;
  envi, /restore_base_save_files
  ;
  ; Initialize ENVI and send all errors
  ; and warnings to the file batch.txt
  ;
  envi_batch_init, log_file='batch.txt'
  ;
  ; Open the input file
file=file_search(path+'MOD03.A'+day+'.'+suffix+'.tif')

envi_open_file, file, r_fid=fid
  if (fid eq -1) then begin
    envi_batch_exit
    return
  endif
  ;
  ; Set the DIMS and POS to keywords
  ; to processes all spatial and all
  ; spectral data. Output the result
  ; to disk.
  ;
  envi_file_query, fid, ns=ns, nl=nl, nb=nb
  dims = [-1, 0, ns-1, 0, nl-1]
  pos  = lindgen(nb)
  out_name ='MOD03.A'+day+'.'+suffix+'.tif'
  ;
  ; Perform the resize calculation.
  ; Make the output image twice as
  ; large in both X and Y. Use
  ; bilinear interpolation.
  ;
  envi_doit, 'resize_doit', $
    fid=fid, pos=pos, dims=dims, $
    interp=0, rfact=[0.92888890953,0.93055543924], $
    out_name=out_name, r_fid=r_fid; spatial resolution resampled from 1000m to 926m.

 envi_file_mng, id=fid, /remove

close,/all
end

0

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有