{"id":37063,"date":"2020-06-05T20:05:01","date_gmt":"2020-06-05T20:05:01","guid":{"rendered":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/?p=37063"},"modified":"2020-06-08T14:45:02","modified_gmt":"2020-06-08T14:45:02","slug":"using-geo2grid-to-create-animations","status":"publish","type":"post","link":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/37063","title":{"rendered":"Using geo2grid to create animations"},"content":{"rendered":"<div style=\"width: 625px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-37063-1\" width=\"625\" height=\"333\" loop preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/06\/GOES-16_ABI_airmass_20200602_1400_to_20200603_1640anim.mp4?_=1\" \/><a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/06\/GOES-16_ABI_airmass_20200602_1400_to_20200603_1640anim.mp4\">https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/06\/GOES-16_ABI_airmass_20200602_1400_to_20200603_1640anim.mp4<\/a><\/video><\/div>\n<p>GOES-16 Airmass RGB, 1400 UTC on 2 June 2020 to 1640 UTC on 3 June 2020<\/p>\n<p><a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/36990\">Severe weather occurred over the upper Midwest on 2 June 2020<\/a>, and a <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/37024\">derecho occurred over the mid-Atlantic States on 3 June 2020<\/a>. These two events were linked, and the animation above shows the system moving and redeveloping from Minnesota on 2 June 202 eastward to Pennsylvania on 3 June 2020. How was this animation created?<\/p>\n<p><a href=\"https:\/\/www.ssec.wisc.edu\/software\/geo2grid\/\">geo2grid<\/a> is a software packaged developed at <a href=\"https:\/\/cimss.ssec.wisc.edu\">CIMSS<\/a>. It is designed to produce high-quality full-resolution imagery from archived (or real-time) GOES-16\/GOES-17 Level-1b imagery. This blog post (a follow-up to <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/32318\">this <\/a>one) will outline how to use the software package to create imagery.\u00a0 Note that geo2grid runs on CentOS6-compatible Linux.\u00a0 There is no Windows version.\u00a0 Here are the steps used to create the imagery above.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>geo2grid software can be downloaded as a g-zipped tarball from <a href=\"http:\/\/download.ssec.wisc.edu\/files\/csppgeo\/\">this link<\/a>. (You may need to register &#8212; for free! &#8212; before downloading). Version 1.0.1 was released in March of 2020. You can also download documentation (always a good idea) as a pdf file from the download site, or you can <a href=\"https:\/\/www.ssec.wisc.edu\/software\/geo2grid\/\">access it online<\/a>.\u00a0 Once you have unzipped and untarred the software package, you&#8217;re ready to begin.\u00a0 Your unix system must know where the software package sits, and that&#8217;s through this command: <code>EXPORT GEO2GRID_HOME=\/path\/to\/Geo2GridSoftwareLocation\/<\/code><\/li>\n<li>Of course, you will also need data.\u00a0 For Advanced Baseline Imager (ABI) data, <strong>geo2grid expects Radiance fields<\/strong>.\u00a0 These can be accessed via NOAA CLASS, or via &#8220;The Cloud&#8221;, or from a GRB Receiving antenna.\u00a0 (some data sources are listed <a href=\"http:\/\/cimss.ssec.wisc.edu\/goes\/goesdata.html#data\">here<\/a>)\u00a0 NOAA CLASS ABI L1b Radiances data (ordered under &#8220;GOES-R Series ABI Products (GRABIPRD) (partially restricted L1b and L2+ Data Products) &#8221;\u00a0 )\u00a0 will have a file format that looks something like this:\u00a0 <code>OR_ABI-L1b-RadF-M6C08_G16_s20201542340169_e20201542349477_c20201542349544.nc<\/code> ; that particular file listed is Full Disk (the &#8216;F&#8217; in &#8216;RadF&#8217;) when GOES-16 was in Mode 6 (M6) scanning, and it contains Band 8 (C08);\u00a0 the start time is Year 2020, Day 154 (June 2 2020) at 23:40:16.<\/li>\n<li>As noted in <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/32318\">this blog post<\/a>, you can specify which fraction of the domain to display. geo2grid also has a mapping routine if you want to define your own domain (i.e., not a satellite projection, or a subset of that satellite projection), and documentation is under &#8216;Utility Scripts&#8217; at the geo2grid documentation site.\u00a0 To define a domain near the Great Lakes, for example, I used this command:\u00a0\u00a0 <code>$GEO2GRID_HOME\/bin\/p2g_grid_helper.sh PADERECHO -83.0 45.0 2000 -2000 1500 800 &gt; $GEO2GRID_HOME\/PADERECHO.conf<\/code> ;\u00a0 the shell scripts takes a grid name (PADERECHO in this case), a center longitude\/latitude (83.0 degrees West, 45.0 Degrees North), x- and y- grid-spacing in meters (2 km for this case), and the number of points in the x- and y- directions.\u00a0 These mapping instructions are placed in a configuration file;\u00a0 <code>cat $GEO2GRID_HOME\/PADERECHO.conf<\/code> will show this line in the file:\u00a0 <code>PADERECHO, proj4, +proj=lcc +datum=WGS84 +ellps=WGS84 +lat_0=45.00000 +lat_1=45.00000 +lon_0=-83.00000 +units=m +no_defs, 1500, 800, 2000.00000, -2000.00000, -104.24668deg, 50.40805deg<\/code> .\u00a0 It might take some trial and error using geo2grid to find the map domain that suits you best, but it is a simple matter to iterate to a solution.<\/li>\n<li>Next, run geo2grid.\u00a0\u00a0 The command I invoked (with small changes for each time) is here:\u00a0 <code>$GEO2GRID_HOME\/bin\/geo2grid.sh -r abi_l1b -w geotiff -p airmass -g PADERECHO --grid-configs $GEO2GRID_HOME\/PADERECHO.conf --method nearest --cache-dir=$GEO2GRID_HOME\/datacache\/ -f \/data-hdd\/PADerecho\/Day154\/14\/*1450*.nc<\/code> \u00a0 There are several flags included in this call, and they are explained in the documentation, but also here.\n<ul>\n<li>-r:\u00a0 What kind of data are being read?\u00a0 In this case, level-1b data from ABI<\/li>\n<li>-w:\u00a0 Output format (geotiff).\u00a0 That is the only option for imagery<\/li>\n<li>-p:\u00a0 What imagery should be created?\u00a0 In this case, airmass RGB.\u00a0 To find out what can be computed given the data present, user the &#8211;list-products flag.\u00a0 For the data I have downloaded, this returned C08, C10, C12, C13, C15, airmass:\u00a0 I had downloaded to the specified directory the components necessary to compute the airmass RGB (plus band 15).\u00a0 If you wanted to create imagery for all these channels in addition to the airmass RGB, <code>-p airmass C08 C10 C12 C13 C15<\/code> would work.\u00a0 (Note:\u00a0 C15 is not actually needed in the computation of the airmass RGB).<\/li>\n<li>-g:\u00a0 to what grid should these data be interpolated?\u00a0 The answer: the PADERECHO grid that is defined and specifed where &#8211;grid-configs points to:\u00a0 <code>$GEO2GRID_HOME\/PADERECHO.conf<\/code>;<\/li>\n<li>&#8211;method:\u00a0 what interpolation method should be used?\u00a0 For this case, nearest neighbor is specified.<\/li>\n<li>&#8211;cache-dir:\u00a0 This is used to speed processing.\u00a0 If you have multiple files being interpolated to the same grid, it speeds things to save the interpolation methods\/points.\u00a0 You have to specify the directory where this file will sit.<\/li>\n<li>-f:\u00a0 Where do the Radiance files sit?\u00a0 In this example I have placed different times in separate directories.\u00a0 I haven&#8217;t yet figured out how to use Geo2Grid that points to a directory where multiple times sit.<\/li>\n<\/ul>\n<\/li>\n<li>geo2grid includes scripts (&#8220;<code>add_coastlines.sh<\/code>&#8220;;\u00a0 for full documentation, see the &#8216;Utility Scripts&#8217; section in the geo2grid documentation)\u00a0 that will add maps to the imagery.\u00a0 <code>$GEO2GRID_HOME\/bin\/add_coastlines.sh --add-coastlines --coastlines-resolution=h --coastlines-level=4 GOES-16_ABI_RadF_airmass_20200602_152017_PADERECHO.tif<\/code>\u00a0 This command invoked only a few of the mapping additions, as described below.\u00a0 For a full list, refer to the documentation.\n<ol>\n<li>&#8211;add-coastlines ;\u00a0 as you might expect this flag adds coastlines.\u00a0 In the animation above, you&#8217;ll see that the coastlines include lakes.\u00a0 You can also add borders, grids (lat\/lon lines) and other features.<\/li>\n<li>&#8211;coastline-resolution=h ; I have asked for high resolution.<\/li>\n<li>&#8211;coastlines-level=4 ; This is the default level of detail in the lines.<\/li>\n<li>The .tif is the geotiff created from Geo2Grid.\u00a0 When add_coastlines.sh is finished, the filename <code>GOES-16_ABI_RadF_airmass_20200602_152017_PADERECHO.png<\/code> is created.<\/li>\n<\/ol>\n<\/li>\n<li>geo2grid does not annotate imagery.\u00a0 I use ImageMagick for that.\u00a0 (something like this:\u00a0 <code>convert GOES-16_ABI_RadF_airmass_20200603_163017_PADERECHO.png -gravity Northeast -fill white -pointsize 32 -annotate +8+40 \"3 June 2020 1630 UTC\" GOES-16_ABI_RadF_airmass_20200603_163017_PADERECHOannotate.png<\/code> )<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>A challenge in scripting geo2grid is that the start time of the files is not constant.\u00a0 For example, on 2 June, the 15:20 image starts at 15:20:17.1 (as shown above, the file name includes 152017) ; the 17:20 image starts at 17:20:16.9 and the created filenames include 172016.<\/p>\n<p>The completed animation is shown above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GOES-16 Airmass RGB, 1400 UTC on 2 June 2020 to 1640 UTC on 3 June 2020 Severe weather occurred over the upper Midwest on 2 June 2020, and a derecho occurred over the mid-Atlantic States on 3 June 2020. These two events were linked, and the animation above shows the system moving and redeveloping from [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":37089,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[74,45,39],"tags":[],"class_list":["post-37063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-goes-16","category-redgreenblue-rgb-images","category-training"],"acf":[],"_links":{"self":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/comments?post=37063"}],"version-history":[{"count":13,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37063\/revisions"}],"predecessor-version":[{"id":37103,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37063\/revisions\/37103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media\/37089"}],"wp:attachment":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media?parent=37063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/categories?post=37063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/tags?post=37063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}