{"id":62118,"date":"2024-12-18T16:54:36","date_gmt":"2024-12-18T16:54:36","guid":{"rendered":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/?p=62118"},"modified":"2025-04-28T14:56:50","modified_gmt":"2025-04-28T14:56:50","slug":"using-polar2grid-to-display-nucaps-lapse-rates","status":"publish","type":"post","link":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/archives\/62118","title":{"rendered":"Using Polar2Grid to display NUCAPS Lapse Rates"},"content":{"rendered":"\n<p>This short tutorial will explain how Polar2Grid can show individual isobaric levels, and also lapse rates (dT\/dp) between two isobaric levels. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.ssec.wisc.edu\/software\/polar2grid\/\">Polar2Grid<\/a> is <a href=\"https:\/\/cimss.ssec.wisc.edu\/cspp\/\">CSPP software<\/a> designed to process files either from the NOAA <a href=\"https:\/\/www.noaa.gov\/information-technology\/open-data-dissemination\">NODD<\/a> (<a href=\"https:\/\/www.ncei.noaa.gov\/access\/metadata\/landing-page\/bin\/iso?id=gov.noaa.ncdc:C01450\">EDR<\/a> files for NOAA-20 are <a href=\"https:\/\/noaa-nesdis-n20-pds.s3.amazonaws.com\/index.html#NUCAPS-EDR\/\">here<\/a>;  EDR files for NOAA-21 are <a href=\"https:\/\/noaa-nesdis-n21-pds.s3.amazonaws.com\/index.html#NUCAPS-EDR\/\">here<\/a>) or from Direct Broadcast antenna data streams.  Polar2grid creates reprojected imagery.  In this example, I decided to work with data over the western United States.  The NOAA-20 orbits on 18 December (<a href=\"https:\/\/www.ssec.wisc.edu\/datacenter\/polar_orbit_tracks\/data\/JPSS-1\/2024\/2024_12_18_353\/NA.gif\">here<\/a>, from <a href=\"https:\/\/www.ssec.wisc.edu\/datacenter\/polar_orbit_tracks\/\">this website<\/a>), show a descending pass over the Rockies, from the USA-Canada border at 0938 UTC to Los Angeles at about 0943 UTC.  The data for this were downloaded from the AWS Cloud for NOAA-20, and a list of the files is shown below.  Times for the granules listed start at 09:37:22.9 and end at 09:43:44.7.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(base) &#91;scottl@machine NUCAPSData]$ ls -1\nNUCAPS-EDR_v3r2_j01_s202412180937229_e202412180937527_c202412181021100.nc\nNUCAPS-EDR_v3r2_j01_s202412180937549_e202412180938247_c202412181022030.nc\nNUCAPS-EDR_v3r2_j01_s202412180938269_e202412180938567_c202412181021170.nc\nNUCAPS-EDR_v3r2_j01_s202412180938589_e202412180939287_c202412181022310.nc\nNUCAPS-EDR_v3r2_j01_s202412180939309_e202412180940007_c202412181021180.nc\nNUCAPS-EDR_v3r2_j01_s202412180940029_e202412180940327_c202412181021580.nc\nNUCAPS-EDR_v3r2_j01_s202412180940349_e202412180941047_c202412181023480.nc\nNUCAPS-EDR_v3r2_j01_s202412180941069_e202412180941367_c202412181023040.nc\nNUCAPS-EDR_v3r2_j01_s202412180941389_e202412180942087_c202412181023430.nc\nNUCAPS-EDR_v3r2_j01_s202412180942109_e202412180942407_c202412181023470.nc\nNUCAPS-EDR_v3r2_j01_s202412180942429_e202412180943127_c202412181023120.nc\nNUCAPS-EDR_v3r2_j01_s202412180943149_e202412180943447_c202412181023480.nc\n(base) &#91;scottl@machine NUCAPSData]$ \n<\/code><\/pre>\n\n\n\n<p>The variables that can be displayed using polar2grid and those files is quite long.  If you were to download the files, and run the following command: <code> .\/polar2grid.sh -r nucaps -w geotiff --list-products-all -f \/path_to_files\/NUCAPS*.nc <\/code>, you would see the many possibilities.  For this blog post, I&#8217;m choosing Temperature_802mb and Temperature_596mb. <\/p>\n\n\n\n<p>By default, polar2grid will rescale the plotted temperatures based on the range it finds.  I want to have the same scale used for both levels here, and to do that, I have to tell polar2grid.  This is done by adding a <code>cris.yaml<\/code> file into the directory  <code>polar2grid_v_3_1\/etc\/polar2grid\/enhancements\/<\/code>, which directory is created as part of the polar2grid install process.  The contents of the cris.yaml file that I created are below.  I&#8217;ve mandated that both 802-mb temperatures and 596-mb temperatures be scaled from 240 to 300 K.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1112\" height=\"372\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/Enhancements_cris.yaml_-1.png\" alt=\"\" class=\"wp-image-64414\" srcset=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/Enhancements_cris.yaml_-1.png 1112w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/Enhancements_cris.yaml_-1-300x100.png 300w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/Enhancements_cris.yaml_-1-1024x343.png 1024w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/Enhancements_cris.yaml_-1-768x257.png 768w\" sizes=\"auto, (max-width: 1112px) 100vw, 1112px\" \/><figcaption class=\"wp-element-caption\">Contents of the cris.yaml file in the enhancements directory (See Note at bottom)<\/figcaption><\/figure>\n\n\n\n<p>I also want to display these data on a map of my choosing (rather than the native NOAA-20 orbital map).  Polar2grid allows a user to define a map with the <code>p2g_grid_helper.sh<\/code> shell script below; the script expects a grid name (CANucaps), a center longitude and latitude (115 W, 35 N), grid spacings in m (4000\/-4000) and grid sizes (960&#215;720).  The output here is put into a yaml file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/p2g_grid_helper.sh CANucaps -115.0 35.0 4000 -4000 960 720 &gt; CANucaps.yaml\n<\/code><\/pre>\n\n\n\n<p>Next, I call polar2grid to make imagery, color-enhance it, and add coastlines and a colorbar, shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>..\/polar2grid.sh -r nucaps -w geotiff -p Temperature_802mb Temperature_596mb -g CANucaps --grid-configs .\/CANucaps.yaml -f \/path_to_NUCAPSData\/*\n.\/add_colormap.sh ..\/..\/colormaps\/p2g_sst_palette.txt j01_atms-cris_Temperature_802mb_20241218_093722_CANucaps.tif\n.\/add_colormap.sh ..\/..\/colormaps\/p2g_sst_palette.txt j01_atms-cris_Temperature_596mb_20241218_093722_CANucaps.tif\n.\/add_coastlines.sh --add-coastlines --add-colorbar --colorbar-text-size 16 j01_atms-cris_Temperature_802mb_20241218_093722_CANucaps.tif\n.\/add_coastlines.sh --add-coastlines --add-colorbar --colorbar-text-size 16 j01_atms-cris_Temperature_596mb_20241218_093722_CANucaps.tif\n<\/code><\/pre>\n\n\n\n<p>The resultant imagery is shown in a toggle below.  I didn&#8217;t label the imagery, but I hope you can tell which field is 802mb, and which is 596mb!  The colorbar automatically scales to the values specified in the <code>cris.yaml<\/code> file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_Temperature_802_596mb_20241218_093722_CANucaps_toggle.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"720\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_Temperature_802_596mb_20241218_093722_CANucaps_toggle.gif\" alt=\"\" class=\"wp-image-62122\"\/><\/a><figcaption class=\"wp-element-caption\">NOAA-20 Estimates of Temperature at 802 mb and 596 mb, 0937 UTC on 18 December 2024 (Click to enlarge)<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Next, I decided I wanted to compute and plot the temperature difference between 802 and 596 mb.  That requires additions to two files within the polar2grid distribution.  A cris.yaml file is needed in (polar2grid_v_3_1\/etc\/polar2grid\/composites\/), with contents as shown below.  I defined the parameter (lapse802_596) as using the <code>DifferenceCompositor<\/code> that requires two fields.  Then, in the enhancements directory (polar2grid_v_3_1\/etc\/polar2grid\/enhancements\/) I scaled the field to be between 4 and 25K.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"282\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/composites_cris.yaml_.png\" alt=\"\" class=\"wp-image-62124\" srcset=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/composites_cris.yaml_.png 734w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/composites_cris.yaml_-300x115.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption class=\"wp-element-caption\">Contents of the cris.yaml file in the composites directory<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"336\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/enhancements_generic.yaml_.png\" alt=\"\" class=\"wp-image-62125\" srcset=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/enhancements_generic.yaml_.png 734w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/enhancements_generic.yaml_-300x137.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption class=\"wp-element-caption\">lapse802_596 defined in the generic.yaml file within the enhancements directory<\/figcaption><\/figure>\n\n\n\n<p>If I ran polar2grid now, and pointed to the NUCAPS data directory, and asked it to &#8211;list-products-all &#8212; I would see a new possibility!  lapse802_596.  The three polar2grid calls below,<\/p>\n\n\n\n<p>.\/polar2grid.sh -r nucaps -w geotiff -p lapse802_596 -g CANucaps &#8211;grid-config .\/CANucaps.yaml -f \/path_to_NUCAPSData\/*<\/p>\n\n\n\n<p>.\/add_colormap.sh ..\/..\/colormaps\/p2g_sst_palette.txt j01_atms-cris_lapse802_596_20241218_093722_CANucaps.tif<\/p>\n\n\n\n<p>.\/add_coastlines.sh &#8211;add-coastlines &#8211;add-colorbar &#8211;colorbar-text-size 16 j01_atms-cris_lapse802_596_20241218_093722_CANucaps.tif<\/p>\n\n\n\n<p>The result of those three calls is shown below.  The steepest lapse rates are off the coast of California and in northwestern Mexico.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_lapse802_596_20241218_093722_CANucapsW.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"720\" src=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_lapse802_596_20241218_093722_CANucapsW.png\" alt=\"\" class=\"wp-image-62126\" srcset=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_lapse802_596_20241218_093722_CANucapsW.png 960w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_lapse802_596_20241218_093722_CANucapsW-300x225.png 300w, https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/j01_atms-cris_lapse802_596_20241218_093722_CANucapsW-768x576.png 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><figcaption class=\"wp-element-caption\">NUCAPS Lapse Rates, 802-596 mb, 0937 UTC on 18 December 2024 (Click to enlarge)<\/figcaption><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Note:  An earlier version of this blog post had a different cris.yaml file in it;  <a href=\"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-content\/uploads\/sites\/5\/2024\/12\/enhancements_cris.yaml_.png\">in that one<\/a>, none of the named temperatures (that were mispelled!!) included a <strong>name:<\/strong> identifier\/match criterion.  As a result, all cris variables (including derived ones!) had the same stretched values in computed color bars.  <\/p>\n\n\n\n<p>Thanks to Dave Hoese, CIMSS, for helping me figure this out!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This short tutorial will explain how Polar2Grid can show individual isobaric levels, and also lapse rates (dT\/dp) between two isobaric levels. Polar2Grid is CSPP software designed to process files either from the NOAA NODD (EDR files for NOAA-20 are here; EDR files for NOAA-21 are here) or from Direct Broadcast antenna data streams. Polar2grid creates [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":62126,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[78,83,109,39],"tags":[],"class_list":["post-62118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-noaa-20","category-nucaps","category-software","category-training"],"acf":[],"_links":{"self":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/62118","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=62118"}],"version-history":[{"count":9,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/62118\/revisions"}],"predecessor-version":[{"id":64445,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/posts\/62118\/revisions\/64445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media\/62126"}],"wp:attachment":[{"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/media?parent=62118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/categories?post=62118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cimss.ssec.wisc.edu\/satellite-blog\/wp-json\/wp\/v2\/tags?post=62118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}