mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Initial commit of ResInsight version 0.4.8
This commit is contained in:
24
OctavePlugin/OctaveScripts/kaverage.m
Normal file
24
OctavePlugin/OctaveScripts/kaverage.m
Normal file
@@ -0,0 +1,24 @@
|
||||
addpath("/home/builder/Projects/ResInsightBuildDir/OctavePlugin");
|
||||
CInfo = riGetActiveCellInfo();
|
||||
SOIL = riGetActiveCellProperty("SOIL");
|
||||
|
||||
SOIL_KAverage = SOIL;
|
||||
SOIL_KAverage(:) = nan;
|
||||
|
||||
mini = min(CInfo(:,2))
|
||||
maxi = max(CInfo(:,2))
|
||||
|
||||
minj = min(CInfo(:,3))
|
||||
maxj = max(CInfo(:,3))
|
||||
|
||||
for i = mini:maxi
|
||||
for j = minj:maxj
|
||||
Mask = (CInfo(:,1) == 0) & (CInfo(:,2) == i) & (CInfo(:,3) == j) ;
|
||||
|
||||
for ts = (1:columns(SOIL))
|
||||
SOIL_KAverage(Mask, ts) = mean(SOIL(Mask, ts));
|
||||
endfor
|
||||
endfor
|
||||
endfor
|
||||
|
||||
riSetActiveCellProperty(SOIL_KAverage, "SOIL_KAverage");
|
||||
Reference in New Issue
Block a user