我这里针对的是全圆盘区域的定标,中国区域或者其他区域的HDF你们自己修改数组
pro cal
;a=1
;print,1
file=dialog_pickfile()
;h5_list,file
;result=h5_parse(file)
;help,result
NOMNames=['NOMChannel01','NOMChannel02','NOMChannel03','NOMChannel04','NOMChannel05','NOMChannel06','NOMChannel07',$
'NOMChannel08','NOMChannel09','NOMChannel10','NOMChannel11','NOMChannel12','NOMChannel13','NOMChannel14']
CALNames=['CALChannel01','CALChannel02','CALChannel03','CALChannel04','CALChannel05','CALChannel06','CALChannel07',$
'CALChannel08','CALChannel09','CALChannel10','CALChannel11','CALChannel12','CALChannel13','CALChannel14']
img=fltarr(2748,2748,14)
help,img
for i=0,13 do begin
NOMData = H5_GETDATA(file,NOMNames[i])
CalData = H5_GETDATA(file,CALNames[i])
print,i
DIM = size(NOMData,/DIMENSIONS)
TOARefData = FLTARR(DIM);结果数据
;help,TOARefData
w = where(NOMData GE 0 and NOMData LT 4096,count);仅对有效值处理
;辐射定标
for j = 0, count -1 do begin
TOARefData[w[j]] = CalData[NOMData[w[j]]]
endfor
img[*,*,i]=TOARefData
endfor
help,img
NOMData = H5_GETDATA(file,'/NOMChannel07')
CalData = H5_GETDATA(file,'/CALChannel07')
DIM = size(NOMData,/DIMENSIONS)
TOARefData = FLTARR(DIM);结果数据
w = where(NOMData GE 0 and NOMData LT 65536,count);仅对有效值处理
for j = 0, count -1 do begin
TOARefData[w[j]] = CalData[NOMData[w[j]]]
endfor
img[*,*,6]=TOARefData
o_fn=dialog_pickfile(title='定标结果保存为')
envi_write_envi_file,img,out_name=o_fn,/no_copy,ns=2748,nl=2748,nb=14,data_type=4
end