IDL实现MOD021KM 角度数据重采样中的易错点
最近很忙,每天都特別忙碌,也很少有時間去打球了。
祝愿大家一切都好,北京一切還好,就是北京物價很貴,沒有工資補助的我露出了卑微的笑容~
今天和大家分享的是IDL怎么讀取MOD021KM MYD021KM中的角度數據,將其重采樣到其他的反射率光譜數據的維數大小,即ns = 1354,nl = 2030.重要的是如何避免最容易錯的地方,直接po上程序來,如下:
本來我是批處理的,此處簡化,po出單景圖像的程序,亦可用(中間的其他經緯度代碼是我原來讀取的時候要用到的,沒有用但我就不刪除了)。
易錯點1:
xsize = ns0/1354.0
ysize = nl0/2030.0
重采樣的時候設置的xsize和ysize必須是由原來的小size的圖像行列數比上最終要得到的重采樣后的圖像行列號(本程序中是采樣到對應的文件中1km反射率波段數據)的大小。或者如果想要擴n倍重采樣,則不需要比值,只需要設置:
xsize = 1/n.0
ysize = 1/n.0
一定要.0
易錯點2:
dims = [-1,0,ns0-1,0,nl0-1]
envi_doit,‘resize_doit’,fid = SOZ_fid,dims = dims,pos = pos,interp = 1,rfact = [xsize, ysize],out_name =outname ,r_fid = r_fid
在我們本科徐永明老師寫的《遙感二次開發語言IDL》書中’resize_doit’這個過程后,對于dims的說明是“重采樣后數據的空間范圍”,而實際上此處應該是待重采樣原始數據的dims,原始待重采樣的空間范圍。dims數組由一行五列元素組成,其中第一位如果不是用一個已經打開的ROI去重采樣的話,就默認用-1,后面四位見下:
DIMS
The “dimensions” keyword is a five-element array of long integers that defines the spatial subset (of a file or array) to use for processing. Nearly every time you specify the keyword FID, you must also specify the spatial subset of the corresponding file (even if the entire file, with no spatial subsetting, is to be processed).
DIMS[0]: A pointer to an open ROI; use only in cases where ROIs define the spatial subset. Otherwise, set to -1L.
DIMS[1]: The starting sample number. The first x pixel is 0.
DIMS[2]: The ending sample number
DIMS[3]: The starting line number. The first y pixel is 0.
DIMS[4]: The ending line number
版權歸作者 小白是哪個小白_ 所有,轉載、引用請注明鏈接出處,侵權必糾!
總結
以上是生活随笔為你收集整理的IDL实现MOD021KM 角度数据重采样中的易错点的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言实现通讯录管理
- 下一篇: 用时两周微信小程序电商小程序