Class: Services_Weather_Common
Source Location: /Services_Weather-1.4.7/Weather/Common.php
Parent class for weather-services. Defines common functions for unit conversions, checks for cache enabling and does other miscellaneous things.
Author(s):
Version:
Copyright:
- 2005-2011 Alexander Wirtz
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
calculateDewPoint [line 760]
float calculateDewPoint(
float
$temperature, float
$humidity)
|
|
Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula Temperature has to be entered in deg C!
Parameters:
calculateHumidity [line 721]
float calculateHumidity(
float
$temperature, float
$dewPoint)
|
|
Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula Temperature and dewpoint have to be entered in deg C!
Parameters:
calculateMoonPhase [line 823]
PEAR_Error|array calculateMoonPhase(
int
$date)
|
|
Calculates the moon age and phase The algorithms for this functions were taken from the German Wikipedia entry on Julian Daycount for getting the accurate JD to the second and the overall moon calculation were done according to Stephen R. Schmitt's website, which is cited multiple times on the web for this kind of calculation. The date has to be entered as a timestamp!
Parameters:
calculateSunRiseSet [line 991]
PEAR_Error|mixed calculateSunRiseSet(
int
$date, [int
$retformat = null], [float
$latitude = null], [float
$longitude = null], [float
$zenith = null], [float
$gmt_offset = null], [bool
$sunrise = true])
|
|
Calculates sunrise and sunset for a location The sun position algorithm taken from the 'US Naval Observatory's Almanac for Computers', implemented by Ken Bloom <kekabloom[at]ucdavis[dot]edu> for the zmanim project, converted to C by Moshe Doron <mosdoron[at]netvision[dot]net[dot]il> and finally taken from the PHP5 sources and converted to native PHP as a wrapper. The date has to be entered as a timestamp!
Parameters:
calculateWindChill [line 701]
float calculateWindChill(
float
$temperature, float
$speed)
|
|
Calculate windchill from temperature and windspeed (enhanced formula) Temperature has to be entered in deg F, speed in mph!
Parameters:
convertDistance [line 662]
float convertDistance(
float
$distance, string
$from, string
$to)
|
|
Convert distance between km, ft and sm
Parameters:
convertPressure [line 622]
float convertPressure(
float
$pressure, string
$from, string
$to)
|
|
Convert pressure between in, hpa, mb, mm and atm
Parameters:
convertSpeed [line 562]
float|int|bool convertSpeed(
float
$speed, string
$from, string
$to)
|
|
Convert speed between mph, kmh, kt, mps, fps and bft Function will return "false" when trying to convert from Beaufort, as it is a scale and not a true measurement
Parameters:
convertTemperature [line 526]
float convertTemperature(
float
$temperature, string
$from, string
$to)
|
|
Convert temperature between f and c
Parameters:
getUnitsFormat [line 466]
array getUnitsFormat(
[string
$unitsFormat = ""])
|
|
Returns the selected units format
Parameters:
getWeatherIcon [line 1181]
void getWeatherIcon(
string
$condition, [array
$clouds = array()], [float
$wind = 5], [float
$temperature = 70], [float
$latitude = -360], [float
$longitude = -360], [int
$reportTime = ""])
|
|
Gets a number corresponding to a weather icon. These numbers just happen to correspond with the icons that you get with the weather.com SDK, but open versions of them have been created. Input must be in standard units. For the icons that include day/night, we use the present time and the provided lat/lon to determine if the sun is up. A complete set of icon descriptions can be found here: http://sranshaft.wincustomize.com/Articles.aspx?AID=60165&u=0 There are a number of icon sets here: http://www.desktopsidebar.com/forums/index.php?showtopic=2441&st=0 http://www.desktopsidebar.com/forums/index.php?showtopic=819
Parameters:
polar2cartesian [line 791]
array polar2cartesian(
float
$latitude, float
$longitude)
|
|
Convert polar coordinates to cartesian coordinates
Parameters:
setCache [line 242]
PEAR_Error|bool setCache(
[string
$cacheType = "file"], [array
$cacheOptions = array()])
|
|
Enables caching the data, usage strongly recommended Requires Cache to be installed
Parameters:
setDateTimeFormat [line 505]
void setDateTimeFormat(
[string
$dateFormat = ""], [string
$timeFormat = ""])
|
|
Changes the representation of time and dates (see http://www.php.net/date)
Parameters:
setHttpOption [line 405]
void setHttpOption(
string
$varName, mixed
$varValue)
|
|
Sets an option for usage in HTTP_Request objects
Parameters:
setHttpProxy [line 435]
void setHttpProxy(
string
$httpProxy)
|
|
Sets the proxy for HTTP requests
Parameters:
setHttpTimeout [line 420]
void setHttpTimeout(
int
$httpTimeout)
|
|
Sets the timeout in seconds for HTTP requests
Parameters:
setUnitsFormat [line 368]
void setUnitsFormat(
string
$unitsFormat, [array
$customUnitsFormat = array()])
|
|
Changes the representation of the units (standard/metric)
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:50:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|