Get weather station data set from data holder.

@param data The experiment data holder
@return The weather station data set
499979
protected static HashMap getWthData(HashMap data) {
        if (data.containsKey("weather")) {
            return getObjectOr(data, "weather", new HashMap());
        } else {
            return data;
        }
    }
289017
public static INDArray buildFromData(List<DataPoint> data) {
        INDArray ret = Nd4j.create(data.size(), data.get(0).getD());
        for (int i = 0; i < ret.slices(); i++)
            ret.putSlice(i, data.get(i).getPoint());
        return ret;
    }
830205
public final void setData(@Nullable Data<?> data) {
        setDatas(data != null ? singleton(data) : Collections.<Data<?>>emptyList());
    }
925737
protected synchronized String getWthFileName(Map data) {

//        String agmipFileHack = getValueOr(wthFile, "wst_name", "");
//        if (agmipFileHack.length() == 8) {
//            return agmipFileHack;
//        }
        String ret = getObjectOr(data, "wst_id", "");
        if (ret.equals("") || ret.length() > 8) {
            ret = wthHelper.createWthFileName(getObjectOr(data, "weather", data));
            if (ret.equals("")) {
                ret = "AGMP";
            }
        }

        return ret;
    }
770114
public T updateData(String name, T data) {
        Node<T> node = root.getNode(name);
        T old = null;
        if (node != null) {
            old = node.setData(data);
        }
        return old;
    }
283352
public INDArray project(INDArray data){
        long[] tShape = targetShape(data.shape(), eps, components, autoMode);
        return data.mmul(getProjectionMatrix(tShape, this.rng));
    }
685024
@SneakyThrows
   public static Map<String, Val> loads(String data) {
      Map<String, Val> r = new HashMap<>();
      try (JsonReader reader = new JsonReader(new StringResource(data))) {
         reader.beginDocument();
         while (reader.peek() != JsonTokenType.END_DOCUMENT) {
            String name = reader.peekName();
            switch (reader.peek()) {
               case BEGIN_OBJECT:
                  r.put(name, Val.of(reader.nextMap()));
                  break;
               case BEGIN_ARRAY:
                  r.put(name, Val.of(reader.nextCollection(ArrayList::new)));
                  break;
               case NAME:
                  r.put(name, reader.nextKeyValue(name));
                  break;
               default:
                  reader.skip();
            }
         }
         reader.endDocument();
      }
      return r;
   }
259566
public static HashMap<String, ArrayList<String>> getEto(HashMap data) {
        HashMap<String, ArrayList<String>> results = new HashMap<String, ArrayList<String>>();
        HashMap wthData = getWthData(data);
        ArrayList<HashMap<String, String>> dailyArr = getDailyData(data);

        // Step 1. Atmospheric pressure (P) [kPa]
        String wst_elev = getValueOr(wthData, "wst_elev", "");
        if (wst_elev.equals("")) {
            return results;
        }
        String P = multiply("101.3", pow(divide(substract("293", product("0.0065", wst_elev)), "293"), "5.26"));

        // Step 2. Psychrometric constant (γ)
        String gamma = product("0.664742", "0.001", P);

        // Eq.17 (Step 8)
        // latitude [rad]
        String wst_lat = getValueOr(wthData, "wst_lat", "");
        String phi = divide(product(wst_lat, Math.PI + ""), "180");

        // Get other potentially necessary meta data from Ace data set
        String psyvnt = getValueOr(wthData, "psyvnt", "").trim();
        String aPsy = "";
        if (psyvnt.equals("Forced")) {
            aPsy = "0.000662";
        } else if (psyvnt.equals("Natural")) {
            aPsy = "0.00800";
        }
        String rPsy = multiply(aPsy, P);
        String amth = getValueOr(wthData, "amth", "0.25");
        String bmth = getValueOr(wthData, "bmth", "0.50");

        // Calculate daily ETO
        ArrayList<String> etoArr = new ArrayList<String>();
        for (int i = 0; i < dailyArr.size(); i++) {
            HashMap<String, String> dailyData = dailyArr.get(i);

            // Get daily TMAX and TMIN
            String tMin = getValueOr(dailyData, "tmin", "").trim();
            String tMax = getValueOr(dailyData, "tmax", "").trim();
            if (tMin.equals("") || tMax.equals("")) {
                etoArr.add(null);
                continue;
            }

            // Step 3. Mean air temperature (Tmean) [°C]
            String tMean = average(tMin, tMax);

            // Step 4. Saturation vapour pressure (es)
            String e_tMax = multiply("0.6108", exp(divide(multiply("17.27", tMax), sum(tMax, "237.3"))));
            String e_tMin = multiply("0.6108", exp(divide(multiply("17.27", tMin), sum(tMin, "237.3"))));
            String es = average(e_tMax, e_tMin);

            // Step 5. Slope of the saturation vapour pressure curve (Δ)
            String slope = divide(product("4098", "0.6108", exp(divide(multiply("17.27", tMean), sum(tMean, "237.3")))), pow(sum(tMean, "237.3"), "2"));

            // Step 6. Actual vapour pressure (ea) [kPa]
            String ea;
            String alt1;
            String alt2;
            // Method 1 IF VPRSD is available in the ACE data base
            if (!(alt1 = getValueOr(dailyData, "vprsd", "").trim()).equals("")) {
                // ea = VPRSD
                ea = alt1;

            } // Method 2 IF TDEW is available in the ACE data base
            else if (!(alt1 = getValueOr(dailyData, "tdew", "").trim()).equals("")) {
                // derive ea from the given dew point temperature
                ea = multiply("0.6108", exp(divide(multiply("17.27", alt1), sum(alt1, "237.3"))));

            } // Method 3 IF RHMND and RHMXD are available in the ACE data base
            else if (!(alt1 = getValueOr(dailyData, "rhmxd", "").trim()).equals("")
                    && !(alt2 = getValueOr(dailyData, "rhmnd", getValueOr(dailyData, "rhumd", "")).trim()).equals("")) {
                // ea from the given maximum and minimum Relative Humidity
                ea = average(product(e_tMin, alt1, "0.01"), product(e_tMax, alt2, "0.01"));

            } // Method 4 IF TDRY, TWET and PSYVNT are available in the ACE data base
            else if (!(alt1 = getValueOr(dailyData, "tdry", "").trim()).equals("")
                    && !(alt2 = getValueOr(dailyData, "twet", "").trim()).equals("")
                    && rPsy != null) {
                // derive ea from the psychrometric data
                String e_tWet = multiply("0.6108", exp(divide(multiply("17.27", alt2), sum(alt2, "237.3"))));
                ea = substract(e_tWet, multiply(rPsy, substract(alt1, alt2)));

            } // Method 5 use Tmin as an approximation of Tdew
            else {
                ea = e_tMin;
            }

            // Step 7. Vapour pressure difference (es - ea)
            String vpDiff = substract(es, ea);

            // Step 8. Extra terrestrial radiation (Ra) and daylight hours (N)
            Date w_date = convertFromAgmipDateString(getValueOr(dailyData, "w_date", ""));
            if (w_date == null) {
                etoArr.add(null);
                continue;
            }
            Calendar cal = Calendar.getInstance();
            cal.setTime((w_date));
            String J = cal.get(Calendar.DAY_OF_YEAR) + "";
            String dr = sum("1", multiply("0.033", cos(product("2", divide(Math.PI + "", "365"), J))));
            String delta = multiply("0.409", sin(substract(product("2", divide(Math.PI + "", "365"), J), "1.39")));
            String omegas = acos(product("-1", tan(phi), tan(delta)));
            String ra = divide(product("1440", "0.0820", dr, sum(product(omegas, sin(phi), sin(delta)), product(cos(phi), cos(delta), sin(omegas)))), Math.PI + ""); // TODO
            String N = divide(multiply("24", omegas), Math.PI + "");

            // Step 9. Solar radiation (Rs)
            String rs;
            // Method 1. IF SRAD is available in the ACE data base
            if (!(alt1 = getValueOr(dailyData, "srad", "").trim()).equals("")) {
                rs = alt1;
            } // Method 2. IF SUNH is available in the ACE data base
            else if (!(alt1 = getValueOr(dailyData, "sunh", "").trim()).equals("")) {
                rs = multiply(sum(amth, divide(multiply(bmth, alt1), N)), ra);
            } // Method 3. LSE use Tmin and Tmax to estimate Rs by means of the Hargreaves equation
            else {
                rs = product(getKrsValue(wthData), sqrt(substract(tMax, tMin)), ra);
            }

            // Step 10. Clear-Sky solar radiation (Rso)
            String rso = multiply(sum("0.75", product("2e-5", wst_elev)), ra);

            // Step 11. Net solar radiation (Rns)
            String rns = multiply(substract("1", "0.23"), rs);

            // Step 12. Net long wave  radiation (Rnl)
            String rnl = product("4.903e-9",
                    average(pow(sum(tMax, "273.16"), "4"), pow(sum(tMin, "273.16"), "4")),
                    substract("0.34", multiply("0.14", sqrt(ea))),
                    substract(divide(multiply("1.35", rs), rso), "0.35"));

            // Step 13. Net radiation (Rn)
            String rn = substract(rns, rnl);

            // Step 14. Wind speed at 2 meter above ground level (u2)
            // Method 1. WIND is given in the ACE data base
            String u2;
            if (!(alt1 = getValueOr(dailyData, "wind", "").trim()).equals("")) {
                String uz = divide(multiply("1000", alt1), "86400", 4);
                // CASE 1. Reference height for wind speed measurement (WNDHT)  is 2 meter
                if (compare(alt2 = getValueOr(wthData, "wndht", "").trim(), "2", CompareMode.EQUAL)) {
                    u2 = uz;
                } // CASE 2. Reference height for wind speed measurement (WNDHT)  is NOT 2 meter
                else {
                    u2 = divide(multiply(uz, "4.87"), log(substract(multiply("67.8", alt2), "5.42")));
                }
            } else {
                u2 = "2";
            }

            // Step 15. Reference evapotranspiration (ETo)
            String eto = divide(
                    sum(product("0.408", slope, rn), divide(product(gamma, "900", u2, vpDiff), sum(tMean, "273"))),
                    sum(slope, multiply(gamma, sum("1", multiply("0.34", u2)))));
            etoArr.add(round(eto, 2));
        }
        results.put("eto", etoArr);
        return results;
    }
1181437
function(data) {
        this.features = [];
        this.styles   = {};
        this.fetched  = {};

        // Set default options 
        var options = {
            depth: 0,
            styleBaseUrl: this.styleBaseUrl
        };

        return this.parseData(data, options);
    }
545542
public static DataSet copyOf(DataSet data) {
    if (data == null) {
      throw new InvalidOperationException("Null data set");
    }
    DataSet r = new DataSet(data.getSource());
    r.getRows().addAll(data.getRows());
    return r;
  }
68968
public Data getData() {
        if (data == null) {
            JSONObject o = getJSONObject();
            if (o != null) {
                data = new Data(o);
            }
        }
        return data;
    }
333567
public static final String getString(byte[] data, int offset)
   {
      return getString(data, offset, data.length - offset);
   }
448347
@Override
    public void fit(org.nd4j.linalg.dataset.api.DataSet data) {
        fit(data.getFeatures(), data.getLabels(), data.getFeaturesMaskArray(), data.getLabelsMaskArray());
    }
1204128
public Object getResult(AverageData data) {
        return data.count == 0 ? null : data.total / data.count;
    }
1241350
def get_weather(self):
        
        import predix.data.weather
        weather = predix.data.weather.WeatherForecast()
        return weather
521935
protected Data init(Data data) {
	if (JSON_ARRAY == null) JSON_ARRAY = getFLF(data, "_literalArray");
	if (JSON_STRUCT == null) JSON_STRUCT = getFLF(data, "_literalStruct");
	if (GET_STATIC_SCOPE == null) GET_STATIC_SCOPE = getFLF(data, "_getStaticScope");
	if (GET_SUPER_STATIC_SCOPE == null) GET_SUPER_STATIC_SCOPE = getFLF(data, "_getSuperStaticScope");
	return data;
    }
882999
public Object deserialize(String data) {
		if ((data == null) || (data.length() == 0)) {
			return null;
		}
		ObjectInputStream ois = null;
		ByteArrayInputStream bis = null;
		try {
			bis = new ByteArrayInputStream(Base64.decodeBase64(data.getBytes()));
			ois = new ObjectInputStream(bis);
			return ois.readObject();
		} catch (ClassNotFoundException e) {
			LOGGER.error("Can't deserialize data from Base64", e);
			throw new IllegalArgumentException(e);
		} catch (IOException e) {
			LOGGER.error("Can't deserialize data from Base64", e);
			throw new IllegalArgumentException(e);
		} catch (Exception e) {
			LOGGER.error("Can't deserialize data from Base64", e);
			throw new IllegalArgumentException(e);
		} finally {
			try {
				if (ois != null) {
					ois.close();
				}
			} catch (Exception e) {
				LOGGER.error("Can't close ObjetInputStream used for deserialize data from Base64", e);
			}
		}
	}