.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "METAR 3pm" .TH METAR 3pm "2017-11-12" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Geo::METAR \- Process aviation weather reports in the METAR format. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Geo::METAR; \& use strict; \& \& my $m = new Geo::METAR; \& $m\->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014"); \& print $m\->dump; \& \& exit; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1METAR\s0 reports are available on-line, thanks to the National Weather Service. Since reading the \s-1METAR\s0 format isn't easy for non-pilots, these reports are relatively useles to the common man who just wants a quick glace at the weather. This module tries to parse the \s-1METAR\s0 reports so the data can be used to create readable weather reports and/or process the data in applications. .SH "USAGE" .IX Header "USAGE" .SS "How you might use this" .IX Subsection "How you might use this" Here is how you \fImight\fR use the Geo::METAR module. .PP One use that I have had for this module is to query the \s-1NWS METAR\s0 page (using the \s-1LWP\s0 modules) at: .PP \&\fIhttp://weather.noaa.gov/cgi\-bin/mgetmetar.pl?cccc=EHSB\fR .PP to get an up-to-date \s-1METAR.\s0 Then, I scan thru the output, looking for what looks like a \s-1METAR\s0 string (that's not hard in Perl). Oh, \s-1EHSB\s0 can be any site location code where there is a reporting station. .PP I then pass the \s-1METAR\s0 into this module and get the info I want. I can then update my webcam page with the current temperature, sky conditions, or whatnot. See for yourself at http://webcam.idefix.net/ .PP See the \s-1BUGS\s0 section for a remark about multiple passes with the same Geo::METAR object. .SS "Functions" .IX Subsection "Functions" The following functions are defined in the \s-1METAR\s0 module. Most of them are \fIpublic\fR, meaning that you're supposed to use them. Some are \fIprivate\fR, meaning that you're not supposed to use them \*(-- but I won't stop you. Assume that functions are \fIpublic\fR unless otherwise documented. .IP "\fImetar()\fR" 4 .IX Item "metar()" \&\fImetar()\fR is the function to whwich you should pass a \s-1METAR\s0 string. It will take care of decomposing it into its component parts converting the units and so on. .Sp Example: \f(CW\*(C`$m\->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014");\*(C'\fR .IP "\fIdebug()\fR" 4 .IX Item "debug()" \&\fIdebug()\fR toggles debugging messages. By default, debugging is turned \&\fBoff\fR. Turn it on if you are developing \s-1METAR\s0 or having trouble with it. .Sp \&\fIdebug()\fR understands all of the following: .Sp .Vb 5 \& Enable Disable \& \-\-\-\-\-\- \-\-\-\-\-\-\- \& 1 0 \& \*(Aqyes\*(Aq \*(Aqno\*(Aq \& \*(Aqon\*(Aq \*(Aqoff\*(Aq .Ve .Sp If you contact me for help, I'll likely ask you for some debugging output. .Sp Example: \f(CW\*(C`$m\->debug(1);\*(C'\fR .IP "\fIdump()\fR" 4 .IX Item "dump()" \&\fIdump()\fR will dump the internal data structure for the \s-1METAR\s0 in a semi-human readable format. .Sp Example: \f(CW\*(C`$m\->dump;\*(C'\fR .IP "\fIversion()\fR" 4 .IX Item "version()" \&\fIversion()\fR will print out the current version. .Sp Example: \f(CW\*(C`print $m\->version;\*(C'\fR .IP "\fI_tokenize()\fR" 4 .IX Item "_tokenize()" \&\fB\s-1PRIVATE\s0\fR .Sp Called internally to break the \s-1METAR\s0 into its component tokens. .IP "\fI_process()\fR" 4 .IX Item "_process()" \&\fB\s-1PRIVATE\s0\fR .Sp Used to make sense of the tokens found in \fB\f(BI_tokenize()\fB\fR. .SS "Variables" .IX Subsection "Variables" After you've called \fB\f(BImetar()\fB\fR, you'd probably like to get at the individual values for things like temperature, dew point, and so on. You do that by accessing individual variables via the \s-1METAR\s0 object. .PP This section lists those variables and what they represent. .PP If you call \fB\f(BIdump()\fB\fR, you'll find that it spits all of these out. .IP "\s-1VERSION\s0" 4 .IX Item "VERSION" The version of \s-1METAR\s0.pm that you're using. .IP "\s-1METAR\s0" 4 .IX Item "METAR" The actual, raw \s-1METAR.\s0 .IP "\s-1TYPE\s0" 4 .IX Item "TYPE" Report type in English (\*(L"Routine Weather Report\*(R" or \*(L"Special Weather Report\*(R") .IP "\s-1SITE\s0" 4 .IX Item "SITE" 4\-letter site code. .IP "\s-1DATE\s0" 4 .IX Item "DATE" The date (just the day of the month) on which the report was issued. .IP "\s-1TIME\s0" 4 .IX Item "TIME" The time at which the report was issued. .IP "\s-1MOD\s0" 4 .IX Item "MOD" Modifier (\s-1AUTO/COR\s0) if any. .IP "\s-1WIND_DIR_ENG\s0" 4 .IX Item "WIND_DIR_ENG" The current wind direction in English (Southwest, East, North, etc.) .IP "\s-1WIND_DIR_ABB\s0" 4 .IX Item "WIND_DIR_ABB" The current wind direction in abbreviated English (S, E, N, etc.) .IP "\s-1WIND_DIR_DEG\s0" 4 .IX Item "WIND_DIR_DEG" The current wind direction in degrees. .IP "\s-1WIND_KTS\s0" 4 .IX Item "WIND_KTS" The current wind speed in Knots. .IP "\s-1WIND_MPH\s0" 4 .IX Item "WIND_MPH" The current wind speed in Miles Per Hour. .IP "\s-1WIND_MS\s0" 4 .IX Item "WIND_MS" The current wind speed in Metres Per Second. .IP "\s-1WIND_GUST_KTS\s0" 4 .IX Item "WIND_GUST_KTS" The current wind gusting speed in Knots. .IP "\s-1WIND_GUST_MPH\s0" 4 .IX Item "WIND_GUST_MPH" The current wind gusting speed in Miles Per Hour. .IP "\s-1WIND_GUST_MS\s0" 4 .IX Item "WIND_GUST_MS" The current wind gusting speed in Metres Per Second. .IP "\s-1WIND_VAR\s0" 4 .IX Item "WIND_VAR" The wind variation in English .IP "\s-1WIND_VAR_1\s0" 4 .IX Item "WIND_VAR_1" The first wind variation direction .IP "\s-1WIND_VAR_ENG_1\s0" 4 .IX Item "WIND_VAR_ENG_1" The first wind variation direction in English .IP "\s-1WIND_VAR_2\s0" 4 .IX Item "WIND_VAR_2" The second wind variation direction .IP "\s-1WIND_VAR_ENG_2\s0" 4 .IX Item "WIND_VAR_ENG_2" The second wind variation direction in English .IP "\s-1VISIBILITY\s0" 4 .IX Item "VISIBILITY" Visibility information. .IP "\s-1WIND\s0" 4 .IX Item "WIND" Wind information. .IP "\s-1RUNWAY\s0" 4 .IX Item "RUNWAY" Runway information. .IP "\s-1WEATHER\s0" 4 .IX Item "WEATHER" Current weather (array) .IP "\s-1WEATHER_LOG\s0" 4 .IX Item "WEATHER_LOG" Current weather log (array) .IP "\s-1SKY\s0" 4 .IX Item "SKY" Current cloud cover (array) .IP "\s-1TEMP_C\s0" 4 .IX Item "TEMP_C" Temperature in Celsius. .IP "\s-1TEMP_F\s0" 4 .IX Item "TEMP_F" Temperature in Fahrenheit. .IP "\s-1DEW_C\s0" 4 .IX Item "DEW_C" Dew point in Celsius. .IP "\s-1DEW_F\s0" 4 .IX Item "DEW_F" Dew point in Fahrenheit. .IP "\s-1HOURLY_TEMP_F\s0" 4 .IX Item "HOURLY_TEMP_F" Hourly current temperature, fahrenheit .IP "\s-1HOURLY_TEMP_C\s0" 4 .IX Item "HOURLY_TEMP_C" Hourly current temperature, celcius .IP "\s-1HOURLY_DEW_F\s0" 4 .IX Item "HOURLY_DEW_F" Hourly dewpoint, fahrenheit .IP "\s-1HOURLY_DEW_C\s0" 4 .IX Item "HOURLY_DEW_C" Hourly dewpoint, celcius .IP "\s-1ALT\s0" 4 .IX Item "ALT" Altimeter setting (barometric pressure). .IP "\s-1ALT_HP\s0" 4 .IX Item "ALT_HP" Altimeter setting in hectopascals. .IP "\s-1REMARKS\s0" 4 .IX Item "REMARKS" Any remarks in the report. .SH "NOTES" .IX Header "NOTES" Test suite is small and incomplete. Needs work yet. .PP Older versions of this module were installed as \*(L"\s-1METAR\*(R"\s0 instaed of \&\*(L"Geo::METAR\*(R" .SH "BUGS" .IX Header "BUGS" The Geo::METAR is only initialized once, which means you'll get left-over crud in variables when you call the \fImetar()\fR function twice. .PP What is an invalid \s-1METAR\s0 in one country is a standard one in the next. The standard is interpreted and used by meteorologists all over the world, with local variations. This means there will always be METARs that will trip the parser. .SH "TODO" .IX Header "TODO" There is a \s-1TODO\s0 file included in the Geo::METAR distribution listing the outstanding tasks that I or others have devised. Please check that list before you submit a bug report or request a new feture. It might already be on the \s-1TODO\s0 list. .SH "AUTHORS AND COPYRIGHT" .IX Header "AUTHORS AND COPYRIGHT" Copyright 1997\-2000, Jeremy D. Zawodny .PP Copyright 2007, Koos van den Hout .PP Geo::METAR is covered under the \s-1GNU\s0 Public License (\s-1GPL\s0) version 2 or later. .PP The Geo::METAR Web site is located at: .PP .Vb 1 \& http://idefix.net/~koos/perl/Geo\-METAR/ .Ve .SH "CREDITS" .IX Header "CREDITS" In addition to our work on Geo::METAR, We've received ideas, help, and patches from the following folks: .PP .Vb 1 \& * Ethan Dicks \& \& Testing of Geo::METAR at the South Pole. Corrections and pointers \& to interesting cases to test. \& \& * Otterboy \& \& Random script fixes and initial debugging help \& \& * Remi Lefebvre \& \& Debian packaging as libgeo\-metar\-perl.deb. \& \& * Mike Engelhart \& \& Wind direction naming corrections. \& \& * Michael Starling \& \& Wind direction naming corrections. \& \& * Hans Einar Nielssen \& \& Wind direction naming corrections. \& \& * Nathan Neulinger \& \& Lots of enhancements and corrections. Too many to list here. .Ve .SH "RELATED PROJECTS" .IX Header "RELATED PROJECTS" \&\fBlcdproc\fR at http://www.lcdproc.org/ uses Geo::METAR in lcdmetar.pl to display weather data on an lcd.