资源描述:
《反演地表温度 程序代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、proLST_inversionout_name=LST_inversion(irimg_file,nirimg_file,tirimg_file,ndvifilepath,pvfilepath,emfilepath)endfunctionLST_inversion,irimg_file,nirimg_file,tirimg_file,ndvifilepath,pvfilepath,emfilepath;,t,tpcompile_optidl2envi,/restore_base_save_filesenvi_batch_init,log_file='batch.txt';打开红光波段影
2、像;irimg_file=dialog_pickfile(title='打开红光波段影像')irimg_file='F:HJ-1B温度反演2010.9.203波段裁剪'ndvifilepath='G:NDVI'pvfilepath='G:PV'emfilepath='G:比辐射率'ENVI_OPEN_FILE,irimg_file,r_fid=ir_fidIF(ir_fidEQ-1)THENBEGINENVI_BATCH_EXITENDIF;读取影像ENVI_FILE_QUERY,ir_fid,ns=ns,nl=nl,$nb=nb,dims=dimsmap_info=envi
3、_get_map_info(fid=ir_fid)proinfo=envi_get_projection(fid=ir_fid)b1=envi_get_data(fid=ir_fid,dims=dims,pos=0);打开近红外波段影像;nirimg_file=dialog_pickfile(title='打开近红外波段影像')nirimg_file='F:HJ-1B温度反演2010.9.204波段裁剪'ENVI_OPEN_FILE,nirimg_file,r_fid=nir_fidIF(nir_fidEQ-1)THENBEGINENVI_BATCH_EXITENDIFENVI_F
4、ILE_QUERY,nir_fid,ns=ns,nl=nl,$nb=nb,dims=dimsmap_info=envi_get_map_info(fid=nir_fid)proinfo=envi_get_projection(fid=nir_fid)b2=envi_get_data(fid=nir_fid,dims=dims,pos=0);tirimg_file=dialog_pickfile(title='打开辐射定标后的热红外波段影像')tirimg_file='F:HJ-1B温度反演2010.9.20定标掩膜'ENVI_OPEN_FILE,tirimg_file,r_fid=
5、tir_fidIF(tir_fidEQ-1)THENBEGINENVI_BATCH_EXITENDIFENVI_FILE_QUERY,tir_fid,ns=ns,nl=nl,$nb=nb,dims=dimsmap_info=envi_get_map_info(fid=tir_fid)proinfo=envi_get_projection(fid=tir_fid)b3=envi_get_data(fid=tir_fid,dims=dims,pos=0)b1=float(b1)b2=float(b2)b3=float(b3)b5=b2+b1b4=b2-b1;计算NDVINDVI=fltarr
6、(ns*nl)rr=where(b5eq0,count,COMPLEMENT=B_C)NDVI[rr]=0NDVI[B_C]=b4[B_C]/float(b5[B_C])NDVI=reform(NDVI,ns,nl)ifn_elements(ndvifilepath)ne0thenbeginmap_info1=envi_get_map_info(fid=nir_fid)envi_write_envi_file,NDVI,r_fid=fid1,map_info=map_info1,out_name=ndvifilepathendifb4=NDVI;计算植被覆盖度Pv=(b4gt0.7)*1
7、+(b4lt0.0)*0+(b4ge0andb4le0.7)*((b4-0.0)/(0.7-0.0))ifn_elements(pvfilepath)ne0thenbeginmap_info2=envi_get_map_info(fid=nir_fid)envi_write_envi_file,PV,r_fid=fid1,map_info=map_info2,out_name=pvfilepathendifb5=Pv;计算比辐射率e