You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cmda.apache.org by James Carman <ja...@carmanconsulting.com> on 2015/09/09 00:45:49 UTC
Re: [43/49] incubator-cmda git commit: remove all
Can we turn these notifications off?
On Tue, Sep 8, 2015 at 6:44 PM <xi...@apache.org> wrote:
>
> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/controllers/ClimateServiceController.java
> ----------------------------------------------------------------------
> diff --git a/app/controllers/ClimateServiceController.java
> b/app/controllers/ClimateServiceController.java
> deleted file mode 100644
> index 2c6aa1c..0000000
> --- a/app/controllers/ClimateServiceController.java
> +++ /dev/null
> @@ -1,931 +0,0 @@
> -/*
> - * Licensed to the Apache Software Foundation (ASF) under one or more
> - * contributor license agreements. See the NOTICE file distributed with
> - * this work for additional information regarding copyright ownership.
> - * The ASF licenses this file to You under the Apache License, Version 2.0
> - * (the "License"); you may not use this file except in compliance with
> - * the License. You may obtain a copy of the License at
> - *
> - * http://www.apache.org/licenses/LICENSE-2.0
> - *
> - * Unless required by applicable law or agreed to in writing, software
> - * distributed under the License is distributed on an "AS IS" BASIS,
> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> - * See the License for the specific language governing permissions and
> - * limitations under the License.
> - */
> -
> -package controllers;
> -
> -import com.fasterxml.jackson.databind.JsonNode;
> -import com.fasterxml.jackson.databind.node.ObjectNode;
> -import models.metadata.ClimateService;
> -import models.metadata.DiffPlotTwoTimeAveragedVar;
> -import models.metadata.RegridAndDownload;
> -import models.metadata.TwoDVarZonalMean;
> -import models.metadata.TwoDVarMap;
> -import models.metadata.TwoDVarTimeSeries;
> -import models.metadata.ThreeDVarZonalMean;
> -import models.metadata.ThreeDVar2DSlice;
> -import models.metadata.ThreeDVarAvgVertical4Profile;
> -import models.metadata.ScatterHistogramTwoVar;
> -import models.metadata.ConditionalSampling;
> -import models.metadata.ServiceLog;
> -import models.metadata.CorrelationMap;
> -import models.metadata.ConditionalSampling2Var;
> -import play.Logger;
> -import play.data.Form;
> -import play.libs.Json;
> -import play.mvc.Controller;
> -import play.mvc.Result;
> -import scala.Console;
> -import util.APICall;
> -import util.APICall.ResponseType;
> -import util.Constants;
> -import views.html.climate.*;
> -import play.data.DynamicForm;
> -import java.io.File;
> -import java.io.IOException;
> -import java.io.UnsupportedEncodingException;
> -import java.text.DateFormat;
> -import java.text.SimpleDateFormat;
> -import java.util.Date;
> -import java.util.List;
> -import com.fasterxml.jackson.databind.ObjectMapper;
> -
> -public class ClimateServiceController extends Controller {
> -
> - final static Form<ClimateService> climateServiceForm = Form
> - .form(ClimateService.class);
> -
> - public static Result home(String email, String vfile, String
> dataset) {
> - return ok(home.render(email, vfile, dataset));
> - }
> -
> - public static Result addClimateServices() {
> - return ok(addClimateServices.render(climateServiceForm));
> - }
> -
> - public static Result tutorial() {
> - return ok(tutorial.render());
> - }
> -
> - public static Result climateServices() {
> - return ok(climateServices.render(ClimateService.all(),
> - climateServiceForm));
> - }
> -
> - public static Result mostRecentlyAddedClimateServices() {
> - return
> ok(mostRecentlyAddedServices.render(ClimateService.getMostRecentlyAdded(),
> - climateServiceForm));
> - }
> -
> - public static Result mostRecentlyUsedClimateServices() {
> - return
> ok(mostRecentlyUsedServices.render(ClimateService.getMostRecentlyUsed(),
> - climateServiceForm));
> - }
> -
> - public static Result mostPopularClimateServices() {
> - return
> ok(mostPopularServices.render(ClimateService.getMostPopular(),
> - climateServiceForm));
> - }
> -
> - public static Result newClimateService() {
> - Form<ClimateService> dc =
> climateServiceForm.bindFromRequest();
> - ObjectNode jsonData = Json.newObject();
> - try {
> -
> - String originalClimateServiceName =
> dc.field("Name").value();
> - String newClimateServiceName =
> originalClimateServiceName.replace(' ', '-');
> -
> - if (newClimateServiceName != null &&
> !newClimateServiceName.isEmpty()) {
> - jsonData.put("name",
> newClimateServiceName);
> - }
> -
> - jsonData.put("creatorId", 1);
> - jsonData.put("purpose",
> dc.field("Purpose").value());
> - jsonData.put("url", dc.field("Url").value());
> - DateFormat dateFormat = new
> SimpleDateFormat("yyyy/MM/dd HH:mm");
> - Date date = new Date();
> - jsonData.put("createTime",
> dateFormat.format(date));
> - jsonData.put("scenario",
> dc.field("Scenario").value());
> - jsonData.put("versionNo",
> dc.field("Version").value());
> - jsonData.put("rootServiceId",
> dc.field("Root_Service").value());
> - JsonNode response =
> ClimateService.create(jsonData);
> - Application.flashMsg(response);
> - } catch (IllegalStateException e) {
> - e.printStackTrace();
> - Application.flashMsg(APICall
> -
> .createResponse(ResponseType.CONVERSIONERROR));
> - } catch (Exception e) {
> - e.printStackTrace();
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - }
> - return redirect("/climate/climateServices");
> - }
> -
> - public static Result editClimateService() {
> -
> - ObjectNode jsonData = Json.newObject();
> - try {
> - DynamicForm df =
> DynamicForm.form().bindFromRequest();
> - String climateServiceName = df.field("pk").value();
> -
> - if (climateServiceName != null &&
> !climateServiceName.isEmpty()) {
> - jsonData.put("name", climateServiceName);
> - }
> - ClimateService originalService =
> ClimateService.findServiceByName(climateServiceName);
> -
> - if (originalService == null) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("not found original
> climateService " + climateServiceName);
> - }
> -
> - jsonData.put("creatorId", 1);
> - jsonData.put("purpose",
> originalService.getPurpose());
> - jsonData.put("url", originalService.getUrl());
> - jsonData.put("scenario",
> originalService.getScenario());
> - jsonData.put("versionNo",
> originalService.getVersion());
> -
> - if (originalService.getRootservice() != null)
> -
> - jsonData.put("rootServiceId",
> originalService.getRootservice());
> - String editField = df.field("name").value();
> -
> - if (editField != null && !editField.isEmpty()) {
> - jsonData.put(editField,
> df.field("value").value());
> - }
> -
> - if (editField == null || editField.isEmpty()) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("not found edit field");
> - }
> -
> - JsonNode response =
> ClimateService.edit(climateServiceName, jsonData);
> - Application.flashMsg(response);
> -
> - } catch (IllegalStateException e) {
> - e.printStackTrace();
> - Application.flashMsg(APICall
> -
> .createResponse(ResponseType.CONVERSIONERROR));
> - } catch (Exception e) {
> - e.printStackTrace();
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - }
> - return ok("updated");
> -
> - }
> -
> - public static Result getConfigurationByConfId() {
> - String output = "";
> - TwoDVarMap twoDVarMap = new TwoDVarMap();
> - TwoDVarZonalMean twoDVarZonalMean = new TwoDVarZonalMean();
> - ScatterHistogramTwoVar scatterHistogram = new
> ScatterHistogramTwoVar();
> - ThreeDVarAvgVertical4Profile threeDVarAvgVertical = new
> ThreeDVarAvgVertical4Profile();
> - DiffPlotTwoTimeAveragedVar diffPlotTwoTimeAvg = new
> DiffPlotTwoTimeAveragedVar();
> - ThreeDVar2DSlice threeDVar2DSlice = new ThreeDVar2DSlice();
> - TwoDVarTimeSeries twoDVarTimeSeries = new
> TwoDVarTimeSeries();
> - ThreeDVarZonalMean threeDVarZonalMean = new
> ThreeDVarZonalMean();
> - ConditionalSampling conditionalSampling = new
> ConditionalSampling();
> - RegridAndDownload regridAndDownload = new
> RegridAndDownload();
> - CorrelationMap correlationMap = new CorrelationMap();
> - ConditionalSampling2Var conditionalSampling2Var = new
> ConditionalSampling2Var();
> -
> - try {
> - DynamicForm df =
> DynamicForm.form().bindFromRequest();
> - String logId = df.field("logId").value();
> -
> - if (logId == null || logId.isEmpty()) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("confId is null or empty");
> - }
> -
> - JsonNode response =
> APICall.callAPI(Constants.NEW_BACKEND + Constants.SERVICE_EXECUTION_LOG +
> Constants.SERVICE_EXECUTION_LOG_GET + logId);
> - int configurationId =
> response.path("serviceConfiguration").path("id").asInt();
> - JsonNode responseConfigItems =
> APICall.callAPI(Constants.NEW_BACKEND + Constants.CONFIG_ITEM +
> Constants.GET_CONFIG_ITEMS_BY_CONFIG + configurationId);
> - String serviceName =
> response.path("climateService").path("name").asText();
> - //TODO:
> - if (serviceName.equals("2-D-Variable-Zonal-Mean"))
> {
> - //TODO: DO NOT USE
> node.findPath(key)!!!!! use find(key) instead to get your immediate
> children if you know the json structure (and we do).
> - //TODO: (con't) findPath returns the first
> occurence of a key string, including GRANDCHILDREN
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> -
> - if (parameterName.equals("data
> source")) {
> -
> twoDVarZonalMean.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("variable name")) {
> -
> twoDVarZonalMean.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("start year-month")) {
> -
> twoDVarZonalMean.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("end year-month")) {
> -
> twoDVarZonalMean.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("select months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> twoDVarZonalMean.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> twoDVarZonalMean.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> twoDVarZonalMean.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> twoDVarZonalMean.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> twoDVarZonalMean.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> twoDVarZonalMean.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> twoDVarZonalMean.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> twoDVarZonalMean.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> twoDVarZonalMean.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> twoDVarZonalMean.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> twoDVarZonalMean.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> twoDVarZonalMean.addMonth("dec");
> - }
> - }
> -
> twoDVarZonalMean.changeSelectMonths();
> - } else if
> (parameterName.equals("start lat (deg)")) {
> -
> twoDVarZonalMean.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("end lat (deg)")) {
> -
> twoDVarZonalMean.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("variable scale")) {
> -
> twoDVarZonalMean.setVariableScale(parameterValue);
> - }
> - }
> -
> twoDVarZonalMean.setExecutionPurpose(response.path("purpose").textValue());
> -
> twoDVarZonalMean.setImage(response.path("plotUrl").textValue());
> -
> twoDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableZonelMean.render(twoDVarZonalMean));
> - }
> - else if (serviceName.equals("2-D-Variable-Map")) {
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> twoDVarMap.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> twoDVarMap.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> twoDVarMap.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> twoDVarMap.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> twoDVarMap.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> twoDVarMap.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> twoDVarMap.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> twoDVarMap.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> twoDVarMap.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> twoDVarMap.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> twoDVarMap.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> twoDVarMap.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> twoDVarMap.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> twoDVarMap.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> twoDVarMap.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> twoDVarMap.addMonth("dec");
> - }
> - }
> -
> twoDVarMap.changeSelectMonths();
> - } else if
> (parameterName.equals("lat1")) {
> -
> twoDVarMap.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> twoDVarMap.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> twoDVarMap.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> twoDVarMap.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("scale")) {
> -
> twoDVarMap.setVariableScale(parameterValue);
> - }
> - }
> -
> twoDVarMap.setExecutionPurpose(response.path("purpose").textValue());
> -
> twoDVarMap.setImage(response.path("plotUrl").textValue());
> -
> twoDVarMap.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableMap.render(twoDVarMap));
> - }
> - else if
> (serviceName.equals("Conditional-Sampling-with-One-Variable")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if
> (parameterName.equals("model2")) {
> -
> conditionalSampling.setDataSourceE(parameterValue);
> - } else if
> (parameterName.equals("model1")) {
> -
> conditionalSampling.setDataSourceP(parameterValue);
> - } else if
> (parameterName.equals("var2")) {
> -
> conditionalSampling.setVariableNameE(parameterValue);
> - } else if
> (parameterName.equals("var1")) {
> -
> conditionalSampling.setVariableNameP(parameterValue);
> - } else if
> (parameterName.equals("pre1")) {
> -
> conditionalSampling.setPressureRangeP(parameterValue);
> - } else if
> (parameterName.equals("pre2")) {
> -
> conditionalSampling.setPressureRangeE(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> conditionalSampling.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> conditionalSampling.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> conditionalSampling.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> conditionalSampling.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> conditionalSampling.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> conditionalSampling.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> conditionalSampling.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> conditionalSampling.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> conditionalSampling.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> conditionalSampling.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> conditionalSampling.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> conditionalSampling.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> conditionalSampling.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> conditionalSampling.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> conditionalSampling.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> conditionalSampling.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> conditionalSampling.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> conditionalSampling.addMonth("dec");
> - }
> -
> - }
> -
> conditionalSampling.changeSelectMonths();
> - } else if
> (parameterName.equals("bin_min")) {
> -
> conditionalSampling.setBin_min(parameterValue);
> - } else if
> (parameterName.equals("bin_max")) {
> -
> conditionalSampling.setBin_max(parameterValue);
> - } else if
> (parameterName.equals("bin_n")) {
> -
> conditionalSampling.setBin_n(parameterValue);
> - } else if
> (parameterName.equals("displayOpt")) {
> - int
> paramBit=Integer.parseInt(parameterValue);
> - int bitmaskX = 0x1;
> - int bitmaskY = 0x2;
> - int bitmaskZ = 0x4;
> -
> conditionalSampling.setX(Integer.toString(paramBit & bitmaskX, 2));
> -
> conditionalSampling.setY(Integer.toString((paramBit & bitmaskY)>>1, 2));
> -
> conditionalSampling.setZ(Integer.toString((paramBit & bitmaskZ)>>2, 2));
> - }
> - }
> -
> conditionalSampling.setExecutionPurpose(response.path("purpose").textValue());
> -
> conditionalSampling.setImage(response.path("plotUrl").textValue());
> -
> conditionalSampling.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.conditionalSampling.render(conditionalSampling));
> - }else if
> (serviceName.equals("2-D-Variable-Time-Series")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> twoDVarTimeSeries.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> twoDVarTimeSeries.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> twoDVarTimeSeries.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> twoDVarTimeSeries.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> twoDVarTimeSeries.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> twoDVarTimeSeries.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> twoDVarTimeSeries.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> twoDVarTimeSeries.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("scale")) {
> -
> twoDVarTimeSeries.setVariableScale(parameterValue);
> - }
> - }
> -
> twoDVarTimeSeries.setExecutionPurpose(response.path("purpose").textValue());
> -
> twoDVarTimeSeries.setImage(response.path("plotUrl").textValue());
> -
> twoDVarTimeSeries.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableTimeSeries.render(twoDVarTimeSeries));
> - }else if
> (serviceName.equals("Regrid-and-Download")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> regridAndDownload.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> regridAndDownload.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> regridAndDownload.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> regridAndDownload.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> regridAndDownload.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> regridAndDownload.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("dlat")) {
> -
> regridAndDownload.setDeltaLat(parameterValue);
> - } else if
> (parameterName.equals("dlon")) {
> -
> regridAndDownload.setDeltaLon(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> regridAndDownload.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> regridAndDownload.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("plev")) {
> -
> regridAndDownload.setPressureLevel(parameterValue);
> - }
> - }
> -
> regridAndDownload.setExecutionPurpose(response.path("purpose").textValue());
> -
> -
> regridAndDownload.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.regridAndDownload.render(regridAndDownload));
> - }else if
> (serviceName.equals("3-D-Variable-Zonal-Mean")){
> - String press1 = "";
> - String press2 = "";
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> threeDVarZonalMean.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> threeDVarZonalMean.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> threeDVarZonalMean.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> threeDVarZonalMean.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> threeDVarZonalMean.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> threeDVarZonalMean.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("pres1")) {
> - press1 = parameterValue;
> - } else if
> (parameterName.equals("pres2")) {
> - press2 = parameterValue;
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> threeDVarZonalMean.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> threeDVarZonalMean.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> threeDVarZonalMean.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> threeDVarZonalMean.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> threeDVarZonalMean.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> threeDVarZonalMean.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> threeDVarZonalMean.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> threeDVarZonalMean.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> threeDVarZonalMean.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> threeDVarZonalMean.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> threeDVarZonalMean.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> threeDVarZonalMean.addMonth("dec");
> - }
> - }
> - } else if
> (parameterName.equals("scale")) {
> - if
> (parameterValue.equals("2")) {
> -
> threeDVarZonalMean.setPressureScale("2");
> -
> threeDVarZonalMean.setColorScale("0");
> - } else if
> (parameterValue.equals("0")) {
> -
> threeDVarZonalMean.setPressureScale("0");
> -
> threeDVarZonalMean.setColorScale("0");
> - } else if
> (parameterValue.equals("4")) {
> -
> threeDVarZonalMean.setPressureScale("0");
> -
> threeDVarZonalMean.setColorScale("4");
> - } else if
> (parameterValue.equals("6")) {
> -
> threeDVarZonalMean.setPressureScale("2");
> -
> threeDVarZonalMean.setColorScale("4");
> - }
> - }
> - }
> - if (!press1.isEmpty() & !press2.isEmpty())
> -
> threeDVarZonalMean.setPressureRange("" + (Integer.parseInt(press1) / 100)
> + "," + (Integer.parseInt(press2) / 100));
> -
> threeDVarZonalMean.setExecutionPurpose(response.path("purpose").textValue());
> -
> threeDVarZonalMean.setImage(response.path("plotUrl").textValue());
> -
> threeDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.threeDVariableZonalMean.render(threeDVarZonalMean));
> - }else if
> (serviceName.equals("Scatter-and-Histogram-Plot-of-Two-Variables")){
> //"19")){
> -
> scatterHistogram.setPressureLevel1("N/A");
> -
> scatterHistogram.setPressureLevel2("N/A");
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if
> (parameterName.equals("model1")) {
> -
> scatterHistogram.setSource1(parameterValue);
> -
> - } else if
> (parameterName.equals("model2")) {
> -
> scatterHistogram.setSource2(parameterValue);
> -
> - } else if
> (parameterName.equals("var1")) {
> -
> scatterHistogram.setVaribaleName1(parameterValue);
> -
> - } else if
> (parameterName.equals("var2")) {
> -
> scatterHistogram.setVaribaleName2(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> scatterHistogram.setStartYear(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> scatterHistogram.setEndYear(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> scatterHistogram.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> scatterHistogram.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> scatterHistogram.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> scatterHistogram.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("nSample")) {
> -
> scatterHistogram.setSamples(parameterValue);
> - }
> - }
> -
> scatterHistogram.setExecutionPurpose(response.path("purpose").textValue());
> -
> scatterHistogram.setImage(response.path("plotUrl").textValue());
> -
> scatterHistogram.setDataUrl(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.scatterAndHistogramTwoVariable.render(scatterHistogram));
> - }else if
> (serviceName.equals("Difference-Plot-of-Two-Time-Averaged-Variables")){
> //"20")){
> -
> diffPlotTwoTimeAvg.setPressureLevel1("N/A");
> -
> Console.println(diffPlotTwoTimeAvg.getPressureLevel1());
> -
> diffPlotTwoTimeAvg.setPressureLevel2("N/A");
> - for (int i = 0; i < response
RE: [43/49] incubator-cmda git commit: remove all
Posted by Jia Zhang <ji...@sv.cmu.edu>.
Dear Chris:
You are correct. It is the initial check-ins with the entire system. >From now on, unless major release, commits will be incremental.
Best regards,
Jia
---
Jia Zhang, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
Carnegie Mellon University – Silicon Valley
23 S. Akron Rd.
Mountain View, CA 94035
Email: jia.zhang@sv.cmu.edu
Phone: 312-718-2468
-----Original Message-----
From: Mattmann, Chris A (3980) [mailto:chris.a.mattmann@jpl.nasa.gov]
Sent: Wednesday, September 09, 2015 6:50 AM
To: dev@cmda.incubator.apache.org; jia.zhang@sv.cmu.edu
Cc: james@carmanconsulting.com
Subject: Re: [43/49] incubator-cmda git commit: remove all
Well, the short answer James, is no - we need commit notifications to exist and be sent to the commit list. I think one thing James was expressing is that many of the commits are difficult to review since there are tons of files being checked in and out. I’m assuming that’s b/c it’s the initial check-ins, and that all the commits won’t be this way. Is that correct?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398) NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----Original Message-----
From: Jia Zhang <ji...@sv.cmu.edu>
Organization: Carnegie Mellon University - Silicon Valley
Reply-To: "dev@cmda.incubator.apache.org" <de...@cmda.incubator.apache.org>, "jia.zhang@sv.cmu.edu" <ji...@sv.cmu.edu>
Date: Tuesday, September 8, 2015 at 9:56 PM
To: "dev@cmda.incubator.apache.org" <de...@cmda.incubator.apache.org>
Cc: "james@carmanconsulting.com" <ja...@carmanconsulting.com>
Subject: RE: [43/49] incubator-cmda git commit: remove all
>Dear James:
>
>Would you please clarify a little?
>
>Thanks a lot.
>
>Best regards,
>Jia
>
>-----Original Message-----
>From: James Carman [mailto:james@carmanconsulting.com]
>Sent: Tuesday, September 08, 2015 3:46 PM
>To: dev@cmda.incubator.apache.org
>Subject: Re: [43/49] incubator-cmda git commit: remove all
>
>Can we turn these notifications off?
>
>On Tue, Sep 8, 2015 at 6:44 PM <xi...@apache.org> wrote:
>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/a
>> p p/controllers/ClimateServiceController.java
>> ---------------------------------------------------------------------
>> - diff --git a/app/controllers/ClimateServiceController.java
>> b/app/controllers/ClimateServiceController.java
>> deleted file mode 100644
>> index 2c6aa1c..0000000
>> --- a/app/controllers/ClimateServiceController.java
>> +++ /dev/null
>> @@ -1,931 +0,0 @@
>> -/*
>> - * Licensed to the Apache Software Foundation (ASF) under one or
>>more
>> - * contributor license agreements. See the NOTICE file distributed
>>with
>> - * this work for additional information regarding copyright ownership.
>> - * The ASF licenses this file to You under the Apache License,
>>Version 2.0
>> - * (the "License"); you may not use this file except in compliance
>>with
>> - * the License. You may obtain a copy of the License at
>> - *
>> - * http://www.apache.org/licenses/LICENSE-2.0
>> - *
>> - * Unless required by applicable law or agreed to in writing,
>>software
>> - * distributed under the License is distributed on an "AS IS" BASIS,
>> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>implied.
>> - * See the License for the specific language governing permissions
>>and
>> - * limitations under the License.
>> - */
>> -
>> -package controllers;
>> -
>> -import com.fasterxml.jackson.databind.JsonNode;
>> -import com.fasterxml.jackson.databind.node.ObjectNode;
>> -import models.metadata.ClimateService; -import
>>models.metadata.DiffPlotTwoTimeAveragedVar;
>> -import models.metadata.RegridAndDownload;
>> -import models.metadata.TwoDVarZonalMean; -import
>>models.metadata.TwoDVarMap; -import models.metadata.TwoDVarTimeSeries;
>> -import models.metadata.ThreeDVarZonalMean;
>> -import models.metadata.ThreeDVar2DSlice; -import
>>models.metadata.ThreeDVarAvgVertical4Profile;
>> -import models.metadata.ScatterHistogramTwoVar;
>> -import models.metadata.ConditionalSampling;
>> -import models.metadata.ServiceLog;
>> -import models.metadata.CorrelationMap; -import
>>models.metadata.ConditionalSampling2Var;
>> -import play.Logger;
>> -import play.data.Form;
>> -import play.libs.Json;
>> -import play.mvc.Controller;
>> -import play.mvc.Result;
>> -import scala.Console;
>> -import util.APICall;
>> -import util.APICall.ResponseType;
>> -import util.Constants;
>> -import views.html.climate.*;
>> -import play.data.DynamicForm;
>> -import java.io.File;
>> -import java.io.IOException;
>> -import java.io.UnsupportedEncodingException;
>> -import java.text.DateFormat;
>> -import java.text.SimpleDateFormat;
>> -import java.util.Date;
>> -import java.util.List;
>> -import com.fasterxml.jackson.databind.ObjectMapper;
>> -
>> -public class ClimateServiceController extends Controller {
>> -
>> - final static Form<ClimateService> climateServiceForm = Form
>> - .form(ClimateService.class);
>> -
>> - public static Result home(String email, String vfile, String
>> dataset) {
>> - return ok(home.render(email, vfile, dataset));
>> - }
>> -
>> - public static Result addClimateServices() {
>> - return
>>ok(addClimateServices.render(climateServiceForm));
>> - }
>> -
>> - public static Result tutorial() {
>> - return ok(tutorial.render());
>> - }
>> -
>> - public static Result climateServices() {
>> - return ok(climateServices.render(ClimateService.all(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostRecentlyAddedClimateServices() {
>> - return
>>
>>ok(mostRecentlyAddedServices.render(ClimateService.getMostRecentlyAdde
>>d()
>>,
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostRecentlyUsedClimateServices() {
>> - return
>> ok(mostRecentlyUsedServices.render(ClimateService.getMostRecentlyUsed(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostPopularClimateServices() {
>> - return
>> ok(mostPopularServices.render(ClimateService.getMostPopular(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result newClimateService() {
>> - Form<ClimateService> dc =
>> climateServiceForm.bindFromRequest();
>> - ObjectNode jsonData = Json.newObject();
>> - try {
>> -
>> - String originalClimateServiceName =
>> dc.field("Name").value();
>> - String newClimateServiceName =
>> originalClimateServiceName.replace(' ', '-');
>> -
>> - if (newClimateServiceName != null &&
>> !newClimateServiceName.isEmpty()) {
>> - jsonData.put("name",
>> newClimateServiceName);
>> - }
>> -
>> - jsonData.put("creatorId", 1);
>> - jsonData.put("purpose",
>> dc.field("Purpose").value());
>> - jsonData.put("url", dc.field("Url").value());
>> - DateFormat dateFormat = new
>> SimpleDateFormat("yyyy/MM/dd HH:mm");
>> - Date date = new Date();
>> - jsonData.put("createTime",
>> dateFormat.format(date));
>> - jsonData.put("scenario",
>> dc.field("Scenario").value());
>> - jsonData.put("versionNo",
>> dc.field("Version").value());
>> - jsonData.put("rootServiceId",
>> dc.field("Root_Service").value());
>> - JsonNode response =
>> ClimateService.create(jsonData);
>> - Application.flashMsg(response);
>> - } catch (IllegalStateException e) {
>> - e.printStackTrace();
>> - Application.flashMsg(APICall
>> -
>> .createResponse(ResponseType.CONVERSIONERROR));
>> - } catch (Exception e) {
>> - e.printStackTrace();
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - }
>> - return redirect("/climate/climateServices");
>> - }
>> -
>> - public static Result editClimateService() {
>> -
>> - ObjectNode jsonData = Json.newObject();
>> - try {
>> - DynamicForm df =
>> DynamicForm.form().bindFromRequest();
>> - String climateServiceName =
>>df.field("pk").value();
>> -
>> - if (climateServiceName != null &&
>> !climateServiceName.isEmpty()) {
>> - jsonData.put("name",
>>climateServiceName);
>> - }
>> - ClimateService originalService =
>> ClimateService.findServiceByName(climateServiceName);
>> -
>> - if (originalService == null) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("not found original
>> climateService " + climateServiceName);
>> - }
>> -
>> - jsonData.put("creatorId", 1);
>> - jsonData.put("purpose",
>> originalService.getPurpose());
>> - jsonData.put("url", originalService.getUrl());
>> - jsonData.put("scenario",
>> originalService.getScenario());
>> - jsonData.put("versionNo",
>> originalService.getVersion());
>> -
>> - if (originalService.getRootservice() != null)
>> -
>> - jsonData.put("rootServiceId",
>> originalService.getRootservice());
>> - String editField = df.field("name").value();
>> -
>> - if (editField != null && !editField.isEmpty()) {
>> - jsonData.put(editField,
>> df.field("value").value());
>> - }
>> -
>> - if (editField == null || editField.isEmpty()) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("not found edit field");
>> - }
>> -
>> - JsonNode response =
>> ClimateService.edit(climateServiceName, jsonData);
>> - Application.flashMsg(response);
>> -
>> - } catch (IllegalStateException e) {
>> - e.printStackTrace();
>> - Application.flashMsg(APICall
>> -
>> .createResponse(ResponseType.CONVERSIONERROR));
>> - } catch (Exception e) {
>> - e.printStackTrace();
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - }
>> - return ok("updated");
>> -
>> - }
>> -
>> - public static Result getConfigurationByConfId() {
>> - String output = "";
>> - TwoDVarMap twoDVarMap = new TwoDVarMap();
>> - TwoDVarZonalMean twoDVarZonalMean = new
>>TwoDVarZonalMean();
>> - ScatterHistogramTwoVar scatterHistogram = new
>> ScatterHistogramTwoVar();
>> - ThreeDVarAvgVertical4Profile threeDVarAvgVertical = new
>> ThreeDVarAvgVertical4Profile();
>> - DiffPlotTwoTimeAveragedVar diffPlotTwoTimeAvg = new
>> DiffPlotTwoTimeAveragedVar();
>> - ThreeDVar2DSlice threeDVar2DSlice = new
>>ThreeDVar2DSlice();
>> - TwoDVarTimeSeries twoDVarTimeSeries = new
>> TwoDVarTimeSeries();
>> - ThreeDVarZonalMean threeDVarZonalMean = new
>> ThreeDVarZonalMean();
>> - ConditionalSampling conditionalSampling = new
>> ConditionalSampling();
>> - RegridAndDownload regridAndDownload = new
>> RegridAndDownload();
>> - CorrelationMap correlationMap = new CorrelationMap();
>> - ConditionalSampling2Var conditionalSampling2Var = new
>> ConditionalSampling2Var();
>> -
>> - try {
>> - DynamicForm df =
>> DynamicForm.form().bindFromRequest();
>> - String logId = df.field("logId").value();
>> -
>> - if (logId == null || logId.isEmpty()) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("confId is null or
>>empty");
>> - }
>> -
>> - JsonNode response =
>> APICall.callAPI(Constants.NEW_BACKEND +
>>Constants.SERVICE_EXECUTION_LOG + Constants.SERVICE_EXECUTION_LOG_GET
>>+ logId);
>> - int configurationId =
>> response.path("serviceConfiguration").path("id").asInt();
>> - JsonNode responseConfigItems =
>> APICall.callAPI(Constants.NEW_BACKEND + Constants.CONFIG_ITEM +
>>Constants.GET_CONFIG_ITEMS_BY_CONFIG + configurationId);
>> - String serviceName =
>> response.path("climateService").path("name").asText();
>> - //TODO:
>> - if
>>(serviceName.equals("2-D-Variable-Zonal-Mean"))
>> {
>> - //TODO: DO NOT USE
>> node.findPath(key)!!!!! use find(key) instead to get your immediate
>>children if you know the json structure (and we do).
>> - //TODO: (con't) findPath returns the
>>first
>> occurence of a key string, including GRANDCHILDREN
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> -
>> - if (parameterName.equals("data
>> source")) {
>> -
>> twoDVarZonalMean.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("variable name")) {
>> -
>> twoDVarZonalMean.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("start year-month")) {
>> -
>> twoDVarZonalMean.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("end year-month")) {
>> -
>> twoDVarZonalMean.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("select months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> twoDVarZonalMean.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> twoDVarZonalMean.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> twoDVarZonalMean.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> twoDVarZonalMean.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> twoDVarZonalMean.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> twoDVarZonalMean.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> twoDVarZonalMean.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> twoDVarZonalMean.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> twoDVarZonalMean.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> twoDVarZonalMean.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> twoDVarZonalMean.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> twoDVarZonalMean.addMonth("dec");
>> - }
>> - }
>> -
>> twoDVarZonalMean.changeSelectMonths();
>> - } else if
>> (parameterName.equals("start lat (deg)")) {
>> -
>> twoDVarZonalMean.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("end lat (deg)")) {
>> -
>> twoDVarZonalMean.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("variable scale")) {
>> -
>> twoDVarZonalMean.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>>
>>
>>twoDVarZonalMean.setExecutionPurpose(response.path("purpose").textValu
>> e());
>> -
>> twoDVarZonalMean.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableZonelMean.render(twoDVarZonalMean));
>> - }
>> - else if
>>(serviceName.equals("2-D-Variable-Map")) {
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> twoDVarMap.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> twoDVarMap.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> twoDVarMap.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> twoDVarMap.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> twoDVarMap.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> twoDVarMap.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> twoDVarMap.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> twoDVarMap.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> twoDVarMap.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> twoDVarMap.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> twoDVarMap.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> twoDVarMap.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> twoDVarMap.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> twoDVarMap.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> twoDVarMap.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> twoDVarMap.addMonth("dec");
>> - }
>> - }
>> -
>> twoDVarMap.changeSelectMonths();
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> twoDVarMap.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> twoDVarMap.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> twoDVarMap.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> twoDVarMap.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("scale")) {
>> -
>> twoDVarMap.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>>
>>twoDVarMap.setExecutionPurpose(response.path("purpose").textValue());
>> -
>> twoDVarMap.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarMap.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableMap.render(twoDVarMap));
>> - }
>> - else if
>> (serviceName.equals("Conditional-Sampling-with-One-Variable")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>> (parameterName.equals("model2")) {
>> -
>> conditionalSampling.setDataSourceE(parameterValue);
>> - } else if
>> (parameterName.equals("model1")) {
>> -
>> conditionalSampling.setDataSourceP(parameterValue);
>> - } else if
>> (parameterName.equals("var2")) {
>> -
>> conditionalSampling.setVariableNameE(parameterValue);
>> - } else if
>> (parameterName.equals("var1")) {
>> -
>> conditionalSampling.setVariableNameP(parameterValue);
>> - } else if
>> (parameterName.equals("pre1")) {
>> -
>> conditionalSampling.setPressureRangeP(parameterValue);
>> - } else if
>> (parameterName.equals("pre2")) {
>> -
>> conditionalSampling.setPressureRangeE(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> conditionalSampling.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> conditionalSampling.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> conditionalSampling.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> conditionalSampling.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> conditionalSampling.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> conditionalSampling.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> conditionalSampling.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> conditionalSampling.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> conditionalSampling.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> conditionalSampling.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> conditionalSampling.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> conditionalSampling.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> conditionalSampling.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> conditionalSampling.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> conditionalSampling.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> conditionalSampling.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> conditionalSampling.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> conditionalSampling.addMonth("dec");
>> - }
>> -
>> - }
>> -
>> conditionalSampling.changeSelectMonths();
>> - } else if
>> (parameterName.equals("bin_min")) {
>> -
>> conditionalSampling.setBin_min(parameterValue);
>> - } else if
>> (parameterName.equals("bin_max")) {
>> -
>> conditionalSampling.setBin_max(parameterValue);
>> - } else if
>> (parameterName.equals("bin_n")) {
>> -
>> conditionalSampling.setBin_n(parameterValue);
>> - } else if
>> (parameterName.equals("displayOpt")) {
>> - int
>> paramBit=Integer.parseInt(parameterValue);
>> - int bitmaskX = 0x1;
>> - int bitmaskY = 0x2;
>> - int bitmaskZ = 0x4;
>> -
>> conditionalSampling.setX(Integer.toString(paramBit & bitmaskX, 2));
>> -
>> conditionalSampling.setY(Integer.toString((paramBit & bitmaskY)>>1,
>>2));
>> -
>> conditionalSampling.setZ(Integer.toString((paramBit & bitmaskZ)>>2,
>>2));
>> - }
>> - }
>> -
>>
>> conditionalSampling.setExecutionPurpose(response.path("purpose").text
>> V
>> alue());
>> -
>> conditionalSampling.setImage(response.path("plotUrl").textValue());
>> -
>> conditionalSampling.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.conditionalSampling.render(conditionalSampling));
>> - }else if
>> (serviceName.equals("2-D-Variable-Time-Series")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> twoDVarTimeSeries.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> twoDVarTimeSeries.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> twoDVarTimeSeries.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> twoDVarTimeSeries.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> twoDVarTimeSeries.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> twoDVarTimeSeries.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> twoDVarTimeSeries.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> twoDVarTimeSeries.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("scale")) {
>> -
>> twoDVarTimeSeries.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>>
>> twoDVarTimeSeries.setExecutionPurpose(response.path("purpose").textVa
>> l
>> ue());
>> -
>> twoDVarTimeSeries.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarTimeSeries.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableTimeSeries.render(twoDVarTimeSeries));
>> - }else if
>> (serviceName.equals("Regrid-and-Download")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> regridAndDownload.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> regridAndDownload.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> regridAndDownload.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> regridAndDownload.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> regridAndDownload.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> regridAndDownload.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("dlat")) {
>> -
>> regridAndDownload.setDeltaLat(parameterValue);
>> - } else if
>> (parameterName.equals("dlon")) {
>> -
>> regridAndDownload.setDeltaLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> regridAndDownload.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> regridAndDownload.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("plev")) {
>> -
>> regridAndDownload.setPressureLevel(parameterValue);
>> - }
>> - }
>> -
>>
>> regridAndDownload.setExecutionPurpose(response.path("purpose").textVa
>> l
>> ue());
>> -
>> -
>> regridAndDownload.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.regridAndDownload.render(regridAndDownload));
>> - }else if
>> (serviceName.equals("3-D-Variable-Zonal-Mean")){
>> - String press1 = "";
>> - String press2 = "";
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> threeDVarZonalMean.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> threeDVarZonalMean.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> threeDVarZonalMean.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> threeDVarZonalMean.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> threeDVarZonalMean.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> threeDVarZonalMean.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("pres1")) {
>> - press1 = parameterValue;
>> - } else if
>> (parameterName.equals("pres2")) {
>> - press2 = parameterValue;
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> threeDVarZonalMean.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> threeDVarZonalMean.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> threeDVarZonalMean.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> threeDVarZonalMean.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> threeDVarZonalMean.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> threeDVarZonalMean.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> threeDVarZonalMean.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> threeDVarZonalMean.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> threeDVarZonalMean.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> threeDVarZonalMean.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> threeDVarZonalMean.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> threeDVarZonalMean.addMonth("dec");
>> - }
>> - }
>> - } else if
>> (parameterName.equals("scale")) {
>> - if
>> (parameterValue.equals("2")) {
>> -
>> threeDVarZonalMean.setPressureScale("2");
>> -
>> threeDVarZonalMean.setColorScale("0");
>> - } else if
>> (parameterValue.equals("0")) {
>> -
>> threeDVarZonalMean.setPressureScale("0");
>> -
>> threeDVarZonalMean.setColorScale("0");
>> - } else if
>> (parameterValue.equals("4")) {
>> -
>> threeDVarZonalMean.setPressureScale("0");
>> -
>> threeDVarZonalMean.setColorScale("4");
>> - } else if
>> (parameterValue.equals("6")) {
>> -
>> threeDVarZonalMean.setPressureScale("2");
>> -
>> threeDVarZonalMean.setColorScale("4");
>> - }
>> - }
>> - }
>> - if (!press1.isEmpty() &
>>!press2.isEmpty())
>> -
>> threeDVarZonalMean.setPressureRange("" + (Integer.parseInt(press1) /
>> 100)
>> + "," + (Integer.parseInt(press2) / 100));
>> -
>>
>> threeDVarZonalMean.setExecutionPurpose(response.path("purpose").textV
>> a
>> lue());
>> -
>> threeDVarZonalMean.setImage(response.path("plotUrl").textValue());
>> -
>> threeDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
>> - return
>>
>>ok(views.html.climate.threeDVariableZonalMean.render(threeDVarZonalMea
>>n))
>>;
>> - }else if
>> (serviceName.equals("Scatter-and-Histogram-Plot-of-Two-Variables")){
>> //"19")){
>> -
>> scatterHistogram.setPressureLevel1("N/A");
>> -
>> scatterHistogram.setPressureLevel2("N/A");
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>> (parameterName.equals("model1")) {
>> -
>> scatterHistogram.setSource1(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("model2")) {
>> -
>> scatterHistogram.setSource2(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("var1")) {
>> -
>> scatterHistogram.setVaribaleName1(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("var2")) {
>> -
>> scatterHistogram.setVaribaleName2(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> scatterHistogram.setStartYear(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> scatterHistogram.setEndYear(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> scatterHistogram.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> scatterHistogram.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> scatterHistogram.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> scatterHistogram.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("nSample")) {
>> -
>> scatterHistogram.setSamples(parameterValue);
>> - }
>> - }
>> -
>>
>> scatterHistogram.setExecutionPurpose(response.path("purpose").textVal
>> u
>> e());
>> -
>> scatterHistogram.setImage(response.path("plotUrl").textValue());
>> -
>> scatterHistogram.setDataUrl(response.path("dataUrl").textValue());
>> - return
>>
>>ok(views.html.climate.scatterAndHistogramTwoVariable.render(scatterHis
>>tog
>>ram));
>> - }else if
>> (serviceName.equals("Difference-Plot-of-Two-Time-Averaged-Variables")){
>> //"20")){
>> -
>> diffPlotTwoTimeAvg.setPressureLevel1("N/A");
>> -
>> Console.println(diffPlotTwoTimeAvg.getPressureLevel1());
>> -
>> diffPlotTwoTimeAvg.setPressureLevel2("N/A");
>> - for (int i = 0; i < response
>
>
Re: [43/49] incubator-cmda git commit: remove all
Posted by "Mattmann, Chris A (3980)" <ch...@jpl.nasa.gov>.
Well, the short answer James, is no - we need commit notifications
to exist and be sent to the commit list. I think one thing James
was expressing is that many of the commits are difficult to review
since there are tons of files being checked in and out. I’m assuming
that’s b/c it’s the initial check-ins, and that all the commits won’t
be this way. Is that correct?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: chris.a.mattmann@nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----Original Message-----
From: Jia Zhang <ji...@sv.cmu.edu>
Organization: Carnegie Mellon University - Silicon Valley
Reply-To: "dev@cmda.incubator.apache.org" <de...@cmda.incubator.apache.org>,
"jia.zhang@sv.cmu.edu" <ji...@sv.cmu.edu>
Date: Tuesday, September 8, 2015 at 9:56 PM
To: "dev@cmda.incubator.apache.org" <de...@cmda.incubator.apache.org>
Cc: "james@carmanconsulting.com" <ja...@carmanconsulting.com>
Subject: RE: [43/49] incubator-cmda git commit: remove all
>Dear James:
>
>Would you please clarify a little?
>
>Thanks a lot.
>
>Best regards,
>Jia
>
>-----Original Message-----
>From: James Carman [mailto:james@carmanconsulting.com]
>Sent: Tuesday, September 08, 2015 3:46 PM
>To: dev@cmda.incubator.apache.org
>Subject: Re: [43/49] incubator-cmda git commit: remove all
>
>Can we turn these notifications off?
>
>On Tue, Sep 8, 2015 at 6:44 PM <xi...@apache.org> wrote:
>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/ap
>> p/controllers/ClimateServiceController.java
>> ----------------------------------------------------------------------
>> diff --git a/app/controllers/ClimateServiceController.java
>> b/app/controllers/ClimateServiceController.java
>> deleted file mode 100644
>> index 2c6aa1c..0000000
>> --- a/app/controllers/ClimateServiceController.java
>> +++ /dev/null
>> @@ -1,931 +0,0 @@
>> -/*
>> - * Licensed to the Apache Software Foundation (ASF) under one or more
>> - * contributor license agreements. See the NOTICE file distributed
>> with
>> - * this work for additional information regarding copyright ownership.
>> - * The ASF licenses this file to You under the Apache License,
>> Version 2.0
>> - * (the "License"); you may not use this file except in compliance
>> with
>> - * the License. You may obtain a copy of the License at
>> - *
>> - * http://www.apache.org/licenses/LICENSE-2.0
>> - *
>> - * Unless required by applicable law or agreed to in writing,
>> software
>> - * distributed under the License is distributed on an "AS IS" BASIS,
>> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>> - * See the License for the specific language governing permissions
>> and
>> - * limitations under the License.
>> - */
>> -
>> -package controllers;
>> -
>> -import com.fasterxml.jackson.databind.JsonNode;
>> -import com.fasterxml.jackson.databind.node.ObjectNode;
>> -import models.metadata.ClimateService; -import
>> models.metadata.DiffPlotTwoTimeAveragedVar;
>> -import models.metadata.RegridAndDownload;
>> -import models.metadata.TwoDVarZonalMean; -import
>> models.metadata.TwoDVarMap; -import models.metadata.TwoDVarTimeSeries;
>> -import models.metadata.ThreeDVarZonalMean;
>> -import models.metadata.ThreeDVar2DSlice; -import
>> models.metadata.ThreeDVarAvgVertical4Profile;
>> -import models.metadata.ScatterHistogramTwoVar;
>> -import models.metadata.ConditionalSampling;
>> -import models.metadata.ServiceLog;
>> -import models.metadata.CorrelationMap; -import
>> models.metadata.ConditionalSampling2Var;
>> -import play.Logger;
>> -import play.data.Form;
>> -import play.libs.Json;
>> -import play.mvc.Controller;
>> -import play.mvc.Result;
>> -import scala.Console;
>> -import util.APICall;
>> -import util.APICall.ResponseType;
>> -import util.Constants;
>> -import views.html.climate.*;
>> -import play.data.DynamicForm;
>> -import java.io.File;
>> -import java.io.IOException;
>> -import java.io.UnsupportedEncodingException;
>> -import java.text.DateFormat;
>> -import java.text.SimpleDateFormat;
>> -import java.util.Date;
>> -import java.util.List;
>> -import com.fasterxml.jackson.databind.ObjectMapper;
>> -
>> -public class ClimateServiceController extends Controller {
>> -
>> - final static Form<ClimateService> climateServiceForm = Form
>> - .form(ClimateService.class);
>> -
>> - public static Result home(String email, String vfile, String
>> dataset) {
>> - return ok(home.render(email, vfile, dataset));
>> - }
>> -
>> - public static Result addClimateServices() {
>> - return
>>ok(addClimateServices.render(climateServiceForm));
>> - }
>> -
>> - public static Result tutorial() {
>> - return ok(tutorial.render());
>> - }
>> -
>> - public static Result climateServices() {
>> - return ok(climateServices.render(ClimateService.all(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostRecentlyAddedClimateServices() {
>> - return
>>
>>ok(mostRecentlyAddedServices.render(ClimateService.getMostRecentlyAdded()
>>,
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostRecentlyUsedClimateServices() {
>> - return
>> ok(mostRecentlyUsedServices.render(ClimateService.getMostRecentlyUsed(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result mostPopularClimateServices() {
>> - return
>> ok(mostPopularServices.render(ClimateService.getMostPopular(),
>> - climateServiceForm));
>> - }
>> -
>> - public static Result newClimateService() {
>> - Form<ClimateService> dc =
>> climateServiceForm.bindFromRequest();
>> - ObjectNode jsonData = Json.newObject();
>> - try {
>> -
>> - String originalClimateServiceName =
>> dc.field("Name").value();
>> - String newClimateServiceName =
>> originalClimateServiceName.replace(' ', '-');
>> -
>> - if (newClimateServiceName != null &&
>> !newClimateServiceName.isEmpty()) {
>> - jsonData.put("name",
>> newClimateServiceName);
>> - }
>> -
>> - jsonData.put("creatorId", 1);
>> - jsonData.put("purpose",
>> dc.field("Purpose").value());
>> - jsonData.put("url", dc.field("Url").value());
>> - DateFormat dateFormat = new
>> SimpleDateFormat("yyyy/MM/dd HH:mm");
>> - Date date = new Date();
>> - jsonData.put("createTime",
>> dateFormat.format(date));
>> - jsonData.put("scenario",
>> dc.field("Scenario").value());
>> - jsonData.put("versionNo",
>> dc.field("Version").value());
>> - jsonData.put("rootServiceId",
>> dc.field("Root_Service").value());
>> - JsonNode response =
>> ClimateService.create(jsonData);
>> - Application.flashMsg(response);
>> - } catch (IllegalStateException e) {
>> - e.printStackTrace();
>> - Application.flashMsg(APICall
>> -
>> .createResponse(ResponseType.CONVERSIONERROR));
>> - } catch (Exception e) {
>> - e.printStackTrace();
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - }
>> - return redirect("/climate/climateServices");
>> - }
>> -
>> - public static Result editClimateService() {
>> -
>> - ObjectNode jsonData = Json.newObject();
>> - try {
>> - DynamicForm df =
>> DynamicForm.form().bindFromRequest();
>> - String climateServiceName =
>>df.field("pk").value();
>> -
>> - if (climateServiceName != null &&
>> !climateServiceName.isEmpty()) {
>> - jsonData.put("name",
>>climateServiceName);
>> - }
>> - ClimateService originalService =
>> ClimateService.findServiceByName(climateServiceName);
>> -
>> - if (originalService == null) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("not found original
>> climateService " + climateServiceName);
>> - }
>> -
>> - jsonData.put("creatorId", 1);
>> - jsonData.put("purpose",
>> originalService.getPurpose());
>> - jsonData.put("url", originalService.getUrl());
>> - jsonData.put("scenario",
>> originalService.getScenario());
>> - jsonData.put("versionNo",
>> originalService.getVersion());
>> -
>> - if (originalService.getRootservice() != null)
>> -
>> - jsonData.put("rootServiceId",
>> originalService.getRootservice());
>> - String editField = df.field("name").value();
>> -
>> - if (editField != null && !editField.isEmpty()) {
>> - jsonData.put(editField,
>> df.field("value").value());
>> - }
>> -
>> - if (editField == null || editField.isEmpty()) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("not found edit field");
>> - }
>> -
>> - JsonNode response =
>> ClimateService.edit(climateServiceName, jsonData);
>> - Application.flashMsg(response);
>> -
>> - } catch (IllegalStateException e) {
>> - e.printStackTrace();
>> - Application.flashMsg(APICall
>> -
>> .createResponse(ResponseType.CONVERSIONERROR));
>> - } catch (Exception e) {
>> - e.printStackTrace();
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - }
>> - return ok("updated");
>> -
>> - }
>> -
>> - public static Result getConfigurationByConfId() {
>> - String output = "";
>> - TwoDVarMap twoDVarMap = new TwoDVarMap();
>> - TwoDVarZonalMean twoDVarZonalMean = new
>>TwoDVarZonalMean();
>> - ScatterHistogramTwoVar scatterHistogram = new
>> ScatterHistogramTwoVar();
>> - ThreeDVarAvgVertical4Profile threeDVarAvgVertical = new
>> ThreeDVarAvgVertical4Profile();
>> - DiffPlotTwoTimeAveragedVar diffPlotTwoTimeAvg = new
>> DiffPlotTwoTimeAveragedVar();
>> - ThreeDVar2DSlice threeDVar2DSlice = new
>>ThreeDVar2DSlice();
>> - TwoDVarTimeSeries twoDVarTimeSeries = new
>> TwoDVarTimeSeries();
>> - ThreeDVarZonalMean threeDVarZonalMean = new
>> ThreeDVarZonalMean();
>> - ConditionalSampling conditionalSampling = new
>> ConditionalSampling();
>> - RegridAndDownload regridAndDownload = new
>> RegridAndDownload();
>> - CorrelationMap correlationMap = new CorrelationMap();
>> - ConditionalSampling2Var conditionalSampling2Var = new
>> ConditionalSampling2Var();
>> -
>> - try {
>> - DynamicForm df =
>> DynamicForm.form().bindFromRequest();
>> - String logId = df.field("logId").value();
>> -
>> - if (logId == null || logId.isEmpty()) {
>> -
>> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
>> - return notFound("confId is null or
>>empty");
>> - }
>> -
>> - JsonNode response =
>> APICall.callAPI(Constants.NEW_BACKEND +
>> Constants.SERVICE_EXECUTION_LOG + Constants.SERVICE_EXECUTION_LOG_GET +
>>logId);
>> - int configurationId =
>> response.path("serviceConfiguration").path("id").asInt();
>> - JsonNode responseConfigItems =
>> APICall.callAPI(Constants.NEW_BACKEND + Constants.CONFIG_ITEM +
>> Constants.GET_CONFIG_ITEMS_BY_CONFIG + configurationId);
>> - String serviceName =
>> response.path("climateService").path("name").asText();
>> - //TODO:
>> - if
>>(serviceName.equals("2-D-Variable-Zonal-Mean"))
>> {
>> - //TODO: DO NOT USE
>> node.findPath(key)!!!!! use find(key) instead to get your immediate
>> children if you know the json structure (and we do).
>> - //TODO: (con't) findPath returns the
>>first
>> occurence of a key string, including GRANDCHILDREN
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> -
>> - if (parameterName.equals("data
>> source")) {
>> -
>> twoDVarZonalMean.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("variable name")) {
>> -
>> twoDVarZonalMean.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("start year-month")) {
>> -
>> twoDVarZonalMean.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("end year-month")) {
>> -
>> twoDVarZonalMean.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("select months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> twoDVarZonalMean.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> twoDVarZonalMean.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> twoDVarZonalMean.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> twoDVarZonalMean.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> twoDVarZonalMean.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> twoDVarZonalMean.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> twoDVarZonalMean.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> twoDVarZonalMean.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> twoDVarZonalMean.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> twoDVarZonalMean.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> twoDVarZonalMean.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> twoDVarZonalMean.addMonth("dec");
>> - }
>> - }
>> -
>> twoDVarZonalMean.changeSelectMonths();
>> - } else if
>> (parameterName.equals("start lat (deg)")) {
>> -
>> twoDVarZonalMean.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("end lat (deg)")) {
>> -
>> twoDVarZonalMean.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("variable scale")) {
>> -
>> twoDVarZonalMean.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>>
>> twoDVarZonalMean.setExecutionPurpose(response.path("purpose").textValu
>> e());
>> -
>> twoDVarZonalMean.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableZonelMean.render(twoDVarZonalMean));
>> - }
>> - else if
>>(serviceName.equals("2-D-Variable-Map")) {
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> twoDVarMap.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> twoDVarMap.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> twoDVarMap.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> twoDVarMap.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> twoDVarMap.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> twoDVarMap.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> twoDVarMap.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> twoDVarMap.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> twoDVarMap.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> twoDVarMap.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> twoDVarMap.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> twoDVarMap.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> twoDVarMap.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> twoDVarMap.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> twoDVarMap.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> twoDVarMap.addMonth("dec");
>> - }
>> - }
>> -
>> twoDVarMap.changeSelectMonths();
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> twoDVarMap.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> twoDVarMap.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> twoDVarMap.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> twoDVarMap.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("scale")) {
>> -
>> twoDVarMap.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>> twoDVarMap.setExecutionPurpose(response.path("purpose").textValue());
>> -
>> twoDVarMap.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarMap.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableMap.render(twoDVarMap));
>> - }
>> - else if
>> (serviceName.equals("Conditional-Sampling-with-One-Variable")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>> (parameterName.equals("model2")) {
>> -
>> conditionalSampling.setDataSourceE(parameterValue);
>> - } else if
>> (parameterName.equals("model1")) {
>> -
>> conditionalSampling.setDataSourceP(parameterValue);
>> - } else if
>> (parameterName.equals("var2")) {
>> -
>> conditionalSampling.setVariableNameE(parameterValue);
>> - } else if
>> (parameterName.equals("var1")) {
>> -
>> conditionalSampling.setVariableNameP(parameterValue);
>> - } else if
>> (parameterName.equals("pre1")) {
>> -
>> conditionalSampling.setPressureRangeP(parameterValue);
>> - } else if
>> (parameterName.equals("pre2")) {
>> -
>> conditionalSampling.setPressureRangeE(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> conditionalSampling.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> conditionalSampling.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> conditionalSampling.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> conditionalSampling.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> conditionalSampling.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> conditionalSampling.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> conditionalSampling.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> conditionalSampling.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> conditionalSampling.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> conditionalSampling.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> conditionalSampling.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> conditionalSampling.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> conditionalSampling.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> conditionalSampling.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> conditionalSampling.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> conditionalSampling.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> conditionalSampling.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> conditionalSampling.addMonth("dec");
>> - }
>> -
>> - }
>> -
>> conditionalSampling.changeSelectMonths();
>> - } else if
>> (parameterName.equals("bin_min")) {
>> -
>> conditionalSampling.setBin_min(parameterValue);
>> - } else if
>> (parameterName.equals("bin_max")) {
>> -
>> conditionalSampling.setBin_max(parameterValue);
>> - } else if
>> (parameterName.equals("bin_n")) {
>> -
>> conditionalSampling.setBin_n(parameterValue);
>> - } else if
>> (parameterName.equals("displayOpt")) {
>> - int
>> paramBit=Integer.parseInt(parameterValue);
>> - int bitmaskX = 0x1;
>> - int bitmaskY = 0x2;
>> - int bitmaskZ = 0x4;
>> -
>> conditionalSampling.setX(Integer.toString(paramBit & bitmaskX, 2));
>> -
>> conditionalSampling.setY(Integer.toString((paramBit & bitmaskY)>>1,
>> 2));
>> -
>> conditionalSampling.setZ(Integer.toString((paramBit & bitmaskZ)>>2,
>>2));
>> - }
>> - }
>> -
>>
>> conditionalSampling.setExecutionPurpose(response.path("purpose").textV
>> alue());
>> -
>> conditionalSampling.setImage(response.path("plotUrl").textValue());
>> -
>> conditionalSampling.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.conditionalSampling.render(conditionalSampling));
>> - }else if
>> (serviceName.equals("2-D-Variable-Time-Series")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> twoDVarTimeSeries.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> twoDVarTimeSeries.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> twoDVarTimeSeries.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> twoDVarTimeSeries.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> twoDVarTimeSeries.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> twoDVarTimeSeries.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> twoDVarTimeSeries.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> twoDVarTimeSeries.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("scale")) {
>> -
>> twoDVarTimeSeries.setVariableScale(parameterValue);
>> - }
>> - }
>> -
>>
>> twoDVarTimeSeries.setExecutionPurpose(response.path("purpose").textVal
>> ue());
>> -
>> twoDVarTimeSeries.setImage(response.path("plotUrl").textValue());
>> -
>> twoDVarTimeSeries.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.twoDVariableTimeSeries.render(twoDVarTimeSeries));
>> - }else if
>> (serviceName.equals("Regrid-and-Download")){
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> regridAndDownload.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> regridAndDownload.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> regridAndDownload.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> regridAndDownload.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> regridAndDownload.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> regridAndDownload.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("dlat")) {
>> -
>> regridAndDownload.setDeltaLat(parameterValue);
>> - } else if
>> (parameterName.equals("dlon")) {
>> -
>> regridAndDownload.setDeltaLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> regridAndDownload.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> regridAndDownload.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("plev")) {
>> -
>> regridAndDownload.setPressureLevel(parameterValue);
>> - }
>> - }
>> -
>>
>> regridAndDownload.setExecutionPurpose(response.path("purpose").textVal
>> ue());
>> -
>> -
>> regridAndDownload.setDataURL(response.path("dataUrl").textValue());
>> - return
>> ok(views.html.climate.regridAndDownload.render(regridAndDownload));
>> - }else if
>> (serviceName.equals("3-D-Variable-Zonal-Mean")){
>> - String press1 = "";
>> - String press2 = "";
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>>(parameterName.equals("model"))
>> {
>> -
>> threeDVarZonalMean.setDataSource(parameterValue);
>> - } else if
>> (parameterName.equals("var")) {
>> -
>> threeDVarZonalMean.setVariableName(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> threeDVarZonalMean.setStartYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> threeDVarZonalMean.setEndYearMonth(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> threeDVarZonalMean.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> threeDVarZonalMean.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("pres1")) {
>> - press1 = parameterValue;
>> - } else if
>> (parameterName.equals("pres2")) {
>> - press2 = parameterValue;
>> - } else if
>> (parameterName.equals("months")) {
>> - String[] months =
>> parameterValue.split(",");
>> - for (int j = 0; j <
>> months.length; j++) {
>> - if
>> (months[j].equals("1")) {
>> -
>> threeDVarZonalMean.addMonth("jan");
>> - } else if
>> (months[j].equals("2")) {
>> -
>> threeDVarZonalMean.addMonth("feb");
>> - } else if
>> (months[j].equals("3")) {
>> -
>> threeDVarZonalMean.addMonth("mar");
>> - } else if
>> (months[j].equals("4")) {
>> -
>> threeDVarZonalMean.addMonth("apr");
>> - } else if
>> (months[j].equals("5")) {
>> -
>> threeDVarZonalMean.addMonth("may");
>> - } else if
>> (months[j].equals("6")) {
>> -
>> threeDVarZonalMean.addMonth("jun");
>> - } else if
>> (months[j].equals("7")) {
>> -
>> threeDVarZonalMean.addMonth("jul");
>> - } else if
>> (months[j].equals("8")) {
>> -
>> threeDVarZonalMean.addMonth("aug");
>> - } else if
>> (months[j].equals("9")) {
>> -
>> threeDVarZonalMean.addMonth("sep");
>> - } else if
>> (months[j].equals("10")) {
>> -
>> threeDVarZonalMean.addMonth("oct");
>> - } else if
>> (months[j].equals("11")) {
>> -
>> threeDVarZonalMean.addMonth("nov");
>> - } else if
>> (months[j].equals("12")) {
>> -
>> threeDVarZonalMean.addMonth("dec");
>> - }
>> - }
>> - } else if
>> (parameterName.equals("scale")) {
>> - if
>> (parameterValue.equals("2")) {
>> -
>> threeDVarZonalMean.setPressureScale("2");
>> -
>> threeDVarZonalMean.setColorScale("0");
>> - } else if
>> (parameterValue.equals("0")) {
>> -
>> threeDVarZonalMean.setPressureScale("0");
>> -
>> threeDVarZonalMean.setColorScale("0");
>> - } else if
>> (parameterValue.equals("4")) {
>> -
>> threeDVarZonalMean.setPressureScale("0");
>> -
>> threeDVarZonalMean.setColorScale("4");
>> - } else if
>> (parameterValue.equals("6")) {
>> -
>> threeDVarZonalMean.setPressureScale("2");
>> -
>> threeDVarZonalMean.setColorScale("4");
>> - }
>> - }
>> - }
>> - if (!press1.isEmpty() &
>>!press2.isEmpty())
>> -
>> threeDVarZonalMean.setPressureRange("" + (Integer.parseInt(press1) /
>> 100)
>> + "," + (Integer.parseInt(press2) / 100));
>> -
>>
>> threeDVarZonalMean.setExecutionPurpose(response.path("purpose").textVa
>> lue());
>> -
>> threeDVarZonalMean.setImage(response.path("plotUrl").textValue());
>> -
>> threeDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
>> - return
>>
>>ok(views.html.climate.threeDVariableZonalMean.render(threeDVarZonalMean))
>>;
>> - }else if
>> (serviceName.equals("Scatter-and-Histogram-Plot-of-Two-Variables")){
>> //"19")){
>> -
>> scatterHistogram.setPressureLevel1("N/A");
>> -
>> scatterHistogram.setPressureLevel2("N/A");
>> - for (int i = 0; i <
>> responseConfigItems.size(); i++) {
>> - String parameterName =
>>
>>responseConfigItems.get(i).path("parameter").path("purpose").textValue();
>> - String parameterValue =
>> responseConfigItems.get(i).path("value").textValue();
>> - if
>> (parameterName.equals("model1")) {
>> -
>> scatterHistogram.setSource1(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("model2")) {
>> -
>> scatterHistogram.setSource2(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("var1")) {
>> -
>> scatterHistogram.setVaribaleName1(parameterValue);
>> -
>> - } else if
>> (parameterName.equals("var2")) {
>> -
>> scatterHistogram.setVaribaleName2(parameterValue);
>> - } else if
>> (parameterName.equals("startT")) {
>> -
>> scatterHistogram.setStartYear(parameterValue);
>> - } else if
>> (parameterName.equals("endT")) {
>> -
>> scatterHistogram.setEndYear(parameterValue);
>> - } else if
>> (parameterName.equals("lon1")) {
>> -
>> scatterHistogram.setStartLon(parameterValue);
>> - } else if
>> (parameterName.equals("lon2")) {
>> -
>> scatterHistogram.setEndLon(parameterValue);
>> - } else if
>> (parameterName.equals("lat1")) {
>> -
>> scatterHistogram.setStartLat(parameterValue);
>> - } else if
>> (parameterName.equals("lat2")) {
>> -
>> scatterHistogram.setEndLat(parameterValue);
>> - } else if
>> (parameterName.equals("nSample")) {
>> -
>> scatterHistogram.setSamples(parameterValue);
>> - }
>> - }
>> -
>>
>> scatterHistogram.setExecutionPurpose(response.path("purpose").textValu
>> e());
>> -
>> scatterHistogram.setImage(response.path("plotUrl").textValue());
>> -
>> scatterHistogram.setDataUrl(response.path("dataUrl").textValue());
>> - return
>>
>>ok(views.html.climate.scatterAndHistogramTwoVariable.render(scatterHistog
>>ram));
>> - }else if
>> (serviceName.equals("Difference-Plot-of-Two-Time-Averaged-Variables")){
>> //"20")){
>> -
>> diffPlotTwoTimeAvg.setPressureLevel1("N/A");
>> -
>> Console.println(diffPlotTwoTimeAvg.getPressureLevel1());
>> -
>> diffPlotTwoTimeAvg.setPressureLevel2("N/A");
>> - for (int i = 0; i < response
>
>
RE: [43/49] incubator-cmda git commit: remove all
Posted by Jia Zhang <ji...@sv.cmu.edu>.
Dear James:
Would you please clarify a little?
Thanks a lot.
Best regards,
Jia
-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com]
Sent: Tuesday, September 08, 2015 3:46 PM
To: dev@cmda.incubator.apache.org
Subject: Re: [43/49] incubator-cmda git commit: remove all
Can we turn these notifications off?
On Tue, Sep 8, 2015 at 6:44 PM <xi...@apache.org> wrote:
>
> http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/ap
> p/controllers/ClimateServiceController.java
> ----------------------------------------------------------------------
> diff --git a/app/controllers/ClimateServiceController.java
> b/app/controllers/ClimateServiceController.java
> deleted file mode 100644
> index 2c6aa1c..0000000
> --- a/app/controllers/ClimateServiceController.java
> +++ /dev/null
> @@ -1,931 +0,0 @@
> -/*
> - * Licensed to the Apache Software Foundation (ASF) under one or more
> - * contributor license agreements. See the NOTICE file distributed
> with
> - * this work for additional information regarding copyright ownership.
> - * The ASF licenses this file to You under the Apache License,
> Version 2.0
> - * (the "License"); you may not use this file except in compliance
> with
> - * the License. You may obtain a copy of the License at
> - *
> - * http://www.apache.org/licenses/LICENSE-2.0
> - *
> - * Unless required by applicable law or agreed to in writing,
> software
> - * distributed under the License is distributed on an "AS IS" BASIS,
> - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> - * See the License for the specific language governing permissions
> and
> - * limitations under the License.
> - */
> -
> -package controllers;
> -
> -import com.fasterxml.jackson.databind.JsonNode;
> -import com.fasterxml.jackson.databind.node.ObjectNode;
> -import models.metadata.ClimateService; -import
> models.metadata.DiffPlotTwoTimeAveragedVar;
> -import models.metadata.RegridAndDownload;
> -import models.metadata.TwoDVarZonalMean; -import
> models.metadata.TwoDVarMap; -import models.metadata.TwoDVarTimeSeries;
> -import models.metadata.ThreeDVarZonalMean;
> -import models.metadata.ThreeDVar2DSlice; -import
> models.metadata.ThreeDVarAvgVertical4Profile;
> -import models.metadata.ScatterHistogramTwoVar;
> -import models.metadata.ConditionalSampling;
> -import models.metadata.ServiceLog;
> -import models.metadata.CorrelationMap; -import
> models.metadata.ConditionalSampling2Var;
> -import play.Logger;
> -import play.data.Form;
> -import play.libs.Json;
> -import play.mvc.Controller;
> -import play.mvc.Result;
> -import scala.Console;
> -import util.APICall;
> -import util.APICall.ResponseType;
> -import util.Constants;
> -import views.html.climate.*;
> -import play.data.DynamicForm;
> -import java.io.File;
> -import java.io.IOException;
> -import java.io.UnsupportedEncodingException;
> -import java.text.DateFormat;
> -import java.text.SimpleDateFormat;
> -import java.util.Date;
> -import java.util.List;
> -import com.fasterxml.jackson.databind.ObjectMapper;
> -
> -public class ClimateServiceController extends Controller {
> -
> - final static Form<ClimateService> climateServiceForm = Form
> - .form(ClimateService.class);
> -
> - public static Result home(String email, String vfile, String
> dataset) {
> - return ok(home.render(email, vfile, dataset));
> - }
> -
> - public static Result addClimateServices() {
> - return ok(addClimateServices.render(climateServiceForm));
> - }
> -
> - public static Result tutorial() {
> - return ok(tutorial.render());
> - }
> -
> - public static Result climateServices() {
> - return ok(climateServices.render(ClimateService.all(),
> - climateServiceForm));
> - }
> -
> - public static Result mostRecentlyAddedClimateServices() {
> - return
> ok(mostRecentlyAddedServices.render(ClimateService.getMostRecentlyAdded(),
> - climateServiceForm));
> - }
> -
> - public static Result mostRecentlyUsedClimateServices() {
> - return
> ok(mostRecentlyUsedServices.render(ClimateService.getMostRecentlyUsed(),
> - climateServiceForm));
> - }
> -
> - public static Result mostPopularClimateServices() {
> - return
> ok(mostPopularServices.render(ClimateService.getMostPopular(),
> - climateServiceForm));
> - }
> -
> - public static Result newClimateService() {
> - Form<ClimateService> dc =
> climateServiceForm.bindFromRequest();
> - ObjectNode jsonData = Json.newObject();
> - try {
> -
> - String originalClimateServiceName =
> dc.field("Name").value();
> - String newClimateServiceName =
> originalClimateServiceName.replace(' ', '-');
> -
> - if (newClimateServiceName != null &&
> !newClimateServiceName.isEmpty()) {
> - jsonData.put("name",
> newClimateServiceName);
> - }
> -
> - jsonData.put("creatorId", 1);
> - jsonData.put("purpose",
> dc.field("Purpose").value());
> - jsonData.put("url", dc.field("Url").value());
> - DateFormat dateFormat = new
> SimpleDateFormat("yyyy/MM/dd HH:mm");
> - Date date = new Date();
> - jsonData.put("createTime",
> dateFormat.format(date));
> - jsonData.put("scenario",
> dc.field("Scenario").value());
> - jsonData.put("versionNo",
> dc.field("Version").value());
> - jsonData.put("rootServiceId",
> dc.field("Root_Service").value());
> - JsonNode response =
> ClimateService.create(jsonData);
> - Application.flashMsg(response);
> - } catch (IllegalStateException e) {
> - e.printStackTrace();
> - Application.flashMsg(APICall
> -
> .createResponse(ResponseType.CONVERSIONERROR));
> - } catch (Exception e) {
> - e.printStackTrace();
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - }
> - return redirect("/climate/climateServices");
> - }
> -
> - public static Result editClimateService() {
> -
> - ObjectNode jsonData = Json.newObject();
> - try {
> - DynamicForm df =
> DynamicForm.form().bindFromRequest();
> - String climateServiceName = df.field("pk").value();
> -
> - if (climateServiceName != null &&
> !climateServiceName.isEmpty()) {
> - jsonData.put("name", climateServiceName);
> - }
> - ClimateService originalService =
> ClimateService.findServiceByName(climateServiceName);
> -
> - if (originalService == null) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("not found original
> climateService " + climateServiceName);
> - }
> -
> - jsonData.put("creatorId", 1);
> - jsonData.put("purpose",
> originalService.getPurpose());
> - jsonData.put("url", originalService.getUrl());
> - jsonData.put("scenario",
> originalService.getScenario());
> - jsonData.put("versionNo",
> originalService.getVersion());
> -
> - if (originalService.getRootservice() != null)
> -
> - jsonData.put("rootServiceId",
> originalService.getRootservice());
> - String editField = df.field("name").value();
> -
> - if (editField != null && !editField.isEmpty()) {
> - jsonData.put(editField,
> df.field("value").value());
> - }
> -
> - if (editField == null || editField.isEmpty()) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("not found edit field");
> - }
> -
> - JsonNode response =
> ClimateService.edit(climateServiceName, jsonData);
> - Application.flashMsg(response);
> -
> - } catch (IllegalStateException e) {
> - e.printStackTrace();
> - Application.flashMsg(APICall
> -
> .createResponse(ResponseType.CONVERSIONERROR));
> - } catch (Exception e) {
> - e.printStackTrace();
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - }
> - return ok("updated");
> -
> - }
> -
> - public static Result getConfigurationByConfId() {
> - String output = "";
> - TwoDVarMap twoDVarMap = new TwoDVarMap();
> - TwoDVarZonalMean twoDVarZonalMean = new TwoDVarZonalMean();
> - ScatterHistogramTwoVar scatterHistogram = new
> ScatterHistogramTwoVar();
> - ThreeDVarAvgVertical4Profile threeDVarAvgVertical = new
> ThreeDVarAvgVertical4Profile();
> - DiffPlotTwoTimeAveragedVar diffPlotTwoTimeAvg = new
> DiffPlotTwoTimeAveragedVar();
> - ThreeDVar2DSlice threeDVar2DSlice = new ThreeDVar2DSlice();
> - TwoDVarTimeSeries twoDVarTimeSeries = new
> TwoDVarTimeSeries();
> - ThreeDVarZonalMean threeDVarZonalMean = new
> ThreeDVarZonalMean();
> - ConditionalSampling conditionalSampling = new
> ConditionalSampling();
> - RegridAndDownload regridAndDownload = new
> RegridAndDownload();
> - CorrelationMap correlationMap = new CorrelationMap();
> - ConditionalSampling2Var conditionalSampling2Var = new
> ConditionalSampling2Var();
> -
> - try {
> - DynamicForm df =
> DynamicForm.form().bindFromRequest();
> - String logId = df.field("logId").value();
> -
> - if (logId == null || logId.isEmpty()) {
> -
> Application.flashMsg(APICall.createResponse(ResponseType.UNKNOWN));
> - return notFound("confId is null or empty");
> - }
> -
> - JsonNode response =
> APICall.callAPI(Constants.NEW_BACKEND +
> Constants.SERVICE_EXECUTION_LOG + Constants.SERVICE_EXECUTION_LOG_GET + logId);
> - int configurationId =
> response.path("serviceConfiguration").path("id").asInt();
> - JsonNode responseConfigItems =
> APICall.callAPI(Constants.NEW_BACKEND + Constants.CONFIG_ITEM +
> Constants.GET_CONFIG_ITEMS_BY_CONFIG + configurationId);
> - String serviceName =
> response.path("climateService").path("name").asText();
> - //TODO:
> - if (serviceName.equals("2-D-Variable-Zonal-Mean"))
> {
> - //TODO: DO NOT USE
> node.findPath(key)!!!!! use find(key) instead to get your immediate
> children if you know the json structure (and we do).
> - //TODO: (con't) findPath returns the first
> occurence of a key string, including GRANDCHILDREN
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> -
> - if (parameterName.equals("data
> source")) {
> -
> twoDVarZonalMean.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("variable name")) {
> -
> twoDVarZonalMean.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("start year-month")) {
> -
> twoDVarZonalMean.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("end year-month")) {
> -
> twoDVarZonalMean.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("select months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> twoDVarZonalMean.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> twoDVarZonalMean.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> twoDVarZonalMean.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> twoDVarZonalMean.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> twoDVarZonalMean.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> twoDVarZonalMean.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> twoDVarZonalMean.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> twoDVarZonalMean.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> twoDVarZonalMean.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> twoDVarZonalMean.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> twoDVarZonalMean.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> twoDVarZonalMean.addMonth("dec");
> - }
> - }
> -
> twoDVarZonalMean.changeSelectMonths();
> - } else if
> (parameterName.equals("start lat (deg)")) {
> -
> twoDVarZonalMean.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("end lat (deg)")) {
> -
> twoDVarZonalMean.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("variable scale")) {
> -
> twoDVarZonalMean.setVariableScale(parameterValue);
> - }
> - }
> -
>
> twoDVarZonalMean.setExecutionPurpose(response.path("purpose").textValu
> e());
> -
> twoDVarZonalMean.setImage(response.path("plotUrl").textValue());
> -
> twoDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableZonelMean.render(twoDVarZonalMean));
> - }
> - else if (serviceName.equals("2-D-Variable-Map")) {
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> twoDVarMap.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> twoDVarMap.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> twoDVarMap.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> twoDVarMap.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> twoDVarMap.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> twoDVarMap.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> twoDVarMap.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> twoDVarMap.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> twoDVarMap.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> twoDVarMap.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> twoDVarMap.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> twoDVarMap.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> twoDVarMap.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> twoDVarMap.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> twoDVarMap.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> twoDVarMap.addMonth("dec");
> - }
> - }
> -
> twoDVarMap.changeSelectMonths();
> - } else if
> (parameterName.equals("lat1")) {
> -
> twoDVarMap.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> twoDVarMap.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> twoDVarMap.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> twoDVarMap.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("scale")) {
> -
> twoDVarMap.setVariableScale(parameterValue);
> - }
> - }
> -
> twoDVarMap.setExecutionPurpose(response.path("purpose").textValue());
> -
> twoDVarMap.setImage(response.path("plotUrl").textValue());
> -
> twoDVarMap.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableMap.render(twoDVarMap));
> - }
> - else if
> (serviceName.equals("Conditional-Sampling-with-One-Variable")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if
> (parameterName.equals("model2")) {
> -
> conditionalSampling.setDataSourceE(parameterValue);
> - } else if
> (parameterName.equals("model1")) {
> -
> conditionalSampling.setDataSourceP(parameterValue);
> - } else if
> (parameterName.equals("var2")) {
> -
> conditionalSampling.setVariableNameE(parameterValue);
> - } else if
> (parameterName.equals("var1")) {
> -
> conditionalSampling.setVariableNameP(parameterValue);
> - } else if
> (parameterName.equals("pre1")) {
> -
> conditionalSampling.setPressureRangeP(parameterValue);
> - } else if
> (parameterName.equals("pre2")) {
> -
> conditionalSampling.setPressureRangeE(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> conditionalSampling.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> conditionalSampling.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> conditionalSampling.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> conditionalSampling.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> conditionalSampling.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> conditionalSampling.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> conditionalSampling.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> conditionalSampling.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> conditionalSampling.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> conditionalSampling.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> conditionalSampling.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> conditionalSampling.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> conditionalSampling.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> conditionalSampling.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> conditionalSampling.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> conditionalSampling.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> conditionalSampling.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> conditionalSampling.addMonth("dec");
> - }
> -
> - }
> -
> conditionalSampling.changeSelectMonths();
> - } else if
> (parameterName.equals("bin_min")) {
> -
> conditionalSampling.setBin_min(parameterValue);
> - } else if
> (parameterName.equals("bin_max")) {
> -
> conditionalSampling.setBin_max(parameterValue);
> - } else if
> (parameterName.equals("bin_n")) {
> -
> conditionalSampling.setBin_n(parameterValue);
> - } else if
> (parameterName.equals("displayOpt")) {
> - int
> paramBit=Integer.parseInt(parameterValue);
> - int bitmaskX = 0x1;
> - int bitmaskY = 0x2;
> - int bitmaskZ = 0x4;
> -
> conditionalSampling.setX(Integer.toString(paramBit & bitmaskX, 2));
> -
> conditionalSampling.setY(Integer.toString((paramBit & bitmaskY)>>1,
> 2));
> -
> conditionalSampling.setZ(Integer.toString((paramBit & bitmaskZ)>>2, 2));
> - }
> - }
> -
>
> conditionalSampling.setExecutionPurpose(response.path("purpose").textV
> alue());
> -
> conditionalSampling.setImage(response.path("plotUrl").textValue());
> -
> conditionalSampling.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.conditionalSampling.render(conditionalSampling));
> - }else if
> (serviceName.equals("2-D-Variable-Time-Series")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> twoDVarTimeSeries.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> twoDVarTimeSeries.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> twoDVarTimeSeries.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> twoDVarTimeSeries.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> twoDVarTimeSeries.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> twoDVarTimeSeries.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> twoDVarTimeSeries.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> twoDVarTimeSeries.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("scale")) {
> -
> twoDVarTimeSeries.setVariableScale(parameterValue);
> - }
> - }
> -
>
> twoDVarTimeSeries.setExecutionPurpose(response.path("purpose").textVal
> ue());
> -
> twoDVarTimeSeries.setImage(response.path("plotUrl").textValue());
> -
> twoDVarTimeSeries.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.twoDVariableTimeSeries.render(twoDVarTimeSeries));
> - }else if
> (serviceName.equals("Regrid-and-Download")){
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> regridAndDownload.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> regridAndDownload.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> regridAndDownload.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> regridAndDownload.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> regridAndDownload.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> regridAndDownload.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("dlat")) {
> -
> regridAndDownload.setDeltaLat(parameterValue);
> - } else if
> (parameterName.equals("dlon")) {
> -
> regridAndDownload.setDeltaLon(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> regridAndDownload.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> regridAndDownload.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("plev")) {
> -
> regridAndDownload.setPressureLevel(parameterValue);
> - }
> - }
> -
>
> regridAndDownload.setExecutionPurpose(response.path("purpose").textVal
> ue());
> -
> -
> regridAndDownload.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.regridAndDownload.render(regridAndDownload));
> - }else if
> (serviceName.equals("3-D-Variable-Zonal-Mean")){
> - String press1 = "";
> - String press2 = "";
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if (parameterName.equals("model"))
> {
> -
> threeDVarZonalMean.setDataSource(parameterValue);
> - } else if
> (parameterName.equals("var")) {
> -
> threeDVarZonalMean.setVariableName(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> threeDVarZonalMean.setStartYearMonth(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> threeDVarZonalMean.setEndYearMonth(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> threeDVarZonalMean.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> threeDVarZonalMean.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("pres1")) {
> - press1 = parameterValue;
> - } else if
> (parameterName.equals("pres2")) {
> - press2 = parameterValue;
> - } else if
> (parameterName.equals("months")) {
> - String[] months =
> parameterValue.split(",");
> - for (int j = 0; j <
> months.length; j++) {
> - if
> (months[j].equals("1")) {
> -
> threeDVarZonalMean.addMonth("jan");
> - } else if
> (months[j].equals("2")) {
> -
> threeDVarZonalMean.addMonth("feb");
> - } else if
> (months[j].equals("3")) {
> -
> threeDVarZonalMean.addMonth("mar");
> - } else if
> (months[j].equals("4")) {
> -
> threeDVarZonalMean.addMonth("apr");
> - } else if
> (months[j].equals("5")) {
> -
> threeDVarZonalMean.addMonth("may");
> - } else if
> (months[j].equals("6")) {
> -
> threeDVarZonalMean.addMonth("jun");
> - } else if
> (months[j].equals("7")) {
> -
> threeDVarZonalMean.addMonth("jul");
> - } else if
> (months[j].equals("8")) {
> -
> threeDVarZonalMean.addMonth("aug");
> - } else if
> (months[j].equals("9")) {
> -
> threeDVarZonalMean.addMonth("sep");
> - } else if
> (months[j].equals("10")) {
> -
> threeDVarZonalMean.addMonth("oct");
> - } else if
> (months[j].equals("11")) {
> -
> threeDVarZonalMean.addMonth("nov");
> - } else if
> (months[j].equals("12")) {
> -
> threeDVarZonalMean.addMonth("dec");
> - }
> - }
> - } else if
> (parameterName.equals("scale")) {
> - if
> (parameterValue.equals("2")) {
> -
> threeDVarZonalMean.setPressureScale("2");
> -
> threeDVarZonalMean.setColorScale("0");
> - } else if
> (parameterValue.equals("0")) {
> -
> threeDVarZonalMean.setPressureScale("0");
> -
> threeDVarZonalMean.setColorScale("0");
> - } else if
> (parameterValue.equals("4")) {
> -
> threeDVarZonalMean.setPressureScale("0");
> -
> threeDVarZonalMean.setColorScale("4");
> - } else if
> (parameterValue.equals("6")) {
> -
> threeDVarZonalMean.setPressureScale("2");
> -
> threeDVarZonalMean.setColorScale("4");
> - }
> - }
> - }
> - if (!press1.isEmpty() & !press2.isEmpty())
> -
> threeDVarZonalMean.setPressureRange("" + (Integer.parseInt(press1) /
> 100)
> + "," + (Integer.parseInt(press2) / 100));
> -
>
> threeDVarZonalMean.setExecutionPurpose(response.path("purpose").textVa
> lue());
> -
> threeDVarZonalMean.setImage(response.path("plotUrl").textValue());
> -
> threeDVarZonalMean.setDataURL(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.threeDVariableZonalMean.render(threeDVarZonalMean));
> - }else if
> (serviceName.equals("Scatter-and-Histogram-Plot-of-Two-Variables")){
> //"19")){
> -
> scatterHistogram.setPressureLevel1("N/A");
> -
> scatterHistogram.setPressureLevel2("N/A");
> - for (int i = 0; i <
> responseConfigItems.size(); i++) {
> - String parameterName =
> responseConfigItems.get(i).path("parameter").path("purpose").textValue();
> - String parameterValue =
> responseConfigItems.get(i).path("value").textValue();
> - if
> (parameterName.equals("model1")) {
> -
> scatterHistogram.setSource1(parameterValue);
> -
> - } else if
> (parameterName.equals("model2")) {
> -
> scatterHistogram.setSource2(parameterValue);
> -
> - } else if
> (parameterName.equals("var1")) {
> -
> scatterHistogram.setVaribaleName1(parameterValue);
> -
> - } else if
> (parameterName.equals("var2")) {
> -
> scatterHistogram.setVaribaleName2(parameterValue);
> - } else if
> (parameterName.equals("startT")) {
> -
> scatterHistogram.setStartYear(parameterValue);
> - } else if
> (parameterName.equals("endT")) {
> -
> scatterHistogram.setEndYear(parameterValue);
> - } else if
> (parameterName.equals("lon1")) {
> -
> scatterHistogram.setStartLon(parameterValue);
> - } else if
> (parameterName.equals("lon2")) {
> -
> scatterHistogram.setEndLon(parameterValue);
> - } else if
> (parameterName.equals("lat1")) {
> -
> scatterHistogram.setStartLat(parameterValue);
> - } else if
> (parameterName.equals("lat2")) {
> -
> scatterHistogram.setEndLat(parameterValue);
> - } else if
> (parameterName.equals("nSample")) {
> -
> scatterHistogram.setSamples(parameterValue);
> - }
> - }
> -
>
> scatterHistogram.setExecutionPurpose(response.path("purpose").textValu
> e());
> -
> scatterHistogram.setImage(response.path("plotUrl").textValue());
> -
> scatterHistogram.setDataUrl(response.path("dataUrl").textValue());
> - return
> ok(views.html.climate.scatterAndHistogramTwoVariable.render(scatterHistogram));
> - }else if
> (serviceName.equals("Difference-Plot-of-Two-Time-Averaged-Variables")){
> //"20")){
> -
> diffPlotTwoTimeAvg.setPressureLevel1("N/A");
> -
> Console.println(diffPlotTwoTimeAvg.getPressureLevel1());
> -
> diffPlotTwoTimeAvg.setPressureLevel2("N/A");
> - for (int i = 0; i < response