Author Topic: Archive Radar Images?  (Read 1837 times)

0 Members and 1 Guest are viewing this topic.

Offline Farmtalk

  • Fitzweather
  • Forecaster
  • *****
  • Posts: 4745
    • WV Waterfalls
Archive Radar Images?
« on: February 22, 2015, 10:02:07 PM »
Hello all, it's been about a month since I have been here due to school, but during breaks, I will make my rounds!  8-)
I have been wanting to complete a project of mine, but have yet to succeed. I got a 1 terrabyte external hard drive for Christmas as my gift this year. I currently have a personal laptop solely dedicated to running and uploading GR3 to my website, but I only upload one image per product at a time because I do not use the scripts here (As an example, refer to the homepage of my site). So basically, when a new radar image comes in, it replaces the old one, and so the old one is deleted. What I am wanting to do is somehow automate a way to archive EVERY image so that, say a couple months from now, I can look at all of my image files from my radar if I'm wanting to analyze weather during a certain day.

Would anyone know if this is possible?

Thank you all!  8-)
Joe Fitzwater
Chief Meteorologist for WVNS-TV 59 in Beckley, WV

Work Page on Facebook -> www.facebook.com/meteojoe
Work Page on Twitter -> https://twitter.com/meteojoe
Waterfalls -> www.wvfalls.com

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Re: Archive Radar Images?
« Reply #1 on: March 02, 2015, 11:19:46 PM »
Are you saving an image somewhere? I have batch file that has been saving archives of WASP2 images for a few years now.
Precious little in your life is yours by right and won without a fight.

Offline Farmtalk

  • Fitzweather
  • Forecaster
  • *****
  • Posts: 4745
    • WV Waterfalls
Re: Archive Radar Images?
« Reply #2 on: March 03, 2015, 01:58:02 AM »
It sounds like you are doing with your images what I am WANTING to do with mine. I'm just not real sure on how to get started.
Joe Fitzwater
Chief Meteorologist for WVNS-TV 59 in Beckley, WV

Work Page on Facebook -> www.facebook.com/meteojoe
Work Page on Twitter -> https://twitter.com/meteojoe
Waterfalls -> www.wvfalls.com

Offline ocala

  • Forecaster
  • *****
  • Posts: 4396
  • The blues had a baby and named it rock n roll
Re: Archive Radar Images?
« Reply #3 on: March 03, 2015, 05:36:40 AM »
Joseph are you sure the images aren't saved? I think they might be but GR doesn't have the option to go back and review those images.
I think.

Offline WeatherHost

  • Forecaster
  • *****
  • Posts: 3649
Re: Archive Radar Images?
« Reply #4 on: March 03, 2015, 07:20:55 AM »
There are a certain number of files in your GR directory if you can read the dates.  They don't get overwritten that I know of even though GR only displays a limited number.

There is also an archive site where you can get the raw files for any radar site going back several years.  Darn if I can remember the URL or download and conversion process right now, but it's discussed on the GR forum.


Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Archive Radar Images?
« Reply #5 on: March 03, 2015, 09:48:13 AM »
Well I had a similar issue and what I did is I wrote a PHP script, which simply not just displays, but also makes a copy of the image and saves that on the server, from where I can download it whenever I want to.

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: Archive Radar Images?
« Reply #6 on: March 03, 2015, 12:22:43 PM »
Here is the link Weatherhost was speaking of:

http://has.ncdc.noaa.gov/pls/plhas/has.dsselect

You can get both Level 2 and Level 3 data here.

John
GR2AE, GR3, Cumulus

Offline Farmtalk

  • Fitzweather
  • Forecaster
  • *****
  • Posts: 4745
    • WV Waterfalls
Re: Archive Radar Images?
« Reply #7 on: March 03, 2015, 01:32:02 PM »
Hello again everybody! Maybe I should be a little clearer of what I'm wanting to do. As far as I know, GR will save 10 images at a time for a single radar product to where it will fit in the animation script that Ken provides for the website. What I am wanting to do is be able to save those images to another folder before they are rewritten by the next radar frame that is created. Does this make sense?
Joe Fitzwater
Chief Meteorologist for WVNS-TV 59 in Beckley, WV

Work Page on Facebook -> www.facebook.com/meteojoe
Work Page on Twitter -> https://twitter.com/meteojoe
Waterfalls -> www.wvfalls.com

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Archive Radar Images?
« Reply #8 on: March 03, 2015, 01:46:25 PM »
Yes it does make sense and I think it would be possible to do exactly what I did and use PHP to just simply save a copy on the server

Offline Farmtalk

  • Fitzweather
  • Forecaster
  • *****
  • Posts: 4745
    • WV Waterfalls
Re: Archive Radar Images?
« Reply #9 on: March 04, 2015, 12:30:37 AM »
It looks like TNET has the right idea over on the Weather Watch thread. Just unsure of how to get started with it. I WILL get it figured out though with time  8-)

http://www.weather-watch.com/smf/index.php?topic=28590.0;wap
Joe Fitzwater
Chief Meteorologist for WVNS-TV 59 in Beckley, WV

Work Page on Facebook -> www.facebook.com/meteojoe
Work Page on Twitter -> https://twitter.com/meteojoe
Waterfalls -> www.wvfalls.com

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Re: Archive Radar Images?
« Reply #10 on: March 05, 2015, 11:38:44 PM »
It sounds like you are doing with your images what I am WANTING to do with mine. I'm just not real sure on how to get started.

WASP2 creates an image every 10 minutes, the following is called every minute and archives that image every 10 minutes to the local drive, a mapped network share and uploads it to my website via ftp. It would likely need some heavy modification to work for you, if I can find the time I may be able to make it more generic so it would be easier to adapt for other uses.

Code: [Select]
@echo off
: ======================================================================
:
: A batch file to check the creation date of the file and archive if
: a new file has been created. This allows this batch to be called more
: often than the target file is being created.
:
: ======================================================================

FOR %%i IN (.\upload\wasp2.png) DO SET wasp2name=%%~ti
SET wasp2tmp=%wasp2name:~-6,2%
IF "%wasp2tmp:~-3,2%"=="12" SET wasp2tmp=00
IF "%wasp2name:~-1,1%"=="a" GOTO NAMEIT
IF "%wasp2tmp:~-2,1%"=="0" SET wasp2tmp=%wasp2tmp:~-1,1%
SET /A wasp2tmp=%wasp2tmp%+12

:NAMEIT
SET wasp2name=wasp2-20%wasp2name:~-9,2%%wasp2name:~-15,2%%wasp2name:~-12,2%%wasp2tmp%%wasp2name:~-3,2%
SET wasp2tmp=
:ECHO %DATE% %TIME:~-11,8% Checking for %wasp2name%.png >> upload.log
IF EXIST .\archive\%wasp2name:~-12,4%\%wasp2name:~-8,2%\%wasp2name%.png GOTO done
:ECHO %DATE% %TIME:~-11,8% Copying new file >> upload.log
:For the local archive...
IF NOT EXIST .\archive\%wasp2name:~-12,4%\nul MD .\archive\%wasp2name:~-12,4%
IF NOT EXIST .\archive\%wasp2name:~-12,4%\%wasp2name:~-8,2%\nul MD .\archive\%wasp2name:~-12,4%\%wasp2name:~-8,2%
COPY .\upload\wasp2.png .\archive\%wasp2name:~-12,4%\%wasp2name:~-8,2%\%wasp2name%.png

:For the network archive, we can't use NUL to test if the directories exist...
dir %E:\archive\Wasp2\%wasp2name:~-12,4% >nul 2>nul
if errorlevel 1 ( MD E:\archive\Wasp2\%wasp2name:~-12,4% )
dir %E:\archive\Wasp2\%wasp2name:~-12,4%\%wasp2name:~-8,2% >nul 2>nul
if errorlevel 1 ( MD E:\archive\Wasp2\%wasp2name:~-12,4%\%wasp2name:~-8,2% )
COPY .\upload\wasp2.png E:\archive\Wasp2\%wasp2name:~-12,4%\%wasp2name:~-8,2%\%wasp2name%.png
GOTO FTPDO

:FTPCHK
IF NOT %wasp2ftp%==1 GOTO DONE
:FTPDO
start /MIN ftp -s:upload.scr weather.stadhaugh.com
SET %wasp2ftp%=
IF NOT %errorlevel%==0 GOTO FTPLOG
SET %wasp2ftp%=1
ECHO %DATE% %TIME:~-11,8% Upload failed >> upload.log
GOTO DONE
:FTPLOG
ECHO %DATE% %TIME:~-11,8% Uploaded %wasp2name%.png >> upload.log
:DONE
SET wasp2name=
:ECHO %DATE% %TIME:~-11,8% Done >> upload.log
:ECHO. >> upload.log
EXIT


It is best run as a different user to avoid a cmd window popping up every time it runs.
Precious little in your life is yours by right and won without a fight.