[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Ruby WX (weather

Hans Fugal

1/26/2007 4:20:00 PM

WX is shorthand for weather in the same nutty circles that encode
weather observations and forecasts like this:

METAR KLRU 261553Z AUTO 00000KT 5SM BR OVC004 03/03 A3009 RMK AO2
TAF KLRU 261600Z 261612 35007KT P6SM -SHRASN SCT010 BKN025
TEMPO 1618 5SM -SHRA BR BKN005 OVC015
FM1800 28010KT P6SM VCSH SCT015 BKN030
FM0300 28010KT P6SM SKC

You need a library for this. I've written one.

http://hans.fugal.net/s...

This is release 0.1.2, featuring METAR parsing and documentation. TAF
forecasts are forecast for version 0.2.x. Automatic fetching and
human-readable to_s methods are likely to pop up like daisies anywhere
inbetween.

If you find a bonafide METAR that doesn't parse correctly, by all means
let me know (send the raw METAR to hans+ruby-wx@fugal.net).
12 Answers

Gavin Kistner

1/26/2007 4:46:00 PM

0

On Jan 26, 9:19 am, Hans Fugal <fug...@zianet.com> wrote:
> WX is shorthand for weather in the same nutty circles that encode
> weather observations and forecasts like this:

This looks cool - thanks for sharing!

I can't foresee any occasion where I'll actually use it, so take my
comments as those of an innocent bystandar:

For a library that aims to provide the information in a
non-weather-geeky way, there are some methods that still seem pretty
geeky, such as #skc? and #tcu? and #vv? and even clr?

How about #human_sky_clear?, #equipment_sky_clear?,
#vertical_restriction?, and so on?

Alias the crap out of 'em. :)

Ara.T.Howard

1/26/2007 5:10:00 PM

0

Ara.T.Howard

1/26/2007 5:10:00 PM

0

Hans Fugal

1/26/2007 5:33:00 PM

0



On Jan 26, 9:45 am, "Phrogz" <g...@refinery.com> wrote:
> On Jan 26, 9:19 am, Hans Fugal <fug...@zianet.com> wrote:
>
> > WX is shorthand for weather in the same nutty circles that encode
> > weather observations and forecasts like this:This looks cool - thanks for sharing!
>
> I can't foresee any occasion where I'll actually use it, so take my
> comments as those of an innocent bystandar:

You might use it if you want to add the current weather at your
location to your blog sidebar, for example. :-)

> For a library that aims to provide the information in a
> non-weather-geeky way, there are some methods that still seem pretty
> geeky, such as #skc? and #tcu? and #vv? and even clr?
>
> How about #human_sky_clear?, #equipment_sky_clear?,
> #vertical_restriction?, and so on?

Agreed. To be completely forthcoming, the only reason I didn't do some
aliasing already is that I can never remember the proper syntax for
aliasing stuff and I was too lazy to look it up. Next coding binge.

However, and this was my rationalization for being too lazy, most of
the weather geek things are the sort of thing you're not likely to use
unless you're a weather geek. Will you programmatically use whether the
sky is CLR or SKC or anything else unless you're a weather geek? If you
do I will by all means get off my tuff and make the aliases. :-) The
things the average ruby programmer will care about are straightforward
enough. temp, wind, etc. Do remember that I intend to soon include
string readouts (prose and tabular) which anybody will be able to read.

Thanks for the feedback!

Hans Fugal

1/26/2007 5:42:00 PM

0



On Jan 26, 10:10 am, ara.t.how...@noaa.gov wrote:
> hey - would you mind posting a page about this on
>
> http://sciruby.codefor...

Done. The TAF information looks very useful, thanks!

Hans Fugal

1/26/2007 6:34:00 PM

0



On Jan 26, 9:45 am, "Phrogz" <g...@refinery.com> wrote:
> Alias the crap out of 'em. :)

Announcing release 0.1.3[1], now completely crap free.

1. http://hans.fugal.net/src/ruby-wx/wx-0....

Henry Maddocks

1/26/2007 10:58:00 PM

0


On 27/01/2007, at 6:35 AM, Hans Fugal wrote:
> However, and this was my rationalization for being too lazy, most of
> the weather geek things are the sort of thing you're not likely to use
> unless you're a weather geek. Will you programmatically use whether
> the
> sky is CLR or SKC or anything else unless you're a weather geek? If
> you
> do I will by all means get off my tuff and make the aliases. :-) The
> things the average ruby programmer will care about are straightforward
> enough. temp, wind, etc.

I would have thought knowing if it is overcast, clear, scattered
cloud etc is something a non weather geek would be into. But then I
used to work for a weather company so maybe that makes me a wx geek.


> Do remember that I intend to soon include
> string readouts (prose and tabular) which anybody will be able to
> read.

I look forward to seeing that.

Tom Pollard

1/26/2007 11:01:00 PM

0

That looks cool. I have a Python module to parse METAR that I'd been
think about porting to Ruby.

http://cheeseshop.python.org/pypi/m...

I'll have to take a close look at your module to see whether there's
anything left that's worth doing. Do you parse any of the 'remark'
fields? This is where the precipitation and the precise temperature/
dew point are reported, among other things.

Anyway, looks like good work.

Tom

Hans Fugal

1/27/2007 6:26:00 AM

0



On Jan 26, 4:01 pm, Tom Pollard <t...@earthlink.net> wrote:
> That looks cool. I have a Python module to parse METAR that I'd been
> think about porting to Ruby.
>
> http://cheeseshop.python.org/pypi/m...
>
> I'll have to take a close look at your module to see whether there's
> anything left that's worth doing. Do you parse any of the 'remark'
> fields? This is where the precipitation and the precise temperature/
> dew point are reported, among other things.

There's plenty left to do if you're interested. Remark parsing is one
big task that I haven't even begun to tackle yet. The other major TODO
items:

- a fetch method to grab the METAR from the web and parse it
- human-readable output
- internationalization, e.g. different units (this one's not so big)
- TAF forecasts

Happy to accept patches.

darcs get http://hans.fugal.net/s...

Hans Fugal

1/27/2007 6:31:00 AM

0



On Jan 26, 3:58 pm, Henry Maddocks <hen...@paradise.net.nz> wrote:
> I would have thought knowing if it is overcast, clear, scattered
> cloud etc is something a non weather geek would be into. But then I
> used to work for a weather company so maybe that makes me a wx geek.

Maybe it does, but you're right. I was thinking of the difference
between CLR and SKC, which is more than most people will care about. If
you say "the weatherman says it's clear" and the sky is clear with a
few scattered clouds above 12000 feet, they just figure the weatherman
got it wrong again, or that their definition of clear is different,
and they don't think twice.

In any case, the soon-to-be-implemented human-readable format (and the
already-implemented aliases) will solve that. I'm glad to have got a
lot of feedback, it's encouraging.