Skip to content

Commit 4709847

Browse files
committed
Rename HM resolvers to align with invest
1 parent 5f1fccf commit 4709847

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import org.geotools.coverage.grid.GridCoverage2D;
88
import org.hortonmachine.gears.modules.r.cutout.OmsCutOut;
9-
import org.hortonmachine.hmachine.modules.hydrogeomorphology.swy.OmsBaseflowWaterVolume;
9+
import org.hortonmachine.hmachine.modules.hydrogeomorphology.swy.OmsSWYBaseflowRouting;
1010
import org.integratedmodelling.geoprocessing.TaskMonitor;
1111
import org.integratedmodelling.klab.api.data.general.IExpression;
1212
import org.integratedmodelling.klab.api.model.contextualization.IResolver;
@@ -19,7 +19,7 @@
1919
import org.integratedmodelling.klab.exceptions.KlabException;
2020
import org.integratedmodelling.klab.utils.NumberUtils;
2121

22-
public class BaseFlowWaterVolumeResolver extends AbstractContextualizer implements IResolver<IProcess>, IExpression {
22+
public class OmsSWYBaseflowRoutingResolver extends AbstractContextualizer implements IResolver<IProcess>, IExpression {
2323

2424
@Override
2525
public Type getType() {
@@ -40,13 +40,13 @@ public IProcess resolve(IProcess baseflowProcess, IContextualizationScope contex
4040
IState baseflowWaterVolumeState = getOutput("base_flow_water_volume", IState.class);
4141
TaskMonitor taskMonitor = new TaskMonitor(context.getMonitor());
4242
taskMonitor.setTaskName("Baseflow");
43-
OmsBaseflowWaterVolume b = new OmsBaseflowWaterVolume();
43+
OmsSWYBaseflowRouting b = new OmsSWYBaseflowRouting();
4444
try {
4545
GridCoverage2D flowGc = getGridCoverage(context, flowdirectionState, null);
4646

4747
b.pm = taskMonitor;
48-
b.inInfiltration = getGridCoverage(context, infiltratedWaterVolumeState, flowGc);
49-
b.inNetInfiltration = getGridCoverage(context, netInfiltratedWaterVolumeState, flowGc);
48+
b.inRecharge = getGridCoverage(context, infiltratedWaterVolumeState, flowGc);
49+
b.inAvailableRecharge = getGridCoverage(context, netInfiltratedWaterVolumeState, flowGc);
5050
b.inNet = getGridCoverage(context, streamPresenceState, flowGc);
5151
b.inFlowdirections = flowGc;
5252
b.process();
@@ -88,7 +88,7 @@ private GridCoverage2D getGridCoverage(IContextualizationScope context, IState s
8888

8989
@Override
9090
public Object eval(IContextualizationScope context, Object... parameters) throws KlabException {
91-
return new BaseFlowWaterVolumeResolver();
91+
return new OmsSWYBaseflowRoutingResolver();
9292
}
9393

9494
}
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.awt.image.DataBuffer;
66

77
import org.geotools.coverage.grid.GridCoverage2D;
8-
import org.hortonmachine.hmachine.modules.hydrogeomorphology.scsrunoff.OmsScsRunoff;
8+
import org.hortonmachine.hmachine.modules.hydrogeomorphology.swy.OmsSWYQuickflow;
99
import org.integratedmodelling.geoprocessing.TaskMonitor;
1010
import org.integratedmodelling.klab.api.data.general.IExpression;
1111
import org.integratedmodelling.klab.api.model.contextualization.IResolver;
@@ -17,7 +17,7 @@
1717
import org.integratedmodelling.klab.components.runtime.contextualizers.AbstractContextualizer;
1818
import org.integratedmodelling.klab.exceptions.KlabException;
1919

20-
public class ScsRunoffResolver extends AbstractContextualizer implements IResolver<IProcess>, IExpression {
20+
public class OmsSWYQuickflowResolver extends AbstractContextualizer implements IResolver<IProcess>, IExpression {
2121

2222
@Override
2323
public Type getType() {
@@ -28,7 +28,7 @@ public Type getType() {
2828
public IProcess resolve(IProcess runoffProcess, IContextualizationScope context) throws KlabException {
2929

3030
TaskMonitor taskMonitor = new TaskMonitor(context.getMonitor());
31-
taskMonitor.setTaskName("SCS Runoff");
31+
taskMonitor.setTaskName("SWY Quickflow");
3232

3333
IState rainfallVolumeState = getInput("rainfall_volume", IState.class);
3434
IState streamPresenceState = getInput("presence_of_stream", IState.class);
@@ -41,22 +41,22 @@ public IProcess resolve(IProcess runoffProcess, IContextualizationScope context)
4141

4242
IState runoffState = getOutput("runoff_water_volume", IState.class);
4343

44-
OmsScsRunoff scsRunoff = new OmsScsRunoff();
45-
scsRunoff.pm = taskMonitor;
46-
scsRunoff.inRainfall = getGridCoverage(context, rainfallVolumeState);
47-
scsRunoff.inNet = getGridCoverage(context, streamPresenceState);
48-
scsRunoff.inCurveNumber = getGridCoverage(context, curveNumberState);
49-
scsRunoff.inNumberOfEvents = getGridCoverage(context, numberOfEventsState);
44+
OmsSWYQuickflow swyQuickflow = new OmsSWYQuickflow();
45+
swyQuickflow.pm = taskMonitor;
46+
swyQuickflow.inRainfall = getGridCoverage(context, rainfallVolumeState);
47+
swyQuickflow.inNet = getGridCoverage(context, streamPresenceState);
48+
swyQuickflow.inCurveNumber = getGridCoverage(context, curveNumberState);
49+
swyQuickflow.inNumberOfEvents = getGridCoverage(context, numberOfEventsState);
5050
try {
51-
scsRunoff.process();
51+
swyQuickflow.process();
5252
} catch (Exception e) {
5353
throw new KlabException(e);
5454
}
5555
if (!context.getMonitor().isInterrupted()) {
56-
GeotoolsUtils.INSTANCE.coverageToState(scsRunoff.outputDischarge, runoffState, context.getScale(), null);
56+
GeotoolsUtils.INSTANCE.coverageToState(swyQuickflow.outQuickflow, runoffState, context.getScale(), null);
5757
}
5858

59-
GeotoolsUtils.INSTANCE.dumpToRaster(context, "ScsRunoff", rainfallVolumeState, streamPresenceState, curveNumberState,
59+
GeotoolsUtils.INSTANCE.dumpToRaster(context, "SWYQuickflow", rainfallVolumeState, streamPresenceState, curveNumberState,
6060
runoffState, numberOfEventsState);
6161

6262
return runoffProcess;
@@ -71,7 +71,7 @@ private GridCoverage2D getGridCoverage(IContextualizationScope context, IState s
7171

7272
@Override
7373
public Object eval(IContextualizationScope context, Object... parameters) throws KlabException {
74-
return new ScsRunoffResolver();
74+
return new OmsSWYQuickflowResolver();
7575
}
7676

7777
}

0 commit comments

Comments
 (0)