示例#1
0
    def getInternetWindSpeed(self, stnCode):
        """** No parameters are sensor reading arrays **

        Returns a wind speed in mph from an NWS weather station.
        Returns just one record of information, timestamped with the current time.
        """
        obs = internetwx.getWeatherObservation(stnCode)
        return [int(time.time())], [obs.wind_speed.value() * 1.1508]  # mph
示例#2
0
    def getInternetTemp(self, stnCode):
        """** No parameters are sensor reading arrays **

        Returns an outdoor dry-bulb temperature from an NWS weather station in degrees F.
        Returns just one record of information, timestamped with the current time.
        """
        obs = internetwx.getWeatherObservation(stnCode)
        return [int(time.time())], [obs.temp.value() * 1.8 + 32.0]
示例#3
0
    def getInternetWindSpeed(self, stnCode):
        """** No parameters are sensor reading arrays **

        Returns a wind speed in mph from an NWS weather station.
        Returns just one record of information, timestamped with the current time.
        """
        obs = internetwx.getWeatherObservation(stnCode)
        return [int(time.time())], [obs.wind_speed.value() * 1.1508]  # mph
示例#4
0
    def getInternetTemp(self, stnCode):
        """** No parameters are sensor reading arrays **

        Returns an outdoor dry-bulb temperature from an NWS weather station in degrees F.
        Returns just one record of information, timestamped with the current time.
        """
        obs = internetwx.getWeatherObservation(stnCode)
        return [int(time.time())], [obs.temp.value() * 1.8 + 32.0]
示例#5
0
    def getInternetRH(self, stnCode):
        """** No parameters are sensor reading arrays **

        Returns a Relative Humidity value in % (0 - 100) from an NWS
        weather station.  Uses the August-Roche-Magnus approximation.
        Returns just one record of information, timestamped with the current time.
        """
        obs = internetwx.getWeatherObservation(stnCode)
        if obs.dewpt is not None and obs.temp is not None:
            dewpt = obs.dewpt.value()
            temp = obs.temp.value()
            RH = 100.0 * (math.exp(
                (17.625 * dewpt) / (243.04 + dewpt)) / math.exp(
                    (17.625 * temp) / (243.04 + temp)))
            return [int(time.time())], [RH]
        else:
            # not info info available for calculation.
            return [], []