reference height for wind speed
182445
@Execute
    public void penman() {

        checkNull(inPressure, inTemp, inRh, inWind, inSwe, inVegetation, inShortradiation, inNetradiation);

        outEtp = new HashMap<Integer, double[]>();

        DateTime currentTimestamp = formatter.parseDateTime(tCurrent);
        int monthOfYear = currentTimestamp.getMonthOfYear();

        Set<Entry<Integer, double[]>> elevSet = inTemp.entrySet();
        for( Entry<Integer, double[]> entry : elevSet ) {
            Integer basinId = entry.getKey();
            // double elevation = inElevations.get(basinId)[0];
            double tair = entry.getValue()[0];
            double pressure = inPressure.get(basinId)[0];
            double relativeHumidity = inRh.get(basinId)[0];
            double wind = inWind.get(basinId)[0];
            double snowWaterEquivalent = inSwe.get(basinId)[0];
            double shortRadiation = inShortradiation.get(basinId)[0];
            double netRadiation = inNetradiation.get(basinId)[0];

            VegetationLibraryRecord vegetation = inVegetation.get(basinId);
            double displacement = vegetation.getDisplacement(monthOfYear);
            double roughness = vegetation.getRoughness(monthOfYear);
            double rs = vegetation.getMinStomatalResistance();
            double RGL = vegetation.getRgl();
            double lai = vegetation.getLai(monthOfYear);
            double rarc = vegetation.getArchitecturalResistance();

            /*
             * set the pressure in Pascal instead of in hPa as the input link gives 
             */
            pressure = pressure / 100;
            double vpd = svp(tair) - (relativeHumidity * 100 / svp(tair)); // vpd in KPa
            double ra = calcAerodynamic(displacement, roughness, ZREF, wind, snowWaterEquivalent);

            // CONSIDER THE SOIL RESISTANCE NULL
            // // calculate gsm_inv: soil moisture stress factor
            // double criticalSoilMoisture = 0.33; // fraction of soil moisture content at the
            // critical
            // // point
            // double wiltingPointSoilMoisture = 0.133;
            // double waterContentCriticalPoint = criticalSoilMoisture * maxMoisture;
            // double waterContentWiltingPoint = wiltingPointSoilMoisture * maxMoisture;
            // double gsm_inv; // soil moisture stress factor
            // if (soilMoisture >= waterContentCriticalPoint) {
            // gsm_inv = 1.0;
            // } else if (soilMoisture >= waterContentWiltingPoint) {
            // gsm_inv = (soilMoisture - waterContentWiltingPoint) / (waterContentCriticalPoint -
            // waterContentWiltingPoint);
            // } else {
            // gsm_inv = 0.0;
            // }
            /* calculate the slope of the saturated vapor pressure curve in Pa/K */
            double slope = svp_slope(tair) * 1000.0;

            /* factor for canopy resistance based on photosynthesis */
            double dayFactor;
            /* calculate resistance factors (Wigmosta et al., 1994) */
            double f = 0.0;
            if (rs > 0.) {
                if (RGL < 0) {
                    throw new ModelsIllegalargumentException("Invalid value of RGL for the current class.", this, pm);
                } else if (RGL == 0) {
                    f = shortRadiation;
                } else {
                    f = shortRadiation / RGL;
                }
                dayFactor = (1. + f) / (f + rs / RSMAX);
            } else
                dayFactor = 1.;

            /* factor for canopy resistance based on temperature */
            double tFactor = .08 * tair - 0.0016 * tair * tair;
            tFactor = (tFactor <= 0.0) ? 1e-10 : tFactor;

            /* factor for canopy resistance based on vpd */
            double vpdFactor = 1 - vpd / CLOSURE;
            vpdFactor = (vpdFactor < VPDMINFACTOR) ? VPDMINFACTOR : vpdFactor;

            /* calculate canopy resistance in s/m */
            // double rc = rs / (lai * gsm_inv * tFactor * vpdFactor) * dayFactor;
            double rc = rs / (lai * tFactor * vpdFactor) * dayFactor;
            rc = (rc > RSMAX) ? RSMAX : rc;

            // double h; /* scale height in the atmosphere (m) */
            // /* calculate scale height based on average temperature in the column */
            // h = 287 / 9.81 * ((tair + 273.15) + 0.5 * (double) elevation * LAPSE_PM);
            //
            // /* use hypsometric equation to calculate p_z, assume that virtual temperature is
            // equal
            // air_temp */
            // pz = PS_PM * Math.exp(-(double) elevation / h);

            // instead of calculating the pressure in h.adige it is possible to read the
            // interpolated
            // pressure from input link
            // pz is the surface air pressure

            /* calculate latent heat of vaporization. Eq. 4.2.1 in Handbook of Hydrology, assume Ts is Tair */
            double lv = 2501000 - 2361 * tair;

            /* calculate the psychrometric constant gamma (Pa/C). Eq. 4.2.28. Handbook of Hydrology */
            double gamma = 1628.6 * pressure / lv;

            /* calculate factor to be applied to rc/ra */

            /* calculate the air density (in kg/m3), using eq. 4.2.4 Handbook of Hydrology */
            double r_air = 0.003486 * pressure / (275 + tair);

            /* calculate the Penman-Monteith evaporation in mm/day (by not dividing by 
             * the density of water (~1000 kg/m3)), the result ends up being in mm instead of m */
            double evap = ((slope * netRadiation + r_air * CP_PM * vpd / ra) / (lv * (slope + gamma * (1 + (rc + rarc) / ra))) * SEC_PER_DAY) / 24.0;

            if (vpd >= 0.0 && evap < 0.0)
                evap = 0.0;

            outEtp.put(basinId, new double[]{evap});
        }
    }
1008476
def _is_at_ref_end(self, nucmer_hit):
        ''''''
        hit_coords = nucmer_hit.ref_coords()
        return hit_coords.end >= nucmer_hit.ref_length - self.ref_end_tolerance
514674
def wind_shear(shear: str, unit_alt: str = 'ft', unit_wind: str = 'kt') -> str:
    
    unit_alt = SPOKEN_UNITS.get(unit_alt, unit_alt)
    unit_wind = SPOKEN_UNITS.get(unit_wind, unit_wind)
    return translate.wind_shear(shear, unit_alt, unit_wind, spoken=True) or 'Wind shear unknown'
884380
def get_wind_url(self):
        """"""
        wind_direction = self.f_d.get('wind_direction', None)
        if wind_direction is not None:
            rounded = int(5 * round(float(wind_direction)/5))
            return WIND_ARROW_URL.format(rounded)
209927
function (response) {
          document.getElementById("windmillWeather").innerHTML = "<div>Current conditions</div>" + '<img class="icon" src="https://openweathermap.org/img/w/' + response.weather[0].icon + '.png' + '"><span>' + response.weather[0].main + ", Temp: " + response.main.temp + "'c, Wind: " + response.wind.speed + " (m/s)</span>";
        }
385185
public void setHeight(float v) {
    if (DocumentElement_Type.featOkTst && ((DocumentElement_Type)jcasType).casFeat_height == null)
      jcasType.jcas.throwFeatMissing("height", "ch.epfl.bbp.uima.types.DocumentElement");
    jcasType.ll_cas.ll_setFloatValue(addr, ((DocumentElement_Type)jcasType).casFeatCode_height, v);}
74197
private static double calculateHeightDegrees(int n) {
        double a;
        if (n % 2 == 0)
            a = 0;
        else
            a = -0.5;
        double result = 180 / Math.pow(2, 2.5 * n + a);
        return result;
    }
879723
def frustum_height_at_distance(vfov_deg, distance):
    
    height = 2.0 * distance * np.tan(np.radians(vfov_deg * 0.5))
    return height
820827
def get_weather(self, time, max_hour=6):
        """"""
        if self.data is None:
            return {}

        ordered_entries = []
        for time_entry in self.data['product']['time']:
            valid_from = parse_datetime(time_entry['@from'])
            valid_to = parse_datetime(time_entry['@to'])
            if time > valid_to:
                # Has already passed. Never select this.
                continue

            average_dist = (abs((valid_to - time).total_seconds()) +
                            abs((valid_from - time).total_seconds()))

            if average_dist > max_hour * 3600:
                continue

            ordered_entries.append((average_dist, time_entry))

        if not ordered_entries:
            return {}
        ordered_entries.sort(key=lambda item: item[0])
        res = dict()
        res['datetime'] = time
        res['temperature'] = get_data('temperature', ordered_entries)
        res['condition'] = CONDITIONS.get(get_data('symbol', ordered_entries))
        res['pressure'] = get_data('pressure', ordered_entries)
        res['humidity'] = get_data('humidity', ordered_entries)
        res['wind_speed'] = get_data('windSpeed', ordered_entries)
        res['wind_bearing'] = get_data('windDirection', ordered_entries)
        return res
1036866
def node_scale_root_height(self, treeheight=1):
        
        # make tree height = 1 * treeheight
        ctree = self._ttree.copy()
        _height = ctree.treenode.height
        for node in ctree.treenode.traverse():
            node.dist = (node.dist / _height) * treeheight
        ctree._coords.update()
        return ctree
982542
def report_altitude(self, altitude):
        ''''''
        master = self.master
        if getattr(self.console, 'ElevationMap', None) is not None and self.mpstate.settings.basealt != 0:
            lat = master.field('GLOBAL_POSITION_INT', 'lat', 0)*1.0e-7
            lon = master.field('GLOBAL_POSITION_INT', 'lon', 0)*1.0e-7
            alt1 = self.console.ElevationMap.GetElevation(lat, lon)
            if alt1 is not None:
                alt2 = self.mpstate.settings.basealt
                altitude += alt2 - alt1
        self.status.altitude = altitude
        altitude_converted = self.height_convert_units(altitude)
        if (int(self.mpstate.settings.altreadout) > 0 and
            math.fabs(altitude_converted - self.last_altitude_announce) >=
            int(self.settings.altreadout)):
            self.last_altitude_announce = altitude_converted
            rounded_alt = int(self.settings.altreadout) * ((self.settings.altreadout/2 + int(altitude_converted)) / int(self.settings.altreadout))
            self.say("height %u" % rounded_alt, priority='notification')
468033
def height_orifices(self):
        

        return (np.linspace(0, self.n_rows-1, self.n_rows))*self.b_rows + 0.5 * self.orifice_diameter
1342753
def height(self):
        """"""
        alloc_h = self.alloc_h

        if self.parent and isinstance(self.parent, graphics.Scene):
            alloc_h = self.parent.height

        min_height = (self.min_height or 0) + self.margin_top + self.margin_bottom
        h = alloc_h if alloc_h is not None and self.fill else min_height
        h = max(h or 0, self.get_min_size()[1])
        return h - self.margin_top - self.margin_bottom
640614
function checkHeightAuto() {
                    originalValues.height = parseFloat(Velocity.CSS.getPropertyValue(element, "height"));

                    /* Determine if height was originally "auto" by checking if the computed "auto" value is identical to the original value. */
                    element.style.height = "auto";
                    if (parseFloat(Velocity.CSS.getPropertyValue(element, "height")) === originalValues.height) {
                        isHeightAuto = true;
                    }

                    /* Revert to the computed value before sliding begins to prevent vertical popping due to scrollbars. */
                    Velocity.CSS.setPropertyValue(element, "height", originalValues.height + "px");
                }
643705
function(measurement) {
    const unitDefinitions = this.options.units;

    return {
      lengthDisplay: buildDisplay(
        measurement.length,
        this.options.primaryLengthUnit,
        this.options.secondaryLengthUnit,
        this.options.decPoint,
        this.options.thousandsSep
      ),
      areaDisplay: buildDisplay(
        measurement.area,
        this.options.primaryAreaUnit,
        this.options.secondaryAreaUnit,
        this.options.decPoint,
        this.options.thousandsSep
      )
    };

    function buildDisplay(val, primaryUnit, secondaryUnit, decPoint, thousandsSep) {
      if (primaryUnit && unitDefinitions[primaryUnit]) {
        let display = formatMeasure(val, unitDefinitions[primaryUnit], decPoint, thousandsSep);
        if (secondaryUnit && unitDefinitions[secondaryUnit]) {
          const formatted = formatMeasure(
            val,
            unitDefinitions[secondaryUnit],
            decPoint,
            thousandsSep
          );
          display = `${display} (${formatted})`;
        }
        return display;
      }
      return formatMeasure(val, null, decPoint, thousandsSep);
    }

    function formatMeasure(val, unit, decPoint, thousandsSep) {
      const unitDisplays = {
        acres: __('acres'),
        feet: __('feet'),
        kilometers: __('kilometers'),
        hectares: __('hectares'),
        meters: __('meters'),
        miles: __('miles'),
        sqfeet: __('sqfeet'),
        sqmeters: __('sqmeters'),
        sqmiles: __('sqmiles')
      };

      const u = L.extend({ factor: 1, decimals: 0 }, unit);
      const formattedNumber = numberFormat(
        val * u.factor,
        u.decimals,
        decPoint || __('decPoint'),
        thousandsSep || __('thousandsSep')
      );
      const label = unitDisplays[u.display] || u.display;
      return [formattedNumber, label].join(' ');
    }
  }
586688
def LaplaceCentreWeight(self):
        """"""

        sz = [1,] * self.S.ndim
        for ax in self.axes:
            sz[ax] = self.S.shape[ax]
        lcw = 2*len(self.axes)*np.ones(sz, dtype=self.dtype)
        for ax in self.axes:
            lcw[(slice(None),)*ax + ([0, -1],)] -= 1.0
        return lcw
1170635
def get_variable_info(cls, hads_var_name):
        
        if hads_var_name == "UR":
            return (
                "wind_gust_from_direction",
                "degrees from N",
                "Wind Gust from Direction",
                "Direction from which wind gust is blowing when maximum wind speed is observed.  Meteorological Convention. Wind is motion of air relative to the surface of the earth.",
            )
        elif hads_var_name in ["VJA", "TX"]:
            return (
                "air_temperature_maximum",
                "f",
                "Air Temperature Maximum",
                "",
            )
        elif hads_var_name in ["VJB", "TN"]:
            return (
                "air_temperature_minimum",
                "f",
                "Air Temperature Minumum",
                "",
            )
        elif hads_var_name == "PC":  # PC2?
            return (
                "precipitation_accumulated",
                "in",
                "Precipitation Accumulated",
                "Amount of liquid equivalent precipitation accumulated or totaled for a defined period of time, usually hourly, daily, or annually.",
            )
        elif hads_var_name == "PP":
            return (
                "precipitation_rate",
                "in",
                "Precipitation Rate",
                "Amount of wet equivalent precipitation per unit time.",
            )
        elif hads_var_name == "US":
            return (
                "wind_speed",
                "mph",
                "Wind Speed",
                "Magnitude of wind velocity. Wind is motion of air relative to the surface of the earth.",
            )
        elif hads_var_name == "UD":
            return (
                "wind_from_direction",
                "degrees_true",
                "Wind from Direction",
                "Direction from which wind is blowing.  Meteorological Convention. Wind is motion of air relative to the surface of the earth.",
            )
        elif hads_var_name in ["UP", "UG", "VUP"]:
            return (
                "wind_gust",
                "mph",
                "Wind Gust Speed",
                "Maximum instantaneous wind speed (usually no more than but not limited to 10 seconds) within a sample averaging interval. Wind is motion of air relative to the surface of the earth.",
            )
        elif hads_var_name in ["TA", "TA2"]:
            return (
                "air_temperature",
                "f",
                "Air Temperature",
                "Air temperature is the bulk temperature of the air, not the surface (skin) temperature.",
            )
        elif hads_var_name == "MT":
            return ("fuel_temperature", "f", "Fuel Temperature", "")
        elif hads_var_name == "XR":
            return ("relative_humidity", "percent", "Relative Humidity", "")
        elif hads_var_name == "VB":
            return ("battery_voltage", "voltage", "Battery Voltage", "")
        elif hads_var_name == "MM":
            return ("fuel_moisture", "percent", "Fuel Moisture", "")
        elif hads_var_name == "RW":
            return ("solar_radiation", "watt/m^2", "Solar Radiation", "")
        elif hads_var_name == "RS":
            return (
                "photosynthetically_active_radiation",
                "watt/m^2",
                "Photosynthetically Active Radiation",
                "",
            )
        elif hads_var_name == "TW":  # TW2?
            return (
                "sea_water_temperature",
                "f",
                "Sea Water Temperature",
                "Sea water temperature is the in situ temperature of the sea water.",
            )
        elif hads_var_name == "WT":
            return (
                "turbidity",
                "nephelometric turbidity units",
                "Turbidity",
                "",
            )
        elif hads_var_name == "WC":
            return (
                "sea_water_electrical_conductivity",
                "micro mhos/cm",
                "Sea Water Electrical Conductivity",
                "",
            )
        elif hads_var_name == "WP":
            return (
                "sea_water_ph_reported_on_total_scale",
                "std units",
                "Sea Water PH reported on Total Scale",
                "the measure of acidity of seawater",
            )
        elif hads_var_name == "WO":
            return ("dissolved_oxygen", "ppm", "Dissolved Oxygen", "")
        elif hads_var_name == "WX":
            return (
                "dissolved_oxygen_saturation",
                "percent",
                "Dissolved Oxygen Saturation",
                "",
            )
        elif hads_var_name == "TD":
            return (
                "dew_point_temperature",
                "f",
                "Dew Point Temperature",
                "the temperature at which a parcel of air reaches saturation upon being cooled at constant pressure and specific humidity.",
            )
        elif hads_var_name == "HG":  # HG2?
            return ("stream_gage_height", "ft", "Stream Gage Height", "")
        elif hads_var_name == "HP":
            return (
                "water_surface_height_above_reference_datum",
                "ft",
                "Water Surface Height Above Reference Datum",
                "means the height of the upper surface of a body of liquid water, such as sea, lake or river, above an arbitrary reference datum.",
            )
        elif hads_var_name == "WS":
            return ("salinity", "ppt", "Salinity", "")
        elif hads_var_name == "HM":
            return ("water_level", "ft", "Water Level", "")
        elif hads_var_name == "PA":
            return ("air_pressure", "hp", "Air Pressure", "")
        elif hads_var_name == "SD":
            return ("snow_depth", "in", "Snow Depth", "")
        elif hads_var_name == "SW":
            return ("snow_water_equivalent", "m", "Snow Water Equivalent", "")
        elif hads_var_name == "TS":
            return (
                "soil_temperature",
                "f",
                "Soil Temperature",
                "Soil temperature is the bulk temperature of the soil, not the surface (skin) temperature.",
            )

        return None