README FIRST!!!
This is a SLOweather script to create an animated GIF which has been modified by
SE Lincoln Weather to animate satellite images. Best use for this size animation
is in 'index.php' of Saratoga Dashboard and alternates in place of the now defunct
WU satellite animation. Other size animations up to 720px should be able to be created,
and this has been tested.
Installation: The current script(s) are configured to be placed in your site's
root directory, while the 'satelliteexample.gif' should be placed in whatever
you designate as your $cache directory.
IMPORTANT!!!!
In order to generate the animaged gif with fresh images,
create a cron job to run this script at 18 and 48 minutes after the hour for 'east/' GOES
and 04 and 34 after the hour for 'west/' GOES. This updates the images within a few
minutes of their actual creation by NOAA while ensuring that the new images should be present.
Blank images may result if earlier update minutes are selected.
Because of file renaming, the sample image,'satelliteexample.gif', must initially reside
in your $cache directory in order initialize this script on first run,
so the necessary files will all be created and don't need to pre-exist.
The $satType is incorporated into the created files' names. You can then use
the animation however you see fit. See your cache directory for the
'satellite???-anim.gif' filenams.
This script bogged down terribly when I tried to run it on my shared-hosting GoDaddy site.
For this reason I now run it locally on an apache server and then immediately upload the
new files to my website's cache directory, still via Fling. The seven hour animation is
generally around 400KB in size when using a 320px width, so plan accordingly. Individual
320x240 images are around 30KB in size.
It's possible to generate more than one satellite animation by setting the $satType to a different
Satellite and Region and then saving this file with a new name, like
'Satellite-GifAnimator-ir4.php' for an 'Infrared 4' series or 'Satellite-GifAnimator-rb.php' for
a 'Rainbow' series. Of course this additional animation will require its own cron job.
The Directories of the primary images are at '
http://www.ssd.noaa.gov/goes/east/cp/img?C=M;O=D' for
GOES East Central Plains images for example, or '
http://www.ssd.noaa.gov/goes/west/cp/img?C=M;O=D' for
the GOES West Central Plainsd images. Etc. The variables '?C=M;O=D' arrange the directory by time
with the latest files first.
At times the GOES system will not have a new image every half hour, at least it happened on GOES West only
between 900Z and 1200Z 13 Feb 2016. When the script encounters a missing image, it automatically seeks the
previous image. This may lead to duplicate images in the animation, but I think this is preferable to
black images. This algorithm also avoids blank images due to mis-timed image downloads.
In Summary:
1) Review and change the settings in any of the files to suit your needs. Create a separate
$cache, (now '/cachetest/') directory wherever you use the *-test.php scripts.
2) Place a 'satelliteexample.gif' in your $cache directory or directories.
3) Place all of the .php scripts in the root of your site/testing site.
4) Create cron jobs to run the scripts you intend to use.
5) Allow enough time to pass so that the animation(s) will be fully populated
with fresh images before you actually go live with the animation(s).
This text, except the Summary and beyond, currently prefaces all of the Animator script files within the attached zip.
The animation along with the individual images can be seen
here and
here. The script is currently unversioned.
New zip now ready. It successfully traversed midnight GMT today using GOES East. The GOES West animation is more problematic because sometimes images aren't updated every half hour which can cause black images. Delayed posting of images by NOAA can
also produce black images, which happened just after I posted the latest zip.