cloudy cloudy

Author Topic: PHP animated gifs for GR3 radar & other uses?  (Read 33612 times)

0 Members and 1 Guest are viewing this topic.

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,785
  • Mauston, WI, USA
    • Juneau County Weather
PHP animated gifs for GR3 radar & other uses?
« on: November 01, 2006, 11:20:21 PM »
After many hours of struggling & learning some PHP, this non-programmer has pretty much reached his limit.  You can download jcweather.us/animategr3.zip and have animated gif radar images for your web site should you wish (example to the left).  There's also a demo of cropping, resizing, overlaid text and graphics on a single file. jcweather.us/gr3/smallgr3.gif

This will work with, and convert png, jpg and gif files so it could be a good tool for other things as well.  A sequence of photos comes to mind.  Beware though that file sizes do get quite large.  For instance animating the 10 GR3 base reflectivity files at 425x425 resulted in a 1mb animation. 

Credit for getting me going on this goes to Tom from carterlake.org and Kevin from tnetweather.com as they tweeked my interest in this Forum.  Most of all, this would be impossible in PHP without the class built and made availailable by László Zsidi.

The code is heavily commented so no need for documentation.  You may need to make some directory or filename changes depending on your setup, but other than that just toss everything from the zip file into your gr3 directory and you'll be ready to go.  Suggestions and improvements will be greatly appreciated and hopefully I'll learn even more.


- Jim
« Last Edit: April 07, 2007, 01:49:25 PM by jmcmurry »
Forum Search and Google can be your best friends

 Home of NSLog NexStorm Lightning Data Manager

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #1 on: November 02, 2006, 12:14:38 AM »
Hey, I was just starting on this project today.

Thanks! (saved me an evening of fumbling around with coding... now to dissect the code and see what's going on)  :wink:

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #2 on: November 02, 2006, 01:08:48 AM »
Cool!



(Takes quite a bit of setup, but pretty darn neat)

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,785
  • Mauston, WI, USA
    • Juneau County Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #3 on: November 02, 2006, 01:17:07 AM »
Tom,

Thanks but I wish I knew you were going to tackle it so I could have waited.  I think you'll like the "radar out" feature.  I was messing around with it this afternoon and thought I had a bug because I couldn't get rid of the symbol.  Turned out our radar really was down for maintenance and GR3 stops sending files when there are no updates, so checking the file times is very effective.  - Jim
Forum Search and Google can be your best friends

 Home of NSLog NexStorm Lightning Data Manager

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Posts: 5,936
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #4 on: November 02, 2006, 01:36:02 AM »
I put mine on hold because I had no weather to look at.   I guess now, I could have pointed at somewhere that did.... no sure why I didn't think of that then.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline saratogaWX

  • Global Moderator
  • Posts: 5,620
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #5 on: November 02, 2006, 01:48:56 AM »
Jim:

AWESOME!!  =D> :D :propellerhead:

I'd found László Zsidi GIF animation code too, and you've saved me a bunch of time trying to make this work.

I've used your code to put the GR3 radar thumbnail on my homepage.   



Thanks so much for sharing!!

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline FishDude

  • Bob
  • Posts: 291
  • Ontario, NY
    • OFA Weather Web
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #6 on: November 02, 2006, 11:46:40 AM »
Can you guys help the newbie? Where do I get the base images for this script? I love the cool animations but am struggling to get started! Had my WS for about a month now, having a blast learning all this stuff!

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,785
  • Mauston, WI, USA
    • Juneau County Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #7 on: November 02, 2006, 11:55:43 AM »
Fishdude,

We're running a program called GR Level 3 available at http://www.grlevelx.com/.  They have a trial version available, but I don't remember if that one will publish to the web or not.  I've really enjoyed the program.  - Jim
Forum Search and Google can be your best friends

 Home of NSLog NexStorm Lightning Data Manager

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,785
  • Mauston, WI, USA
    • Juneau County Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #8 on: November 02, 2006, 12:05:21 PM »
When I logged on to the forum this morning I noticed that the "radar out" symbol was showing, which was good because it really was intermittant.  The problem is that most of the frames in the animation had the symbol in a maroon color, but a couple came up bright red just like in the overlay. 

I seem to remember that there can be pallette problems when resizing, so that's probably where the issue is.  I'll have to do a little research today, but if anyone has experience with that, please let me know.  - Jim
Forum Search and Google can be your best friends

 Home of NSLog NexStorm Lightning Data Manager

Offline up10ad

  • Posts: 98
  • Pardon my driving, I'm reloading.
  • Delta, CO USA
    • Delta, CO Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #9 on: November 02, 2006, 01:14:39 PM »
Can someone offer a suggestion on GR3 web publishing?  I run GR3 on the same PC as my web server, and would like to publish the files without having to set up an ftp server :(.  Anyone found a way to have it just drop the files in a folder?
Rick
Have you joined USAWeatherFinder.com yet?


Offline saratogaWX

  • Global Moderator
  • Posts: 5,620
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #10 on: November 02, 2006, 03:26:25 PM »
I'm running GRLevel3 1.12, and there's no options to drop the file in a folder.. wish there was   :wink:

You could set up a local FTP  server on your webserver and ftp to 127.0.0.1 to put them into the folder you want.  BTW.. only the purchased version will do uploads.. the trial version won't publish.

Another small foible to keep in mind is publishing with the purchased version doesn't start when the program starts up -- it has to be started via the menu.  I suppose it's that way so you can run multiple copies with one publishing and another allowing you to explore other radar sites without disturbing the publishing.

Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 26,539
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #11 on: November 02, 2006, 04:01:02 PM »
Another small foible to keep in mind is publishing with the purchased version doesn't start when the program starts up -- it has to be started via the menu.  I suppose it's that way so you can run multiple copies with one publishing and another allowing you to explore other radar sites without disturbing the publishing.

Ken

Back when carterlake started with this I wrote an autostarter for GR3 that also starts FTP. PM me if you would like to try it.  On second thoughts it's probably better to just post the code for you AutoIt fans to convert.
« Last Edit: November 02, 2006, 04:08:43 PM by niko »

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #12 on: November 02, 2006, 05:46:05 PM »
Back when carterlake started with this I wrote an autostarter for GR3 that also starts FTP. PM me if you would like to try it.  On second thoughts it's probably better to just post the code for you AutoIt fans to convert.

I've been meaning to ask... can that be publicly (legally?) posted for others to use? I always like to share.  :wink:

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 26,539
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #13 on: November 02, 2006, 06:22:22 PM »
You can share it with anyone  :)  but I probably wouldn't post the version you have because it hard codes the startup directory of GR3 and the speed of sending keystrokes, both of which I had to customize for other users. I could make a new version with that info in an .ini file, but it might be better for someone who has GR3 to write an AutoIt script which could automate the GR3 window more directly. I didn't have access to GR3 so mine is a very unsophisticated button pusher.

Let>APP_TITLE=GRlevel3 Starter
RunProgram>C:\Program Files\GRLevelX\GRLevel3\grlevel3.exe
WaitWindowOpen>GRLevel3*
Wait>1
Press>ALT
Sen>F
Release>ALT
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Enter
Wait>2
Press>Enter
Wait>2
Press>Enter
Label>theend

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: PHP animated gifs for GR3 radar & other uses?
« Reply #14 on: November 02, 2006, 11:00:34 PM »
You can share it with anyone 

http://members.cox.net/carterlakeweather/grstart.zip

Quote
but I probably wouldn't post the version you have

What are they going to do? Yell at me?  :wink:

(Hey, if this doesn't work for you, Niko takes requests.  :D )
« Last Edit: November 02, 2006, 11:13:30 PM by carterlake »

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

 

cumulus