Horde_Service_Weather
in package
Horde_Service_Weather class
Tags
Table of Contents
- CONVERSION_KM_TO_SM = 0.6213699
- CONVERSION_KPH_TO_KNOTS = 0.5399568
- CONVERSION_KPH_TO_MPH = 0.621371192
- CONVERSION_MB_TO_INCHES = 0.0295301
- CONVERSION_MPH_TO_KNOTS = 0.868976242
- Conversion constants *
- CONVERSION_MPH_TO_KPH = 1.609344
- FORECAST_10DAY = 10
- FORECAST_3DAY = 3
- Forecast length constants *
- FORECAST_5DAY = 5
- FORECAST_7DAY = 7
- FORECAST_FIELD_ACCUMULATION = 'accum'
- FORECAST_FIELD_HUMIDITY = 'humidity'
- FORECAST_FIELD_PRECIPITATION = 'pop'
- FORECAST_FIELD_WIND = 'wind'
- FORECAST_TYPE_DETAILED = 2
- Detailed forecast, contains a day/night component for each day *
- FORECAST_TYPE_HOURLY = 3
- Hourly forecast *
- FORECAST_TYPE_STANDARD = 1
- Standard forecast summary *
- SEARCHTYPE_CITYSTATE = 4
- SEARCHTYPE_IP = 2
- SEARCHTYPE_STANDARD = 1
- Location search types *
- SEARCHTYPE_ZIP = 3
- UNITS_METRIC = 2
- UNITS_STANDARD = 1
- Unit constants *
- calculateDewPoint() : float
- Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
- calculateHumidity() : float
- Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
- calculateWindChill() : float
- Calculate windchill from temperature and windspeed.
- convertDistance() : float
- Convert distance between m, km, ft and sm
- convertPressure() : float
- Convert pressure between in, hpa, mb, mm and atm
- convertSpeed() : float|int|bool
- Convert speed between mph, kph, kt, mps, fps and bft
- convertTemperature() : float
- Convert temperature between f and c
- degToDirection() : string
- Utility function to return textual cardinal compass directions from degress.
Constants
CONVERSION_KM_TO_SM
public
mixed
CONVERSION_KM_TO_SM
= 0.6213699
CONVERSION_KPH_TO_KNOTS
public
mixed
CONVERSION_KPH_TO_KNOTS
= 0.5399568
CONVERSION_KPH_TO_MPH
public
mixed
CONVERSION_KPH_TO_MPH
= 0.621371192
CONVERSION_MB_TO_INCHES
public
mixed
CONVERSION_MB_TO_INCHES
= 0.0295301
CONVERSION_MPH_TO_KNOTS
Conversion constants *
public
mixed
CONVERSION_MPH_TO_KNOTS
= 0.868976242
CONVERSION_MPH_TO_KPH
public
mixed
CONVERSION_MPH_TO_KPH
= 1.609344
FORECAST_10DAY
public
mixed
FORECAST_10DAY
= 10
FORECAST_3DAY
Forecast length constants *
public
mixed
FORECAST_3DAY
= 3
FORECAST_5DAY
public
mixed
FORECAST_5DAY
= 5
FORECAST_7DAY
public
mixed
FORECAST_7DAY
= 7
FORECAST_FIELD_ACCUMULATION
public
mixed
FORECAST_FIELD_ACCUMULATION
= 'accum'
FORECAST_FIELD_HUMIDITY
public
mixed
FORECAST_FIELD_HUMIDITY
= 'humidity'
FORECAST_FIELD_PRECIPITATION
public
mixed
FORECAST_FIELD_PRECIPITATION
= 'pop'
FORECAST_FIELD_WIND
public
mixed
FORECAST_FIELD_WIND
= 'wind'
FORECAST_TYPE_DETAILED
Detailed forecast, contains a day/night component for each day *
public
mixed
FORECAST_TYPE_DETAILED
= 2
FORECAST_TYPE_HOURLY
Hourly forecast *
public
mixed
FORECAST_TYPE_HOURLY
= 3
FORECAST_TYPE_STANDARD
Standard forecast summary *
public
mixed
FORECAST_TYPE_STANDARD
= 1
SEARCHTYPE_CITYSTATE
public
mixed
SEARCHTYPE_CITYSTATE
= 4
SEARCHTYPE_IP
public
mixed
SEARCHTYPE_IP
= 2
SEARCHTYPE_STANDARD
Location search types *
public
mixed
SEARCHTYPE_STANDARD
= 1
SEARCHTYPE_ZIP
public
mixed
SEARCHTYPE_ZIP
= 3
UNITS_METRIC
public
mixed
UNITS_METRIC
= 2
UNITS_STANDARD
Unit constants *
public
mixed
UNITS_STANDARD
= 1
Methods
calculateDewPoint()
Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
public
static calculateDewPoint(float $temperature, float $humidity) : float
Temperature has to be entered in deg C!
Parameters
- $temperature : float
-
Temperature in degrees C.
- $humidity : float
-
Humidity.
Tags
Return values
float —calculateHumidity()
Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
public
static calculateHumidity(float $temperature, float $dewPoint) : float
Temperature and dewpoint have to be entered in deg C!
Parameters
- $temperature : float
-
Temperature in degrees C.
- $dewPoint : float
-
Dewpoint in degrees C.
Tags
Return values
float —calculateWindChill()
Calculate windchill from temperature and windspeed.
public
static calculateWindChill(float $temperature, float $speed) : float
Temperature has to be entered in deg F, speed in mph!
Parameters
- $temperature : float
-
The temperature in degrees F.
- $speed : float
-
The wind speed in MPH.
Tags
Return values
float —The windchill factor.
convertDistance()
Convert distance between m, km, ft and sm
public
static convertDistance(float $distance, string $from, string $to) : float
Parameters
- $distance : float
-
The distance in $from units.
- $from : string
-
The units to convert from.
- $to : string
-
The units to convert to.
Return values
float —convertPressure()
Convert pressure between in, hpa, mb, mm and atm
public
static convertPressure(float $pressure, string $from, string $to) : float
Parameters
- $pressure : float
-
The pressure in $from units.
- $from : string
-
Units converting from.
- $to : string
-
Units converting to.
Return values
float —The converted pressure
convertSpeed()
Convert speed between mph, kph, kt, mps, fps and bft
public
static convertSpeed(float $speed, string $from, string $to) : float|int|bool
Function will return 'false' when trying to convert from Beaufort, as it is a scale and not a true measurement
Parameters
- $speed : float
-
The speed in $from units.
- $from : string
-
The units to convert from.
- $to : string
-
The units to convert to.
Tags
Return values
float|int|bool —convertTemperature()
Convert temperature between f and c
public
static convertTemperature(float $temperature, string $from, string $to) : float
Parameters
- $temperature : float
-
The temperature in $from units.
- $from : string
-
Units to convert from.
- $to : string
-
Units to convert to.
Return values
float —degToDirection()
Utility function to return textual cardinal compass directions from degress.
public
static degToDirection(int $degree) : string
Parameters
- $degree : int
-
The degree direction (0 - 360).
Tags
Return values
string —The cardinal direction.