2017-03-01 1 views
0

IDL에서 newton 방정식의 방정식을 얻으려면 어떻게해야합니까? 내 방정식은 여러 가지 (여기에 타일)를 제공하지만 newton 방정식 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

, 관련 메모에, 당신이 이제까지 뉴튼 기능에 추가 매개 변수를 전달해야하는 경우, 하나의 트릭은 당신이 일반적인 설정 공통 블록을 사용하는 것입니다 블록을 호출 루틴에 넣은 다음 "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를 포함합니다. newton 방법은 처음에는 S가 필요하고, newton 방법은 S를 계산할 것입니다.하지만 여기서는 처음에 S와 다양한 R을 줄 필요가 있습니다. R은 newton 방법으로 계산해야했습니다. 그게 내 문제 야. –