{"id":37391,"date":"2020-07-03T14:57:22","date_gmt":"2020-07-03T14:57:22","guid":{"rendered":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/?p=37391"},"modified":"2020-07-03T15:11:36","modified_gmt":"2020-07-03T15:11:36","slug":"applying-enhancements-to-geo2grid-imagery","status":"publish","type":"post","link":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/37391","title":{"rendered":"Applying enhancements to Geo2Grid imagery"},"content":{"rendered":"<div id=\"attachment_37408\" style=\"width: 635px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO_Coastline_Colorbar_Enhanced_Annotated.step_.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-37408\" class=\"wp-image-37408\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO_Coastline_Colorbar_Enhanced_Annotated.step_.gif\" alt=\"\" width=\"625\" height=\"333\" \/><\/a><p id=\"caption-attachment-37408\" class=\"wp-caption-text\">GOES-16 ABI Band 13 (10.3 \u00b5m) Infrared Imagery from 1550 UTC on 2 July 2020, with color enhancement added, and with annotated colorbar (Click to enlarge)<\/p><\/div>\n<p><a href=\"https:\/\/www.ssec.wisc.edu\/software\/geo2grid\/\">geo2grid <\/a>(see <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/37063\">this recent blog post<\/a>) is a handy software package that allows anyone to create useful satellite imagery. Recent blog posts that document how to use geo2grid have shown visible or red-green-blue (RGB) composites. Individual infrared bands can also provide useful information, and this blog posts describes how you can create infrared imagery to which a useful color enhancement has been applied.<\/p>\n<p>Step 1, as always, is to find data. NOAA CLASS has archived <strong>Level-1b Radiance files<\/strong>; these are the data that geo2grid expects, and the naming convention of the files is also what geo2grid expects. Amazon Cloud Services can also offer correctly-named data. (This blogger is aware of some users who have retrieved data from Google, and those files did not follow the expected naming convention).<\/p>\n<p>The animation above compares an infrared image from 1550 UTC on 2 July over the northern part of the United States. The grid is described in <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/37063\">this blog post<\/a> and was used for convenience. (Of some importance: The grid created has dimensions of 1500&#215;800). The <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO-Coastlines.png\">original grey-scaled image is shown (with coastlines overlain)<\/a>, <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO_Coastline_Colorbar_Enhanced.png\">then a color enhancement is applied<\/a>, and finally a script is run to <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO_Coastline_Colorbar_Enhanced_Annotated.png\">annotate the colorbar<\/a>.<\/p>\n<p>The geo2grid command used to start the image creation was:<\/p>\n<p><code>.\/geo2grid.sh -r abi_l1b -w geotiff -p C13 -g PADERECHO --grid-configs $GEO2GRID_HOME\/PADERECHO.conf --method nearest -f \/arcdata\/goes_restricted\/grb\/goes16\/2020\/2020_07_02_184\/abi\/L1b\/RadF\/OR_ABI-L1b-RadF-M6C13_G16_s20201841550211_e20201841559531_c20201841600013.nc<\/code><\/p>\n<p>This creates a Band 13 (the <code>-p C13 flag<\/code>) grey-scaled geotiff (<code>-w geotiff<\/code>) from data at the archive site specified ( <code>-f \/arcdata\/goes_restricted\/....\/OR_ABI-L1b-RadF-M6C13_G16_s20201841550211_e20201841559531_c20201841600013.nc<\/code> ), reading Advanced Baseline Imagery Level-1b imagery (the <code>-r abi_l1b<\/code> flag), and using nearest-neighbor interpolation to a pre-defined grid (&#8220;PADERECHO&#8221;) to transform the projection from the default satellite projection (That&#8217;s this part of the command: <code>-g PADERECHO --grid-configs $GEO2GRID_HOME\/PADERECHO.conf --method nearest<\/code>). Note that by default, the geotiff created is 8-bit (in contrast to the 11-bit imagery; some information is lost.) You can create geotiffs with full bit depth. For this example an 8-bit image is being created.<\/p>\n<p>The add_colorbar shell applies a color enhancement to the grey-scaled geotiff image that geo2grid creates. For the image in this blog post, I used this invocation:<\/p>\n<p><code>.\/add_colormap.sh ..\/..\/enhancements\/IR4AVHRR100_colortable.txt GOES-16_ABI_RadF_C13_20200702_155021_PADERECHO.tif<\/code><\/p>\n<p>This colorbar must be pre-defined by the user. The format of the colortable (&#8220;IR4AVHRR100_colortable.txt&#8221;) is a comma-separated list of greyscale values (0-255 for the 8-bit geotiff that is created) followed by Red, Green, Blue and Transparency values. (Documentation is <a href=\"https:\/\/www.ssec.wisc.edu\/software\/geo2grid\/utilscripts.html\">here<\/a>. The file used for this example is <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2020\/07\/IR4AVHRR100_colortable.txt\">here <\/a>&#8212; courtesy of Jim Nelson, CIMSS) The colortable is applied to the geotiff image and a separate image (.png in this case) is created. You will note that this bi-linear enhancement is various shades of grey for bit values 0-152, then different colors for values 153-255.<\/p>\n<p>How do you associate the color with a temperature? For a bi-linear enhancement as used for Band 13, this is not simple. With knowledge of the calibration used, or with access to a system (such as <a href=\"https:\/\/www.ssec.wisc.edu\/mcidas\/software\/x\/\">McIDAS-X<\/a> or <a href=\"https:\/\/www.ssec.wisc.edu\/mcidas\/software\/x\/\">McIDAS-V<\/a>) that includes the calibration, it is possible to associate the greyscale values with temperature values and then use annotation software such as ImageMagick to write in values, with a command such as:<\/p>\n<p><code>convert INPUTFIELD_with_Coastline_Colorbar_Enhanced.png -fill white -pointsize 24 -annotate +997+28 \"-30\" InputField_with_CoastLine_Colorbar_enhanced_-30Label.png<\/code><\/p>\n<p>This must be done for each label you want to add to the image, but a shell script does this easily, and once done, you have something that you can use for any image that is the same size: 1500 pixels wide.  The spacing between the -30\u00baC, -40\u00baC, -50\u00baC&#8230; labels on the color bar is constant in this example.  Thus, once two values are known and placed, it&#8217;s simple to compute the offsets for the other temperature values.<\/p>\n<p><a href=\"https:\/\/www.ssec.wisc.edu\/software\/polar2grid\/index.html\">Polar2Grid <\/a>colorbar functionality is a bit more comprehensive than Geo2Grid.  When a colorbar is created in Polar2Grid, metadata on the minimum and maximum values are inserted into the geotiff.  This allows automatic generation of colorbar labels (<strong>for a linear scaling only<\/strong>) as shown in <a href=\"https:\/\/www.ssec.wisc.edu\/software\/polar2grid\/examples\/acspo_example.html\">this excellent example of documentation!<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>geo2grid (see this recent blog post) is a handy software package that allows anyone to create useful satellite imagery. Recent blog posts that document how to use geo2grid have shown visible or red-green-blue (RGB) composites. Individual infrared bands can also provide useful information, and this blog posts describes how you can create infrared imagery to [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":37409,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[74,80,39],"tags":[],"class_list":["post-37391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-goes-16","category-goes-17","category-training"],"acf":[],"_links":{"self":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37391","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=37391"}],"version-history":[{"count":20,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37391\/revisions"}],"predecessor-version":[{"id":37425,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/37391\/revisions\/37425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media\/37409"}],"wp:attachment":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media?parent=37391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/categories?post=37391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/tags?post=37391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}