V1_0.java [src/java/m/cfa/timeseries15min] Revision: 742c042a43087670f1ec0196652cc79475404051 Date: Fri Feb 12 09:14:51 MST 2016
package m.cfa.timeseries15min;
import csip.ModelDataService;
import java.io.File;
import javax.ws.rs.Path;
import oms3.annotations.Description;
import oms3.annotations.Name;
import oms3.annotations.VersionInfo;
@Name("timeseries15min")
@Description("timeseries15min")
@VersionInfo("1.0")
@Path("m/cfa/timeseries15min/1.0")
public class V1_0 extends ModelDataService {
gui15minTimeseries_Model model = new gui15minTimeseries_Model();
@Override
protected String process() throws Exception {
model.setMainFolder(getWorkspaceDir().toString());
model.setDatabase(getStringParam("database"));
model.setOrganizationName(getStringParam("org"));
model.setStationID(getStringParam("station_id"));
model.setStationName(getStringParam("station_name"));
model.setBeginDate(getStringParam("begin_date"));
model.setEndDate(getStringParam("end_date"));
model.setMergeDatasets(getBooleanParam("merge_datasets"));
model.setMergeMethod(getStringParam("merge_method"));
model.setUserData(getStringParam("user_data"));
model.run();
return EXEC_OK;
}
@Override
protected void postProcess() throws Exception {
// files
File wd = getWorkspaceDir();
putResult(new File(wd, model.getGraph()),
model.getOutputSummary(),
//Below are the result graph files for use by JHighCharts on eRAMS for duplicating the above graphs
model.getTimeseriesOutput());
// values
putResult("len", model.getLen());
putResult("start", model.getStart());
putResult("end", model.getEnd());
putResult("units", model.getUnits());
putResult("data_source", model.getDataSource());
//Get all data results
putResult("max", model.getMax(), null, "cfs");
putResult("min", model.getMin(), null, "cfs");
putResult("range", model.getRange(), null, "cfs");
putResult("mean", model.getMean(), null, "cfs");
putResult("standardDeviation", model.getStandardDeviation(), null, "cfs");
//Get other results
putResult("graph", model.getGraph());
putResult("resultSummary", model.getOutputSummary().getName());
//Get result files for JSHighCharts
String graphDataFiles = model.getTimeseriesOutput().getName();
putResult("graph_data_files", graphDataFiles);
}
}