{"id":240,"date":"2016-01-15T05:32:11","date_gmt":"2016-01-15T05:32:11","guid":{"rendered":"https:\/\/existencia.org\/pro\/?p=240"},"modified":"2016-01-15T05:35:35","modified_gmt":"2016-01-15T05:35:35","slug":"tropict-a-clearer-depiction-of-the-tropics","status":"publish","type":"post","link":"https:\/\/existencia.org\/pro\/?p=240","title":{"rendered":"Tropict: A clearer depiction of the tropics"},"content":{"rendered":"<p>Tropict is a set of python and R scripts that adjust the globe to make land masses in the tropics fill up more visual real estate.  It does this by exploiting the ways continents naturally &#8220;fit into&#8221; each other, splicing out wide areas of empty ocean and nestling the continents closer together.<\/p>\n<p>All Tropict scripts are designed to show the region between 30&deg;S and 30&deg;N.  In an equirectangular projection, that looks like this:<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/original.png\" rel=\"attachment wp-att-244\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/original-1024x171.png\" alt=\"original\" width=\"512\" height=\"85\" class=\"aligncenter size-large wp-image-244\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/original-1024x171.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/original-300x50.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/original-768x128.png 768w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>It is almost impossible to see what is happening on land: the oceans dominate.  By removing open ocean and applying the Gall-Peters projection, we get a clearer picture:<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version4.png\" rel=\"attachment wp-att-245\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version4-1024x443.png\" alt=\"version4\" width=\"512\" height=\"221\" class=\"aligncenter size-large wp-image-245\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version4-1024x443.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version4-300x130.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version4-768x332.png 768w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>There&#8217;s even a nice spot for a legend in the lower-left!  Whether for convenience or lack of time, the tools I&#8217;ve made to allow you to make these maps are divided between R and Python.  Here&#8217;s a handy guide for which tool to use:<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/decisions.png\" rel=\"attachment wp-att-243\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/decisions-1024x619.png\" alt=\"decisions\" width=\"512\" height=\"310\" class=\"aligncenter size-large wp-image-243\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/decisions-1024x619.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/decisions-300x181.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/decisions-768x464.png 768w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><br \/>\n<font size=\"-1\"><br \/>\n<i>(1)<\/i> Supported image formats are listed in the <a href=\"http:\/\/pillow.readthedocs.org\/en\/3.0.x\/handbook\/image-file-formats.html\">Pillow<\/a> documentation.<br \/>\n<i>(2)<\/i> A TSR file is a Tropict Shapefile Reinterpretation file, and includes the longitudinal shifts for each hemisphere.<br \/>\n<\/font><\/p>\n<p>Let&#8217;s say you find yourself with a NetCDF file in need of Tropiction, called <tt>bio-2.nc4<\/tt>.  It&#8217;s already clipped to between 30&deg;S and 30&deg;N.  The first step is to call <tt>splice_grid.py<\/tt> to create a Tropicted NetCDF:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npython ..\/splice_grid.py subjects\/bio-2.nc4 ..\/bio-2b.nc4\r\n<\/pre>\n<p>But that NetCDF doesn&#8217;t show country boundaries.  To show country boundaries, you can follow the <a href=\"https:\/\/github.com\/jrising\/research-common\/blob\/master\/tropict\/examples\/example.R\">example<\/a> for using <tt>draw_map.R<\/tt>:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nlibrary(ncdf4)\r\nlibrary(RColorBrewer)\r\n\r\n## Open the Tropicted NetCDF\r\ndatabase &lt;- nc_open(&quot;bio-2b.nc4&quot;)\r\n## Extract one variable\r\nmap &lt;- ncvar_get(database, &quot;change&quot;)\r\n\r\n## Identify the range of values there\r\nmaxmap &lt;- max(abs(map), na.rm=T)\r\n\r\n## Set up colors centered on 0\r\ncolors &lt;- rev(brewer.pal(11,&quot;RdYlBu&quot;))\r\nbreaks &lt;- seq(-maxmap, maxmap, length.out=12)\r\n\r\n## Draw the NetCDF image as a background\r\nsplicerImage(map, colors, breaks=breaks)\r\n## Add country boundaries\r\naddMap(border=&quot;#00000060&quot;)\r\n## Add seams where Tropict knits the map together\r\naddSeams(col=&quot;#00000040&quot;)\r\n<\/pre>\n<p>Here&#8217;s an example of the final result, for a bit of my coffee work:<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/arabica-futureb.png\" rel=\"attachment wp-att-242\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/arabica-futureb-1024x443.png\" alt=\"arabica-futureb\" width=\"512\" height=\"221\" class=\"aligncenter size-large wp-image-242\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/arabica-futureb-1024x443.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/arabica-futureb-300x130.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/arabica-futureb-768x332.png 768w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>For more details, check out the documentation at the <a href=\"https:\/\/github.com\/jrising\/research-common\/tree\/master\/tropict\">GitHub page<\/a>!<\/p>\n<p>And just for fun, here were two previous attempts of re-hashing the globe:<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1.png\" rel=\"attachment wp-att-246\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1-1024x268.png\" alt=\"version1\" width=\"512\" height=\"134\" class=\"aligncenter size-large wp-image-246\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1-1024x268.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1-300x79.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1-768x201.png 768w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version1.png 1654w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>I admit that moving Australia and Hawaii into the India Ocean was over-zealous, but they fill up the space so well!<\/p>\n<p><a href=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version3.png\" rel=\"attachment wp-att-247\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version3-1024x267.png\" alt=\"version3\" width=\"512\" height=\"134\" class=\"aligncenter size-large wp-image-247\" srcset=\"https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version3-1024x267.png 1024w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version3-300x78.png 300w, https:\/\/existencia.org\/pro\/wp-content\/uploads\/2016\/01\/version3-768x200.png 768w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Here I can still use the slick division between Indonesian and Papua New Guinea and Hawaii fits right on the edge, but Australia gets split in two.<\/p>\n<p>Enjoy the tropics!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tropict is a set of python and R scripts that adjust the globe to make land masses in the tropics fill up more visual real estate. It does this by exploiting the ways continents naturally &#8220;fit into&#8221; each other, splicing out wide areas of empty ocean and nestling the continents closer together. All Tropict scripts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-software"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Zh9E-3S","_links":{"self":[{"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=240"}],"version-history":[{"count":0,"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=\/wp\/v2\/posts\/240\/revisions"}],"wp:attachment":[{"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/existencia.org\/pro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}