Create customized weather satellite movies

Oct 28, '05 06:33:00AM

Contributed by: rjbailey

The NOAA Geostationary Satellite Server stores three weeks' worth of images on their website. They have a menu-based image server to browse through the archives, but for batch downloading images, you need to use other tools -- I found the Unix utility curl to be useful. It performs basic wildcarding and brace expansion, so you can download an entire day's worth of images using this feature. For instance, here's how you'd grab all the images of Hurricane Wilma crossing Florida on Monday. In Terminal (and probably in a new directory, just to keep the images separated from your other files), type this command:

curl -O "http://www.goes-arch.noaa.gov/HUIR05297[00-23]{15,45}.GIF"
This will grab all 48 images from Monday, and download them into the new directory. From there, it's easy to assemble these images into spectacular time-lapse movies of any length you want. Use Quicktime Player (Pro version only) and choose File: Open Image Sequence, and just select the first image in the folder. Set a frame rate, click OK, and watch your movie magically appear.

[robg adds: I've modified the curl command quite a bit from what was submitted so as to only grab the 48 images that exist for a given day. There are also some third-party apps that can assemble images into a QuickTime movie; check VersionTracker or MacUpdate and try searching on QuickTime movie or somesuch. Read the rest of the hint if you'd like to know more about how this particular trick works, and how to grab images from different satellites and/or days. The 'addendum' is my writing, not that of rjbailey...]

First, a bit about how that curl command works. I'll break it down into its component pieces for an easier explanation:

So when curl runs, it will expand the [ ] and { } sections as appopriate, and then grab those files from the server: That's how you wind up with just the 48 images from Monday's hurricane satellite on your drive. But how do you actually find the images' URL in the first place? That part's a bit trickier. On the NOAA Geostationary Satellite Server homepage, there are a series of links on the left-hand side of the page. Two of these are for archives; the GOES East Archive and the GOES West Archive. Clicking either of these links will take you to a search page where you can specify the exact sector (satellite), channel (image type), day, week, and time for an image you'd like to retrieve. To work backwards through our hurricane example, select the GOES East Archive, and then search for: When the search is done, you should be looking at a satellite image on your screen, along with some explanatory text. Control-click on the image and choose Copy Image Address (in Safari; other browsers have a similar option in their contextual menus). Open a new tab or window, and paste the address. You should see:

http://www.goes-arch.noaa.gov/HUIR052970015.GIF

Presto; that's exactly the URL we used for our first image. The next step is to go back to the search screen, and see exactly what times images are available. In the case of the hurricane images the Times search field shows them coming out every 30 minutes, on the 15 and the 45. Based on that, I built the above curl syntax using a bit of trial and error. Other satellites will have different times, so you'll have to modify the curl code somewhat to only grab the pictures you wish to see. The satellite that covers the west coast, for instance, takes pictures at 00 and 30.

You can also modify the curl code to grab more than one day's worth of images:
curl -O "http://www.goes-arch.noaa.gov/HUIR05[295-298][00-23]{15,45}.GIF"
That command will grab the images for a four-day period, covering Saturday through Tuesday.

Note: Grabbing hundreds of images at a time from a given server can be considered a Bad Thing To Do. Treat the servers nicely, and try not to put a huge load on them by grabbing lots and lots and lots of images ... otherwise, you may discover that your IP address no longer works on a given server (when the sys admin blocks it).

You can really do a lot with curl and its character replacement abilities; just make sure you construct your queries carefully so that you're not requesting a ton of files that don't exist -- otherwise, you'll get a 4KB 'empty' file for each non-existent file you try to download.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051024092018253