;ò Ýw­?c @sì dkZdkZdkZdkZdkZdkZdZdZdeefZhdddhdd<d d <d d <d d<dd<dd<dd<dddf<dd<dd<dd<dd<d d?<d d@<d dA<ddB<ddC<ddD<dd7df<ddE<ddF<ddG<ddHscCs |iSdS(s5 Return country-part of station name N(sselfs stat_country(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationCountryDscCs |iSdS(s3 Return cycle value. The cycle value is not the frequency or delay between observations but the "time slot" in which the observation was made. There are 24 cycle slots every day which usually last from N:45 to N+1:45. The cycle from 23:45 to 0:45 is cycle 0. N(sselfscycle(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetCycleJscCs|i|i|ifSdS(sP Return latitude, longitude and altitude above sea level of station as a tuple. Some stations don't deliver altitude, for those, None is returned as altitude. The lat/longs are expressed as follows: xx-yyd where xx is degrees, yy minutes and d the direction. Thus 51-14N means 51 degrees, 14 minutes north. d may take the values N, S for latitues and W, E for longitudes. Latitude and Longitude may include seconds. Altitude is always given as meters above sea level, including a trailing M. Schipohl Int. Airport Amsterdam has, for example: ('52-18N', '004-46E', '-2M') Moenchengladbach (where I live): ('51-14N', '063-03E', None) If you need lat and long as float values, look at getStationPositionFloat() instead N(sselfslatitudes longitudesaltitude(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationPositionTscCs|i|i|ifSdS(sY Return latitude and longitude as float values in a tuple (lat,long,alt) N(sselfslatfslongfsaltitude(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationPositionFloathscCs |iSdS(s© Return the station's latitude in dd-mm[-ss]D format : dd : degrees mm : minutes ss : seconds D : direction (N, S, E, W) N(sselfslatitude(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationLatitudenscCs |iSdS(s, Return latitude as a float N(sselfslatf(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationLatitudeFloatxscCs |iSdS(sª Return the station's longitude in dd-mm[-ss]D format : dd : degrees mm : minutes ss : seconds D : direction (N, S, E, W) N(sselfs longitude(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationLongitude~scCs |iSdS(s- Return Longitude as a float N(sselfslongf(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationLongitudeFloatˆscCs |iSdS(sH Return the station's altitude above the sea in meters. N(sselfsaltitude(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetStationAltitudeŽscCs |iSdS(sC Return the URL from which the report was fetched. N(sselfs reporturl(sself((s2/home/flatline/documents/psyche/modules/pymetar.pys getReportURL”scCs |iSdS(sÖ Return the time when the observation was made. Note that this is *not* the time when the report was fetched by us Format: YYYY.MM.DD HHMM UTC Example: 2002.04.01 1020 UTC N(sselfsrtime(sself((s2/home/flatline/documents/psyche/modules/pymetar.pysgetTimešscCs|i|iƒSdS(sv Return the time when the observation was made in ISO 8601 format (e.g. 2002-07-25 15:12:00Z) N(sselfsmetar_to_iso8601srtime(sself((s2/home/flatline/documents/psyche/modules/pymetar.pys getISOTime£scCs |iSdS(sj Return a suggested pixmap name, without extension, depending on current weather. N(sselfspixmap(sself((s2/home/flatline/documents/psyche/modules/pymetar.pys getPixmapªscCsd|tj oS|iƒ\}}}|idƒ\}}}d||||d |dd!fSndS(s; Converts a metar date to an ISO8601 date. s.s%s-%s-%s %s:%s:00ZiiN( s metardatesNonessplitsdateshourstzsyearsmonthsday(sselfs metardatestzshoursmonthsyearsdatesday((s2/home/flatline/documents/psyche/modules/pymetar.pysmetar_to_iso8601±s  cCs*t|ƒ}|iƒti|dƒSdS(s# Reverses a string sN(slistsstrslistrsreversesstringsjoin(sselfsstrslistr((s2/home/flatline/documents/psyche/modules/pymetar.pys strreverse»s  cCs,|tj o|i|ƒn |iƒdS(su Get initial report if a station code is passed as a parameter, otherwise initialize fields. N(sMetarStationCodesNonesselfsfetchMetarReports_ClearAllFields(sselfsMetarStationCode((s2/home/flatline/documents/psyche/modules/pymetar.pys__init__Ãs cCsåd|_t|_t|_t|_t|_t|_t|_t|_ t|_ t|_ t|_ t|_ t|_t|_t|_t|_t|_t|_t|_t|_t|_t|_t|_t|_t|_dS(s+ Clears all fields values. iN(sselfsvalidsNones fullreportstemps windspeedswinddirsvissdewpshumidspressscodesweathersskysfullnscycleswindcompsrtimespixmapslatitudes longitudesaltitudes stat_citys stat_countrys reportutlslatfslongf(sself((s2/home/flatline/documents/psyche/modules/pymetar.pys_ClearAllFieldsÍs4                        s<http://weather.noaa.gov/pub/data/observations/metar/decoded/c% Csm|iƒti|ƒ}d||f|_titi ti ti ƒƒti |iƒ}|iƒ|_|iƒi oéti|idƒ}x$|D]}yti|ddƒ\}}Wntj o|}}nXti|ƒ}ti|ƒ}ti|d|dƒdjokyXti|ddƒ\} }ti| ƒ} |i| ƒ}ti|ddƒ\}}#Wn%tj od }d }|}nXy2ti|d ƒ\}}} }t&|d ƒ}Wn4tj o(ti|d ƒ\}}} t'}nXti|i|#ƒƒ|_(ti|i|ƒƒ|_)| |_*||_+| |_,|i-|ƒ|_.|i-| ƒ|_/||_0q™ti|d ƒdjo.ti|d ƒ\}} ti| ƒ|_3q™|d jo:ti|d dƒ\}!}t6|!ƒddd|_7q™|djoti|dƒdjod|_8t'|_9t'|_:qµti|dƒdjoJti|d dƒ\}"}}} t6|ƒd|_8t'|_9t'|_:qµti|d dƒ\}}!}}$} }}} t&|$dƒ|_9ti|ƒ|_:t6|ƒd|_8q™|djoIx~|iƒD]4}yt6|ƒd|_CPWqAtj oqAXqAWq™|djo:ti|d dƒ\} }t6| ƒddd|_Eq™|djo.ti|ddƒ\}}t&|ƒ|_Gq™|djo2ti|d dƒ\}} t6|ƒd|_Hq™|djo ||_Iq™|d jo ||_Jq™|d!joti|ƒ|_Kq™|d"jot&|ƒ|_Lq™q™W|iMƒ} | t'j o| \} }nt't'f\} }|iPƒ}|t'j o|\}}nt't'f\}}|iIp |p| |_I|p||_Sd|_Tn~d#S($sï Retrieve the decoded METAR report from the given base URL and parse it. Fill the data properties in the class instance with the values found in the report, converting them to metric values where necessary. s%s%s.TXTs s:is(s)iÿÿÿÿs,ss sUTCs/s Temperaturei f5.0f9.0sWindsCalmf0.0sVariableif0.44703999999999999is Visibilityf1.6093440000000001s Dew PointsRelative Humiditys%sPressure (altimeter)f33.863886000000001sWeathersSky conditionssobscycleN(Usselfs_ClearAllFieldssstringsuppersstationsbaseurls reporturlsurllib2sinstall_openers build_openers ProxyHandlers HTTPHandlersurlopensfnsreads fullreportsinfosstatusssplitslinesslinesheadersdatas ValueErrorsstripsfindslocsps strreversesrlocsrcounsrcityscityscounsidslatslongshtsintsNones stat_citys stat_countrysfullnslatitudes longitudes parseLatLongslatfslongfsaltitudeslocalsrtsrtimestsisfloatstemps windspeedswinddirswindcompsvsasspeedsrsfscompsdegsdsvissdpsdewpshshumidspresssweathersskyscodescyclesextractCloudInformations cloudinfos cloudpixmapsextractSkyConditionss conditionss condpixmapspixmapsvalid(%sselfsstationsbaseurlsrcouns conditionssheadersspeedsidscounsrtslocslongsdps cloudinfoslocalscityscompshtslatslines cloudpixmapsdatas condpixmapsfnsasrlocsdsfsishslinesspsrstsvsrcitysdeg((s2/home/flatline/documents/psyche/modules/pymetar.pysfetchMetarReportísÄ !           !  -                 (+s__name__s __module__s__doc__smatch_WeatherPartsextractSkyConditionss parseLatLongsextractCloudInformations getFullReportsgetTemperatureCelsiussgetTemperatureFahrenheitsgetDewPointCelsiussgetDewPointFahrenheits getWindSpeedsgetWindDirectionsgetWindCompasssgetVisibilityKilometerssgetVisibilityMiless getHumiditys getPressuresgetRawMetarCodes getWeathersgetSkyConditionssgetStationNamesgetStationCitysgetStationCountrysgetCyclesgetStationPositionsgetStationPositionFloatsgetStationLatitudesgetStationLatitudeFloatsgetStationLongitudesgetStationLongitudeFloatsgetStationAltitudes getReportURLsgetTimes getISOTimes getPixmapsmetar_to_iso8601s strreversesNones__init__s_ClearAllFieldssfetchMetarReport(((s2/home/flatline/documents/psyche/modules/pymetar.pys MetarReportesP    '                             (sstringsresurllib2stypessmathsfpformats __author__s __version__s__doc__s_WeatherConditionss TIME_RE_STRs WIND_RE_STRs VIS_RE_STRs CLOUD_RE_STRs TEMP_RE_STRs PRES_RE_STRs COND_RE_STRs MetarReport(s_WeatherConditionss __version__sstrings WIND_RE_STRs TEMP_RE_STRsurllib2s TIME_RE_STRsfpformatsres MetarReportstypess CLOUD_RE_STRs VIS_RE_STRs PRES_RE_STRs __author__s COND_RE_STRs__doc__smath((s2/home/flatline/documents/psyche/modules/pymetar.pys?s6    ÿÿÿÿÿÿÿÿÿÿcÿ#