Animating hurricane Ian satellite images​
​By Arnoud Buzing
After passing through Cuba last night, hurricane Ian is now bearing down on Florida near Tampa Bay. The National Oceanic and Atmospheric Administration (NOAA) operates a number of geostationary satellite which monitor the Earth’s atmosphere. This post shows how you can import imagery generated by these satellites and turn them into a video animation.
In[]:=
Video["https://www.wolframcloud.com/obj/8fde7222-7a0b-4014-b4a2-1001944d173d"]
Out[]=
First, create a directory where the satellite images are stored:
In[]:=
directory=FileNameJoin[{$HomeDirectory,"HurricaneIan"}];​​If[Not[FileExistsQ[directory]],CreateDirectory[directory]];​​directory//FileExistsQ
Out[]=
True
The following URL points to a bare-bones pages with all the image links that are needed. The images come in different sizes and go back several days.
In[]:=
links=Import["https://cdn.star.nesdis.noaa.gov/GOES16/ABI/CONUS/GEOCOLOR/","Hyperlinks"];​​Length[links]
Out[]=
25742
To get the images we are interested in, look for a string pattern in the URL that match links for today, and yesterday:
In[]:=
recent=Sort[​​Select[​​links,​​StringContainsQ["2022"~~(DateString[Yesterday,"ISOYearDay"]|DateString[Today,"ISOYearDay"])~~Repeated[_,4]~~"_GOES16-ABI-CONUS-GEOCOLOR-1250x750.jpg"]​​]];​​Length[recent]
Out[]=
506
The following code downloads the images from the NOAA web server to a local drive. It uses logic to implement caching, avoiding downloads of files you already have. It also throttles downloads, because the NOAA server has certain rate limits to prevent people from downloading too frequently:
In[]:=
PrintTemporary[Dynamic[u]];​​files=Map[​​Function[{url},​​u=url;​​file=FileNameJoin[{directory,FileBaseName[url]<>".jpg"}];​​If[​​Or[Not[FileExistsQ[file]],FileByteCount[file]<100000],​​Pause[.1];​​URLDownload[url,file]​​];​​file​​],​​recent​​];
With the downloaded files, it is easy to generate a video:
In[]:=
video=FrameListVideo[files,FrameRate->20];
This video can be published easily in the cloud:
In[]:=
CloudPublish[ExportForm[video,"MP4"],CloudObject["HurricaneIan.mp4"]]
Out[]=
CloudObject[
https://www.wolframcloud.com/obj/arnoudb/HurricaneIan.mp4
]

Forecast cones with GeoGraphics

links=Import["https://www.nhc.noaa.gov/gis/archive_forecast_results.php?id=al09&year=2022&name=Hurricane%20IAN","Hyperlinks"];
In[]:=
zips=Select[links,StringContainsQ["https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_"~~Repeated[_,3]~~".zip"]]
Out[]=
{https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_001.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_002.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_003.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_004.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_005.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_006.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_007.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_008.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_009.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_010.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_011.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_012.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_013.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_014.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_015.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_016.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_017.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_018.zip,https://www.nhc.noaa.gov/gis/forecast/archive/al092022_5day_019.zip}
In[]:=
CreateDirectory[FileNameJoin[{$HomeDirectory,"hurricane-ian"}]]
In[]:=
files=Map[​​URLDownload[#,FileNameJoin[{$HomeDirectory,"hurricane-ian",FileBaseName[#]<>".zip"}]]&,​​zips]
Out[]=
File
C:\Users\ahmed\hurricane-ian\al092022_5day_001.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_002.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_003.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_004.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_005.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_006.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_007.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_008.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_009.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_010.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_011.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_012.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_013.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_014.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_015.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_016.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_017.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_018.zip
,File
C:\Users\ahmed\hurricane-ian\al092022_5day_019.zip

In[]:=
Association[Import[First[files],{"Data",1}]]["Geometry"][[1]]
Out[]=
PolygonGeoPosition
Number of points: 1918
Lat bounds: {13.7,29.3}
Lon bounds: {-86.,-68.3}

In[]:=
polys=Map[Function[{file},Association[Import[file,{"Data",1}]]["Geometry"][[1]]],files];
In[]:=
Length[polys]
Out[]=
19
images=Map​​Function{poly},RasterizeGeoGraphics{GeoStyling[{Opacity[.5],Red}],poly},GeoRange->Quantity[1000,"Miles"],GeoProjection->"Orthographic",GeoCenter->
Cuba
COUNTRY
,GeoBackground->"ReliefMap",GeoZoomLevel->7,RasterSize->{1000,1000},​​polys;
In[]:=
video=FrameListVideo[images,FrameRate->2]
Out[]=