Author Topic: Carter Lake GRLevel3 METAR Temps on Radar  (Read 12757 times)

0 Members and 1 Guest are viewing this topic.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Carter Lake GRLevel3 METAR Temps on Radar
« on: January 06, 2011, 03:13:41 AM »
I am posting this here instead of the GRLevel3 forum since it is a script. Hope that's right...

This Temperature over GRLevel3 radar is a very nice script that I wanted to bring back out of moth balls. It was originally authored by Carter Lake who doesn't seem to frequent the forum anymore. He's contributed a great amount to the weather community. I think several people in the past had gotten stuck on trying to get it working and reached a dead end. It's given some folks a pretty hard time. If the script failed to connect to the NOAA metar data site it caused an error and the script kept running endlessly & printed out junk as fast as a Lamborghini. Web Hosts kind of frown upon things like that  :evil: . One post in this forum said their web host asked them to leave their service because of it. Several other folks had tried to get this script running on their site to no avail in the past many months.

I had tried to use it and ran into the same problem, so I fixed it. It was just a small one line fix leaving the original code pretty much in tact. It will no longer run endlessly if it doesn't connect. If you don't use Allisonhouse for your metar temperatures you might want to give this script a try. It really should be quite easy to get this little script up and running. Also if you like to write code, the base code of this script can also be incorporated into several other uses very easily.

With this script you can place the metar temps exactly where you want by tweaking the longitude and latitude, which I actually prefer over any of the Allisonhouse apps. You can see it working at http://www.eldoradocountyweather.com/grlevel3/grlevel3-radar.html when there isn't any rain and snow in the area because I take it down when it rains. My viewers prefer a clutter-less radar to better see the actual radar, as do I.

The script uses 2 files - metargrlevel3.php and metars.txt

Here is my revised Carter Lake Metar Script:
http://www.eldoradocountyweather.com/current/misc/metargrlevel3.txt

Working sample metars.txt:
http://www.eldoradocountyweather.com/current/misc/metars.txt

List of all US metars with Longitudes and Latitudes:
http://www.eldoradocountyweather.com/current/misc/metar-locations.txt

INSTRUCTIONS

1.  Change the name from metargrlevel3.txt to metargrlevel3.php.

2.  Fill out the metars.txt with the metars for your area & make sure you do NOT leave any blank lines (white space).

3.  Point to the metars.txt file in the metargrlevel3.php file.

4.  Put both files in your root folder.

5.  Add the URL to your metargrlevel3.php in your GRLevel3 placefiles in the menu items: Windows/Show Placefile Manager.

6.  After putting a check mark next to the metar placefile, wait about 20 seconds or so for the metar temps to appear. If they don't appear try closing GR3 and start it up again and then wait about 20 seconds again. If you leave it up, the temps should come up on their own after a little bit.

7.  Be careful not to add to many metars to the metars.txt. I would not go over 20 metars or so, less is better.

FONTS:
You can change the font color on line #82 (Color: 238 238 238)
You can change the font size on line #80, column #16. The default is '12'
The next number on line #80 changes the font style, regular, bold and italic. The default is '1'
Also on line #80 you will see "chr(10)". This is ascii for the degree symbol

Note: I added an alternative FTP data base (line #59) with the URL commented out right under the URL addy that's in use. If you are having any difficulties connecting you might want to try this other DB.

That's about it! It's really easy to install and I thought some of you might just enjoy using it...

-Last Modified on 1/11/11


« Last Edit: January 12, 2011, 12:13:40 AM by ELDoradoWx »
-Danny
-root is everything

Offline Russell797

  • Senior Member
  • **
  • Posts: 81
    • Lowell Highlands Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #1 on: January 08, 2011, 02:46:08 PM »
Awesome  :grin:

I very much like this script. So much so that I set up a local server at home to run it from so as to take the burden off my commercial web host.

Thank you so very much for contributing this adaptation. I note you changed the refresh from 5 to 30 minutes. Good idea. I will set mine to 20 minutes.

Thanks,

Russ
Lowell Highlands Current Weather Conditions


Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #2 on: January 08, 2011, 02:53:40 PM »
Danny, how hard would it be to retrieve selected data from WU, much like they do on their Wundermap?

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #3 on: January 08, 2011, 03:51:39 PM »
Awesome  :grin:

I very much like this script. So much so that I set up a local server at home to run it from so as to take the burden off my commercial web host.

Thank you so very much for contributing this adaptation. I note you changed the refresh from 5 to 30 minutes. Good idea. I will set mine to 20 minutes.

Thanks,

Russ

Your welcome Russell. I'm glad you find it useful.
-Danny
-root is everything

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #4 on: January 08, 2011, 03:56:38 PM »
Danny, how hard would it be to retrieve selected data from WU, much like they do on their Wundermap?

If you wanted to pick off data it should be pretty easy to do with regex (regular expressions), if you know how to code in php etc, and as long as the data is scrap-able. If you are referring to using their map overlay/s thats another story.

« Last Edit: January 08, 2011, 04:04:19 PM by ELDoradoWx »
-Danny
-root is everything

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #5 on: January 08, 2011, 04:04:11 PM »
They actually have an API http://wiki.wunderground.com/index.php/API_-_XML but I'm sure you already knew that!

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #6 on: January 08, 2011, 04:06:33 PM »
-Danny
-root is everything

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #7 on: January 08, 2011, 04:09:32 PM »
I think so, but saved to make a placefile.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #8 on: January 08, 2011, 04:19:06 PM »
I think so, but saved to make a placefile.

Now I think I understand what you are thinking.. Excellent Idea Steve! I am very  intrigued.

Near real time GR3 temps etc would rock. I might just do that.
-Danny
-root is everything

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #9 on: January 08, 2011, 04:24:15 PM »
That's what I was thinking, you could update the conditions every minute in some cases!

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #10 on: January 08, 2011, 04:39:34 PM »
That's what I was thinking, you could update the conditions every minute in some cases!

You can easily pick off the near real time data at a couple WU locations, perhaps more.

http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KCAPLACE10

http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KCAPLACE10


-Danny
-root is everything

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #11 on: January 08, 2011, 04:45:51 PM »
It's nice that they have an API to do it with too!

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #12 on: January 09, 2011, 01:30:55 AM »
I know this sounded easy but I can't seem to get it to work. I get file not found.

www.leomaweather.com/metargrlevel3.php

also do I put www.leomaweather.com/metargrlevel3.php  in the place file manager or the metars.txt?

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #13 on: January 09, 2011, 03:29:28 PM »
I know this sounded easy but I can't seem to get it to work. I get file not found.

www.leomaweather.com/metargrlevel3.php

also do I put www.leomaweather.com/metargrlevel3.php  in the place file manager or the metars.txt?

The url to metargrlevel3.php goes in the placefile manager:
www.leomaweather.com/metargrlevel3.php

If you are still stuck please post here or on your site the metargrlevel3.php as a text file. Either as metargrlevel3.php.txt or metargrlevel3.txt

-Danny
-root is everything

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #14 on: January 09, 2011, 04:56:04 PM »
Here is the link to the file. Where in the file do I point to my metars.txt?

http://www.leomaweather.com/metargrlevel3.txt

I also got the php into the placefiles.

Offline LWP

  • Member
  • *
  • Posts: 19
    • localweatherplus
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #15 on: January 09, 2011, 08:32:15 PM »
Here is the link to the file. Where in the file do I point to my metars.txt?

http://www.leomaweather.com/metargrlevel3.txt

I also got the php into the placefiles.


Hi LeomaTNWX,

As long as the metar.txt and metargrlevel3.php are in your root directory of your site you shouldn't have to point to a new location.

Brad
Brad
Weather Display, Virtual Weather Station, WeatherLink
CWOP-CW8005  /  W.U.- KNEMONRO2

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #16 on: January 09, 2011, 08:38:13 PM »
thats what i thought.

Offline LWP

  • Member
  • *
  • Posts: 19
    • localweatherplus
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #17 on: January 09, 2011, 08:39:52 PM »
Hi Danny

Thanks a bunch for correcting this script!!!  =D>
I had looked at it a few times in the past and wished I could get this working, very cool.  :D

Can be checked out here: http://localweatherplus.com/grlevel3br248.php

Brad
Brad
Weather Display, Virtual Weather Station, WeatherLink
CWOP-CW8005  /  W.U.- KNEMONRO2

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #18 on: January 09, 2011, 08:42:23 PM »
I'm new to this. Is GR3 a subscription product?
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline LWP

  • Member
  • *
  • Posts: 19
    • localweatherplus
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #19 on: January 09, 2011, 09:02:26 PM »
Hi Ed,

GRLevel3 is an application that you purchase.  You can pull free radar feeds from NWS and that is what I and many others do.  You can also pay a subscription to a few third party providers for the radar feed +  other additions i.e. lightning.  With this software you can then add radar images for your location to your web site.  Oh, and the software does some fancy smoothing to make the radar image much better too.  Very nice application to have, much fun watching thunderstorms!  :grin:

GRLevel3 can be purchased here: http://www.grlevelx.com/grlevel3/
One of the very popular add-on subscription sites is AllisionHouse http://www.allisonhouse.com/ 

Brad
Brad
Weather Display, Virtual Weather Station, WeatherLink
CWOP-CW8005  /  W.U.- KNEMONRO2

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #20 on: January 09, 2011, 10:18:17 PM »
I know this sounded easy but I can't seem to get it to work. I get file not found.

www.leomaweather.com/metargrlevel3.php

also do I put www.leomaweather.com/metargrlevel3.php  in the place file manager or the metars.txt?

Your metars.txt looks good as far as the metar names are concerned.

The placefile manager addy should match this:
http://www.leomaweather.com/metargrlevel3.php

The script isn't finding your metars.txt.

For kicks, lets try it this way -

Change this code at around line 28:
Code: [Select]
$metarfilename = getenv('DOCUMENT_ROOT') . "/metars.txt";
To this code:
Code: [Select]
$metarfilename = "http://www.leomaweather.com/metars.txt";
Then try running the script directly at:

http://www.leomaweather.com/metargrlevel3.php

IF there is an error, just stop the code from your browser (ie Click Stop). Then try again a few times to see if it will find the metar URL and display your metar data now.

If you do get the data to print out manually it should also work in GR3.
-Danny
-root is everything

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #21 on: January 09, 2011, 11:03:41 PM »
That worked. But in Gr I get. Error: Line 7 - fontNumber< 1

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #22 on: January 10, 2011, 02:33:29 AM »
That worked. But in Gr I get. Error: Line 7 - fontNumber< 1

The script was actually written for GR3. I don't use Gr I, but it could be easily adapted by someone who uses it.
-Danny
-root is everything

Offline LeomaTNWX

  • Senior Contributor
  • ****
  • Posts: 271
    • Leoma, Tn Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #23 on: January 10, 2011, 09:50:29 AM »
well I forgot to put the 3. It is Gr3.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: Carter Lake GRLevel3 METAR Temps on Radar
« Reply #24 on: January 10, 2011, 03:45:10 PM »
well I forgot to put the 3. It is Gr3.

Ohhhh okay! Sorry bout that. I just ran your metargrlevel3.php a few times and didn't see that error. Are you seeing the error in your browser after running the script? Or is the error seen in the placefile properties, where you right click the url in the placefile manager and it brings up the placefile properties in GR3? Or perhaps somewhere else? If it is seen in the placefile manager that is most likely from a prior run that failed. When the script fails to connect you can get an error like that in the placefile properties. Unfortunately connecting to the noaa db can fail at times. If it fails quite a bit you can try changing the noaa db url to the FTP db as discussed in the instructions and see if that helps.

BTW, you can change font sizes on lines 79 & 80

Here is your page print out:

Title: METAR Temps (El Dorado Weather)
Refresh: 30
Font: 1, 20, 1, "Arial"
Font: 2, 12, 1, "Arial"
Threshold: 999
Color: 238 238 238
Text: 36.11888889 ,-86.68916667, , "30°", "Nashville\nLight Snow  And Mist \n30°F WC: 25°F\n86% RH\n30.15 in.\nWind: 5 mph NE\n12:53 PM 01/10/11\n28 min ago"
Text: 35.03333333 ,-85.20000000, , "30°", "Chattanooga\nOvercast\n30°F WC: 27°F\n86% RH\n30.13 in.\nWind: 3 mph NNE\n12:53 PM 01/10/11\n28 min ago"
Text: 36.62194444 ,-87.41500000, , "30°", "Clarksville\nHaze \n30°F WC: 22°F\n86% RH\n30.15 in.\nWind: 9 mph E\n12:52 PM 01/10/11\n29 min ago"
Text: 35.95138889 ,-85.08500000, , "28°", "Crossville\nOvercast\n28°F WC: 21°F\n86% RH\n30.07 in.\nWind: 7 mph ENE\n12:53 PM 01/10/11\n28 min ago"
Text: 36 ,-89.40000000, , "34°", "Dyersburg\nOvercast\n34°F WC: 29°F\n70% RH\n30.14 in.\nWind: 6 mph ENE\n1:15 PM 01/10/11\n6 min ago"
Text: 35.06111111 ,-89.98500000, , "34°", "Memphis\nOvercast\n34°F\n81% RH\n30.12 in.\nWind: calm\n12:53 PM 01/10/11\n28 min ago"
Text: 35.59305556 ,-88.91666667, , "34°", "Jackson\nOvercast\n34°F WC: 29°F\n81% RH\n30.13 in.\nWind: 5 mph E\n12:53 PM 01/10/11\n28 min ago"
Text: 36.00888889 ,-86.52000000, , "32°", "Smyrna\nOvercast\n32°F WC: 25°F\n80% RH\n30.17 in.\nWind: 7 mph NNE\n12:56 PM 01/10/11\n25 min ago"
Text: 35.35666667 ,-89.87027778, , "34°", "Millington\nOvercast\n34°F WC: 32°F\n81% RH\n30.12 in.\nWind: 3 mph ENE\n1:15 PM 01/10/11\n6 min ago"
Text: 36.02277778 ,-84.23333333, , "30°", "Oak Ridge\nLight Snow  And Mist \n30°F WC: 24°F\n86% RH\n30.15 in.\nWind: 6 mph NE\n1:02 PM 01/10/11\n19 min ago"
Text: 36.47972222 ,-82.39888889, , "30°", "Bristol / Johnson / Kingsport\nLight Snow \n30°F WC: 25°F\n75% RH\n30.14 in.\nWind: 5 mph ENE\n1:05 PM 01/10/11\n16 min ago"
Text: 35.81805556 ,-83.98583333, , "30°", "Knoxville\nLight Snow  And Mist \n30°F WC: 24°F\n86% RH\n30.13 in.\nWind: 6 mph NE\n1:02 PM 01/10/11\n19 min ago"


You can also change the weather station name on line 77 of metargrlevel3.php.


-Danny
-root is everything