2017-03-01 14 views
0

IDLのニュートン法を使った方程式の解をどうやって得るのですか?私の手続きはさまざまなものを提供しますが、ニュートン法のIDL IDLは方程式の最初の解を単に受け取ります。リモートセンシング画像処理に関する私の論文のために私を助けてください。IDLの方程式の解

マイIDL手順は次のとおりです。

Pro TSM_lixiaModel 
!Except=0 
Compile_opt idl2 
dir='I:\lwkDATA\waterRegion\MODIS\' 
files=file_search(dir,'*RC.tif',count=num) 
for i=0,num-1 do begin 
file=files[i] 
    raster=e.Openraster(file,external_type='ADS40') 
    outFile=file_dirname(file)+'\'+file_basename(file,'.tif')$ 
    +'_TSM_lixiaModel.tif' 


TSMraster=enviraster(uri=outfile,$ 
     nrows=raster.nrows,$ 
     ncolumns=raster.ncolumns,$ 
     nbands=1,$ 
     data_type=raster.data_type,$ 
     SPATIALREF=raster.SPATIALREF) 
tileIterator=raster.createtileiterator(bands=2,tile_size=[100,100]) 
count=0 
foreach tile,tileiterator do begin 
    count++ 

    ***;Tile is variable, but not the needed Solution of the equation 
    ;S is needed Solution of the equation 
    ;????? is the initially solution of the ‘newtfunc’,how do i give the  various(Tile) to newtfunc*** 

    processedTile=newton(??????,'newtfunc'); 

    currentSubRect=tileIterator.Current_subrect 
    TSMraster.setdata,processedTile,sub_rect=currentsubrect 
    print,'1' 
endforeach 
TSMraster.save 
endfor 
End 

function newtfunc,S 
    compile_opt idl2 
    return,(r-93.0943)*S+49.2464*S*exp(-0.0001*S)-344.016+45*r 
end 

答えて

0

私は完全にあなたのコードを理解していない、おそらくあなただけENVIRasterのGetDataメソッドを使用する必要がありますか? 例:

data = raster.GetData(BANDS=[0], SUB_RECT=[100,449,550,899]) 

次に、データをNewton関数に渡すことができます。 完全なドキュメントはここにある:ところで https://www.harrisgeospatial.com/docs/enviraster__getdata.html

、関連ノートで、あなたがこれまでニュートン関数に追加のパラメータを渡す必要がある場合は、1つのトリックは、あなたが共通の設定共通ブロックを使用することですあなたの呼び出しルーチンでブロックして、 "newtfunc"内の変数にアクセスしてください。次のようなもの:

pro mymain 
    common foo, x, y, z 
    x=1 & y=1 & z=1 
    result = newton(...,'newtfunc') 
end 

function newtfunc,S 
    common foo 
    <use x,y,z here> 
    return,... 
end 

そうでない場合は、テクニカルサポートに連絡してください。

+0

ありがとうございました。関数はRとSを含んでいます。ニュートン法はちょうどSを最初に必要とし、ニュートン法は真のSを計算します。しかし、ここでは最初にSと様々なRを与える必要があり、Rはニュートン法で計算する必要がありました。それは私のトラブル –