Ejemplo n.º 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
Ejemplo n.º 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]
Ejemplo n.º 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
Ejemplo n.º 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]
Ejemplo n.º 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 [], []