<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	 xmlns:content="http://purl.org/rss/1.0/modules/content/"
	 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	 xmlns:dc="http://purl.org/dc/elements/1.1/"
	 xmlns:atom="http://www.w3.org/2005/Atom"
	 xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	 xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:georss="http://www.georss.org/georss"
     xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
     xmlns:media="http://search.yahoo.com/mrss/"><channel>
  <title>Deepak Cherian</title>
  <atom:link href="http://www.cherian.net/rss.xml" rel="self" type="application/rss+xml" />
  <link>http://www.cherian.net/</link>
  <description><![CDATA[]]></description>
  <language>en</language>
  <pubDate>Sat, 12 Sep 2020 11:57:45 -0600</pubDate>
  <lastBuildDate>Sat, 12 Sep 2020 11:57:45 -0600</lastBuildDate>
  <generator>Emacs 26.3 Org-mode 9.4</generator>
  <webMaster>deepak@cherian.net (Deepak Cherian)</webMaster>
  <image>
    <url>https://orgmode.org/img/org-mode-unicorn-logo.png</url>
    <title>Deepak Cherian</title>
    <link>http://www.cherian.net/</link>
  </image>

  <div id="table-of-contents">
    <h2>Table of Contents</h2>
    <div id="text-table-of-contents">
      <ul>
        <li><a href="#orga0fe602">1. bokeh js plots and org-mode HTML export</a>
        <ul>
          <li><a href="#orga8f0da1">1.1. Introduction</a></li>
          <li><a href="#orgebeaa02">1.2. Using <code>autoload_static</code> (preferred)</a>
          <ul>
            <li><a href="#org2a164ef">Prerequisites</a></li>
            <li><a href="#org00af50f">Example</a></li>
            <li><a href="#orgdd799b4">Improvements</a></li>
          </ul>
          </li>
          <li><a href="#orgd4e7a30">1.3. Using components (not-recommended)</a></li>
          <li><a href="#org1896371">1.4. Appendix</a>
          <ul>
            <li><a href="#orgb518066">yasnippet</a></li>
            <li><a href="#org782ce33">Dependencies</a></li>
            <li><a href="#org9997ba7">Styling</a></li>
            <li><a href="#org9303cc0">Source</a></li>
          </ul>
          </li>
        </ul>
        </li>
        <li><a href="#org3c0bd2a">2. xkcd-style schematics using matplotlib.</a></li>
        <li><a href="#org8bd6171">3. Interesting quotes from the scientific literature</a></li>
        <li><a href="#orgdce9383">4. &ldquo;Death in the Gulf Stream&rdquo; - A Hemingway cocktail</a></li>
        <li><a href="#org8e4344f">5. A setup for reproducible research</a>
        <ul>
          <li><a href="#org58babce">5.1. Update</a></li>
          <li><a href="#org223bd6d">5.2. Software</a></li>
          <li><a href="#org25ec859">5.3. Strategy</a></li>
          <li><a href="#org379b4dd">5.4. Getting the current hash in MATLAB</a></li>
          <li><a href="#org6891c23">5.5. Using the hash</a></li>
          <li><a href="#org4c2ab29">5.6. Saving the hash in an image file</a></li>
          <li><a href="#org7ea2499">5.7. Extracting commit hash from image metadata</a></li>
        </ul>
        </li>
      </ul>
    </div>
  </div>

  <item>
    <title>bokeh js plots and org-mode HTML export</title>
    <link>http://www.cherian.net/rss.html#orga0fe602</link>
    <author>deepak@cherian.net (Deepak Cherian)</author>
    <guid isPermaLink="false">http://www.cherian.net/rss.html#orga0fe602</guid>
    <pubDate>Sat, 04 Nov 2017 21:28:00 -0600</pubDate>

    <description><![CDATA[
    <div id="outline-container-orga8f0da1" class="outline-3">
    <h3 id="orga8f0da1"><span class="section-number-3">1.1</span> Introduction</h3>
    <div class="outline-text-3" id="text-1-1">
    <p>
    I&rsquo;ve been wanting to play around with interactive Javascript plots for a while; for example: <a href="https://demo.bokehplots.com/apps/selection_histogram">https://demo.bokehplots.com/apps/selection_histogram</a>. The selection functionality is really cool!
    </p>

    <p>
    This post is an experiment in embedding <a href="http://bokeh.pydata.org">bokeh</a> plots in org-mode notebooks that rendered properly when exported as HTML pages. There are two approaches for embedding.
    </p>
    </div>
    </div>

    <div id="outline-container-orgebeaa02" class="outline-3">
    <h3 id="orgebeaa02"><span class="section-number-3">1.2</span> Using <code>autoload_static</code> (preferred)</h3>
    <div class="outline-text-3" id="text-1-2">
    <p>
    Based on <a href="https://necromuralist.github.io/data_science/posts/bokeh-test/">https://necromuralist.github.io/data_science/posts/bokeh-test/</a>
    </p>

    <p>
    Some notes:
    </p>
    <ol class="org-ol">
    <li>This method stores the data in a separate <code>.js</code> file which should make the org file easier to handle. Also, the figure can embedded freely in many places.</li>
    <li>Figuring where to get the bokeh css and js files can be tricky (<a href="https://bokeh.pydata.org/en/latest/docs/reference/resources.html">docs</a>):
    <ol class="org-ol">
    <li>You can use the CDN:  <code>from bokeh.resources import CDN</code> to load the bokeh js file over the internet. Not good for future-proofing.</li>
    <li>Using <code>bokeh.resources.Resources(mode='absolute')</code> or <code>'mode=relative'</code> loads bokeh from your local python installation; so that&rsquo;s good for <i>local</i> notebooks but your figures/notebooks might break when bokeh updates.</li>
    <li>The <code>inline</code> option inlines the necessary js and css in the exported <code>.js</code> file but then with multiple images; you end up with multiple copies so that&rsquo;s wasteful, but seems like the only future-proof option. Also, you can have two figures made with different bokeh versions embedded in the same document, so that&rsquo;s a plus.</li>
    </ol></li>
    </ol>
    </div>

    <div id="outline-container-org2a164ef" class="outline-4">
    <h4 id="org2a164ef">Prerequisites</h4>
    <div class="outline-text-4" id="text-org2a164ef">
    <p>
    I am using
    </p>

    <ol class="org-ol">
    <li>bokeh 0.12.10</li>
    <li>org 9.1.2</li>
    <li>emacs 25.3.50.2</li>
    <li><a href="https://github.com/gregsexton/ob-ipython/commit/1642a74d4402b77ce051879e7605bc7c6537f922">ob-ipython @ 1642a74</a></li>
    </ol>

    <p>
    I define a function <code>export_bokeh</code> to do the actual heavy lifting. This function could be moved to your ipython <code>startup.py</code> file so that it is defined for every ipython session.
    </p>
    <div class="org-src-container">
    <pre class="src src-ipython" id="org9b020d7">def export_bokeh(plot, outPNG, outJS, outHTML, bkjs='inline'):
    from bokeh.io import export_png
    from bokeh.embed import autoload_static, file_html
    import bokeh.resources

    if bkjs is 'local':
    # use local installed bokeh scripts
    wherebokeh = bokeh.resources.Resources(mode='absolute')

    if bkjs is 'remote' or bkjs is 'CDN':
    # use CDN bokeh scripts
    wherebokeh = bokeh.resources.CDN

    if bkjs is 'relative':
    # bkjs is a relative path to the locally installed bokeh files
    wherebokeh = bokeh.resources.Resources(mode='relative', root_dir='./')

    if bkjs is 'inline':
    wherebokeh = bokeh.resources.INLINE

    # save the png file
    export_png(plot, filename=outPNG)

    # save the html file
    html = file_html(plot, wherebokeh, None)
    with open(outHTML, 'w') as file:
    file.write(html)

    js, script = autoload_static(plot, wherebokeh, outJS)

    # save the .js file
    with open(outJS, "w") as writer:
    writer.write(js)

    # embed in the org-exported HTML file
    print('''#+BEGIN_EXPORT html\n{script}\n#+END_EXPORT'''.format(script=script.lstrip()))
    </pre>
    </div>

    <p>
    Embedding the figure is then quite easy once you
    </p>
    <ol class="org-ol">
    <li>tell ob-ipython to capture stdout and put it in a drawer so that it&rsquo;s replaced everytime to rerun the source block.</li>
    <li>provide a custom filename for export (<code>fname</code> below).</li>
    </ol>
    <p>
    I use this header line:
    </p>
    <pre class="example">
    #+BEGIN_SRC ipython :session :results output drawer :exports both :var fname="my-image" :var titlestr="Demonstrating bokeh"
    </pre>
    </div>
    </div>
    <div id="outline-container-org00af50f" class="outline-4">
    <h4 id="org00af50f">Example</h4>
    <div class="outline-text-4" id="text-org00af50f">
    <p>
    This will export a <a href="../static/my-image.png">png image</a>, an <a href="../static/html/my-image.html">HTML file</a> and a <a href="../static/js/my-image.js">Javascript file</a>. That way there are both static and dynamic versions that are easy to share as well as an emebeddable version.
    </p>
    <div class="org-src-container">
    <pre class="src src-ipython">from bokeh.plotting import figure
    from bokeh.layouts import gridplot
    from bokeh.models import ColumnDataSource, HoverTool, WheelZoomTool

    tools='box_select, reset'

    # create "subplots"
    p1 = figure(tools=tools)
    p1.background_fill_alpha = 0.0
    p1.border_fill_alpha = 0.0

    p2 = figure(tools=tools, x_range=p1.x_range, y_range=p1.y_range)
    p2.background_fill_alpha = 0.0
    p2.border_fill_alpha = 0.0

    # generate data
    x = np.random.randn(200)
    y0 = x**3 - 100
    y1 = x**2 - 100

    # generate random letters
    import string
    import random
    label = [random.choice(string.ascii_letters) for aa in range(200)]

    # needed for linked selection
    source = ColumnDataSource(data={'x': x, 'y0': y0, 'y1': y1,
    'label': label})

    # plot the data
    p1.circle('x', 'y0', source=source)
    p2.scatter('x', 'y1', source=source)

    p1.title.text = titlestr

    wheel = WheelZoomTool()
    # add some tooltips
    hover = HoverTool()
    hover.tooltips = [
    ("(x,y)", "($x, $y)"),  # '$' for co-ordinates
    ("label", "@label")  # note '@' for column lookup
    ]
    p1.add_tools(hover, wheel)
    p2.add_tools(hover, wheel)

    p1.toolbar.active_scroll = wheel
    p2.toolbar.active_scroll = wheel

    # layout the subplots
    pg = gridplot([[p1, p2]], plot_width=400, plot_height=400)

    export_bokeh(pg,
    '../static/'+fname+'.png',
    '../static/js/'+fname+'.js',
    '../static/html/'+fname+'.html')
    </pre>
    </div>
    <script
    src="../static/js/my-image.js"
    id="f1c145ed-260c-411c-8c26-f71b52427218"
    data-bokeh-model-id="5f0145de-1c4e-4ee2-9a64-f38f255c81ff"
    data-bokeh-doc-id="20261111-dbef-4dd0-b40c-d8c04db088bd"
    ></script>

    <p>
    The above figure is a rendering of the <code>RESULTS</code> block:
    </p>
    <pre class="example">
    #+RESULTS:
    :RESULTS:
    #+BEGIN_EXPORT html
    &lt;script
    src="../static/js/my-image.js"
    id="f1c145ed-260c-411c-8c26-f71b52427218"
    data-bokeh-model-id="5f0145de-1c4e-4ee2-9a64-f38f255c81ff"
    data-bokeh-doc-id="20261111-dbef-4dd0-b40c-d8c04db088bd"
    &gt;&lt;/script&gt;
    #+END_EXPORT
    :END:
    </pre>
    </div>
    </div>
    <div id="outline-container-orgdd799b4" class="outline-4">
    <h4 id="orgdd799b4">Improvements</h4>
    <div class="outline-text-4" id="text-orgdd799b4">
    <p>
    Things I would like:
    </p>

    <ul class="org-ul">
    <li>Automatically run the HTML export when running the code block.
    <ul class="org-ul">
    <li>Can I add-hook to <code>org-babel-execute-maybe</code>?</li>
    </ul></li>

    <li>The ability to auto-hide the javascript in the <code>RESULTS</code> drawer but show the exported png file.
    <ul class="org-ul">
    <li>Ideally, I would see the png in the org file and the javascript in the HTML file. The other should be hidden. Seems too complicated.</li>
    <li>A nice solution would be to insert a link to the png file in the image caption.</li>
    </ul></li>

    <li>Are <span class="underline">actual</span> captions (<code>#+CAPTION</code>) possible with bokeh figures?</li>

    <li>Avoid the explicit <code>export_bokeh</code> call if possible.
    <ul class="org-ul">
    <li>Ideally, <code>ob-ipython</code> would be able to tell that this is a bokeh block; use the <code>fname</code> var to pass the figure handle <code>p</code> and <code>fname</code> to <code>export_bokeh</code> and do everything. This would be close to jupyter notebook workflow.</li>
    <li>This might be possible using IPython formatters as suggested by the <code>ob-ipython</code> README.
    <ul class="org-ul">
    <li>Could we then define <code>export_bokeh</code> in <code>imports.py</code> and call that when the returned object is a bokeh figure handle?</li>
    </ul></li>
    </ul></li>

    <li>Can we get holoviews to work with this? Optionally tell it to use either matplotlib or bokeh backends</li>
    </ul>
    </div>
    </div>
    </div>
    <div id="outline-container-orgd4e7a30" class="outline-3">
    <h3 id="orgd4e7a30"><span class="section-number-3">1.3</span> Using components (not-recommended)</h3>
    <div class="outline-text-3" id="text-1-3">
    <p>
    I made some slight modifications to <a href="http://kitchingroup.cheme.cmu.edu/blog/2016/02/07/Interactive-Bokeh-plots-in-HTML/">http://kitchingroup.cheme.cmu.edu/blog/2016/02/07/Interactive-Bokeh-plots-in-HTML/</a> though I didn&rsquo;t need to embed anything in a frame. The principal drawback here is that all the data is returned in <code>stdout</code> and written to the org file. This would get unwieldy for big plots.
    </p>

    <ol class="org-ol">
    <li><p>
    Add the following at the top of my org file to use locally downloaded versions of bokeh. Note that versions need to match/be compatible with what you have installed (<code>bokeh.__version__</code>).
    </p>
    <div class="org-src-container">
    <pre class="src src-org"><span style="color: #78808f;">   #+HTML_HEAD: &lt;link rel="stylesheet" href="/home/deepak/tools/bokeh/bokeh-0.12.10.min.css" type="text/css" /&gt;</span>
    <span style="color: #78808f;">   #+HTML_HEAD: &lt;link rel="stylesheet" href="/home/deepak/tools/bokeh/bokeh-widgets-0.12.10.min.css" type="text/css" /&gt;</span>
    <span style="color: #78808f;">   #+HTML_HEAD: &lt;script type="text/javascript" src="/home/deepak/tools/bokeh/bokeh-0.12.10.min.js"&gt;&lt;/script&gt;</span>
    <span style="color: #78808f;">   #+HTML_HEAD: &lt;script type="text/javascript" src="/home/deepak/tools/bokeh/bokeh-widgets-0.12.10.min.js"&gt;&lt;/script&gt;</span>
    </pre>
    </div></li>

    <li>For this website I use the CDN urls they provide : <code>http://cdn.pydata.org/bokeh/release/bokeh-x.y.z.min.css</code> etc.</li>
    </ol>

    <div class="org-src-container">
    <pre class="src src-ipython">def WriteToOrg(p):
    script, div = components(p)

    script = '\n'.join(['#+HTML_HEAD_EXTRA: ' + line for line in script.lstrip().split('\n')])

    print('''{script}\n#+BEGIN_EXPORT html\n{div}\n#+END_EXPORT'''.format(script=script, div=div))


    from bokeh.plotting import figure
    from bokeh.embed import components

    p = figure()
    p.line(np.random.randn(200), np.random.randn(200))
    WriteToOrg(p)
    </pre>
    </div>


    <div class="bk-root">
    <div class="bk-plotdiv" id="2752c053-1ddb-4dad-9a62-afb09a61cc38"></div>
    </div>
    </div>
    </div>
    <div id="outline-container-org1896371" class="outline-3">
    <h3 id="org1896371"><span class="section-number-3">1.4</span> Appendix</h3>
    <div class="outline-text-3" id="text-1-4">
    </div>
    <div id="outline-container-orgb518066" class="outline-4">
    <h4 id="orgb518066">yasnippet</h4>
    <div class="outline-text-4" id="text-orgb518066">
    <p>
    A simplified version of the one on <code>ob-ipython</code>. This autogenerates a random filename.
    </p>

    <pre class="example">
    #+BEGIN_SRC ipython :session :results output drawer :exports both :var fname=${1:`(make-temp-name "img")`}
    from bokeh.plotting import figure
    from bokeh.layouts import gridplot
    from bokeh.models import ColumnDataSource, HoverTool, WheelZoomTool

    tools='box_select, reset'

    # create "subplots"
    hf = figure(tools=tools)
    hf.background_fill_alpha = 0.0
    hf.border_fill_alpha = 0.0

    hf.$0

    export_bokeh(hf, 'images/'+fname+'.png', 'images/js/'+fname+'.js', bkjs='inline')
    #+END_SRC
    </pre>
    </div>
    </div>

    <div id="outline-container-org782ce33" class="outline-4">
    <h4 id="org782ce33">Dependencies</h4>
    <div class="outline-text-4" id="text-org782ce33">
    <p>
    Looks like exporting to PNG requires
    </p>
    <pre class="example">
    conda install phantomjs selenium
    </pre>
    </div>
    </div>
    <div id="outline-container-org9997ba7" class="outline-4">
    <h4 id="org9997ba7">Styling</h4>
    <div class="outline-text-4" id="text-org9997ba7">
    <ol class="org-ol">
    <li><p>
    Either include a css file or add a style tag to <code>HTML_HEAD</code> at the top of your org file.
    </p>
    <div class="org-src-container">
    <pre class="src src-org"><span style="color: #78808f;">   #+HTML_HEAD: &lt;style&gt; add-stuff-here &lt;/style&gt;</span>
    </pre>
    </div></li>
    <li><p>
    Targeting the css class <code>bk-plot-layout</code> lets you center the image. <code>bk-grid-column</code> does it for <code>gridplot</code>
    </p>
    <div class="org-src-container">
    <pre class="src src-css">   <span style="color: #81A1C1;">.bk-plot-layout .bk-grid-column </span>{ <span style="color: #A3BE8C;">max-width</span>: <span style="color: #B48EAD; font-weight: bold;">100</span>%; <span style="color: #A3BE8C;">margin</span>: auto;}
    </pre>
    </div></li>
    </ol>
    </div>
    </div>
    <div id="outline-container-org9303cc0" class="outline-4">
    <h4 id="org9303cc0">Source</h4>
    <div class="outline-text-4" id="text-org9303cc0">
    <p>
    Here is <a href="https://raw.githubusercontent.com/dcherian/dcherian.github.io/sources/org/posts/bokeh-org-mode.org">org-mode source</a> for this page.
    </p>
    </div>
    </div>
    </div>
    ]]></description>
</item>
<item>
  <title>xkcd-style schematics using matplotlib.</title>
  <link>http://www.cherian.net/rss.html#org3c0bd2a</link>
  <author>deepak@cherian.net (Deepak Cherian)</author>
  <guid isPermaLink="false">http://www.cherian.net/rss.html#org3c0bd2a</guid>
  <pubDate>Sun, 17 Sep 2017 12:36:00 -0600</pubDate>

  <description><![CDATA[<p>
  <a href="https://github.com/dcherian/xkcd-like-schematic/blob/master/schematics.ipynb">IPython notebook here.</a>
  </p>
  ]]></description>
</item>
<item>
  <title>Interesting quotes from the scientific literature</title>
  <link>http://www.cherian.net/rss.html#org8bd6171</link>
  <author>deepak@cherian.net (Deepak Cherian)</author>
  <guid isPermaLink="false">http://www.cherian.net/rss.html#org8bd6171</guid>
  <pubDate>Sun, 17 Sep 2017 12:34:00 -0600</pubDate>

  <description><![CDATA[<div class="paper-quotes">

  <ul class="org-ul">
  <li><p>
  <a class='org-ref-reference' href="#Griffies2014">Griffies2014</a>:
  </p>
  <blockquote>
  <p>
  Some readers may be disappointed with our reticence to penetrate deeper into such mechanisms. We too are disappointed. However, we are limited in how much we can answer such questions based on available diagnostic output from the simulations. Nonetheless, this excuse, which is in fact ubiquitous in such comparison papers utilizing CORE or CMIP (Coupled Model Intercomparison Project) simulations, is unsatisfying.
  </p>
  </blockquote></li>

  <li><a class='org-ref-reference' href="#Lien1995">Lien1995</a></li>
  </ul>
  <blockquote>
  <p>
  The conclusions reached in the house of cards constructed above are that the wind strengthens the heat flux, the Kelvin wave's crest weakens it, and tropical instability waves do not have a dominant effect. We advance this argument as a working hypothesis for future study, not as a strongly supported conclusion.
  </p>
  </blockquote>

  <ul class="org-ul">
  <li><a class='org-ref-reference' href="#Peters1994">Peters1994</a></li>
  </ul>
  <blockquote>
  <p>
  Before and during a second cruise of April 1987, we were most curious whether we would find the deep diurnal cycle again. Our hopes were severely dimmed when we decided to surrender to the numerous sharks attacking our small advanced microstructure profiler(AMP) and to operate only the more imposing autonomous multiscaleprofiler(MSP). This meant reducing the profiling rate from4 per hour to 6 per day! To our surprise, the time series of the dissipation rate showed an unmistakable diurnal variation despite the coarse time resolution, and the signal reached well belowthe mixed layer depth as depicted in Figure lb.
  </p>
  </blockquote>

  <ul class="org-ul">
  <li><p>
  <a class='org-ref-reference' href="#Moum1985">Moum1985</a>
  </p>
  <blockquote>
  <p>
  Every spectrum was inspected for spurious effects; these consisted mostly of spiking caused by the interception of plankton by the sensors (and two shark attacks).
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Appen2015">Appen2015</a>:
  </p>
  <blockquote>
  <p>
  The geometry of the iron in the vicinity of the compass can be decomposed into a symmetric and an asymmetric part (National GeospatialIntelligence Agency 2004)².
  ...
  ²This handbook (National Geospatial-Intelligence Agency 2004) provides useful background and details about compass corrections, as they are standard on ships.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Ruddick1983">Ruddick1983</a>
  </p>
  <blockquote>
  <p>
  Oceanographers are increasingly accepting that one of the processes that can affect oceanic fine structure is double-diffusive convection, such as salt fingering.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Gregg1986">Gregg1986</a>:
  </p>
  <blockquote>
  <p>
  AMP observations were taken while the ship drifted "in the trough" near the buoy (a procedure that is better for collecting data than keeping the crew happy). (Following a moderately rough transit to the site, our sampling method prompted the chief engineer to call us "a fistful of weirdos".)
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Stommel1966">Stommel1966</a> (seen in <a class='org-ref-reference' href="#Jain2017">Jain2017</a>)
  </p>
  <blockquote>
  <p>
  When I emphasise the imperfection of observing techniques, perhaps I should say that I wrote this chapter during a succession of midnight-todawn watches during an attempt to survey the Somali Current near Socotra in the heart of the southwest monsoon. It is rather quixotic to try to get the measure of so large a phenomenon armed only with a 12-knot vessel and some reversing thermometers. Clearly some important phenomena slip through the observational net, and nothing makes one more convinced of the inadequacy of present-day observing techniques than the tedious experience of garnering a slender harvest of thermometer readings and water samples from a rather unpleasant little ship at sea. A few good and determined engineers could revolutionise this backwards field.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Pierrehumbert2010">Pierrehumbert2010</a> (found on <a href="https://twitter.com/henrifdrake/status/1113853950858604544">Henri Drake's twitter</a>)
  </p>
  <blockquote>
  <p>
  Lest there be any misunderstanding, we must emphasize at this point that "less sensitive" does not mean "insensitive". If CO<sub>2</sub> were a gray gas, then doubling its concentration, as we are poised to do within the century, would be unquestionably lethal. Because CO<sub>2</sub> is not in fact a gray gas, the results may be merely catastrophic.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Gregg2012">Gregg2012</a>
  </p>
  <blockquote>
  <p>
  ... most dissipation estimates were classified as noise and represented in the final data as zeros because we could not justify any other value.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Pollard1972">Pollard1972</a>
  </p>
  <blockquote>
  <p>
  GFD models like this one often suffer from lack of relevance. A sign of this is that an investigator cannot find observations quite ideal enough to test his theory. Our guilt would be established, therefore, if we required a resting ocean with uniform stratification and a step-function wind to make any use of observations. Luckily this is not our position, for account can be taken of arbitrary stratification, pre-existing currents, and a stress that varies in time
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Hovmoller1949">Hovmoller1949</a>
  </p>


  <div class="figure">
  <p><img src="../static/hovmoeller.png" alt="hovmoeller.png" style="width:90%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Groeskamp2019">Groeskamp2019</a>
  </p>
  <blockquote>
  <p>
  The following analogy illustrates the utility of buoyancy as a marker of water masses. Imagine a slightly tilted pile of Dutch pancakes sweetened with Canadian maple syrup. As the maple syrup is poured onto the top pancake, it readily spills over the sides but only slowly penetrates through to the interior. The disparate syrup transport arises because there is enhanced resistance to movement through a pancake but little resistance to movement along a pancake surface. We make use of this pancake analogy to conceptualize the stratification of ocean buoyancy and its influence on the associated transport of matter and heat.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Levine1999a">Levine1999a</a> on rescaling the Garrett-Munk spectrum
  </p>

  <div class="figure">
  <p><img src="../static/levine-99-scaling-gm.png" alt="levine-99-scaling-gm.png" style="width:50%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Colosi2016">Colosi2016</a>
  </p>
  <blockquote>
  <p>
  In 1979, Carl Wunsch famously asserted “Many sources for the internal wave field have been proposed; but it has not yet been possible to make the kind of statement that can be made about surface waves: namely, when the wind blows surface waves are generated and the larger the fetch and duration, the larger the waves.”
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Winters1994">Winters1994</a>:
  </p>
  <blockquote>
  <p>
  ... we generalize the term adiabatic to describe a process in which there is no heat or molecular mass transfer, and define a diabatic process as one that is not adiabatic.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Munk1981">Munk1981</a> introduces the term "spiciness":
  </p>
  <blockquote>
  <p>
  They are here designated by π,for "spiciness" (hot and salty<sup>10</sup>)
  </p>

  <p>
  ...
  </p>

  <p>
  [10] Garrett points out that a lot of laboratory experiments have been sweet-and-sour rather than spicy.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Wunsch2009">Wunsch2009</a> on instrumented elephant seals
  </p>
  <blockquote>
  <p>
  They are singled out here because they are almost our only data sets from under the Antarctic sea ice, and they perhaps represent the future, in which ever more species are used to obtain a truly global observation system<sup>2</sup>.
  </p>

  <p>
  ...
  </p>

  <p>
  [2] Perhaps, one day, animals can be bred to grow their own temperature, salinity, and pressure sensors, and GPS transmitters! Whether the existing system is damaging to the animals, and the more general ethical questions concerning animal use, must be discussed elsewhere.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Richardson1948">Richardson1948</a>
  </p>
  <blockquote>
  <p>
  In the sea we used floats of parsnip because it is easily visible, and because it is almost completely immersed so as not to catch the wind which, moreover, was slight. The floats were about 2cm in diameter.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Hughes2010">Hughes2010</a>
  <img src="../static/hughes-sea-level-color.png" alt="hughes-sea-level-color.png" />
  </p>
  <blockquote>
  <p>
  the true relationship between spectrum and color turns out to be rather useful here. We are used to interpreting small differences from white light (“red” noise) as colors, so if the sea level spectrum was exactly “red” noise, a translation into a light spectrum would render it as a gray scale: low‐amplitude variability would be black, and high‐amplitude white, with grays at intermediate values.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Gargett1999">Gargett1999</a>
  </p>


  <div class="figure">
  <p><img src="../static/gargett-1999-velcro.png" alt="gargett-1999-velcro.png" style="width=70%" />
  </p>
  </div>

  <blockquote>
  <p>
  While a zipper makes a closure by the functioning of a single accurate mechanism, the same task can be accomplished by the closing of enough of the myriad tiny hooks and eyes that make up a strip of Velcro. Baker (1983) first used this analogy to suggest "the importance of many relatively cheap measurements that cover a broad area as opposed to expensive detailed measurements at a point." As an example, consider the merits of the plentiful satellite measurements of sea surface temperature (SST) compared with highly accurate but exceedingly sparse shipboard SST measurements. Satellite information on the spatial patterns of SST and the changes of these patterns in space and time have provided a revolutionary new view of the ocean—a view completely unattainable from SST measurements along ship tracks. In such "Velcro" techniques, the quantity of measurements allows a description of the spatial patterns associated with the underlying fluid flows, with detail impossible to obtain from sparse sampling. As has been the case with satellite SST, the quantitative accuracy of the remote sensing algorithm is determined and improved by comparison with "ground-truth" data from accurate but sparsely distributed sensors.
  </p>

  <p>
  The above analogy is of direct relevance to present state-of-the-art measurement of ocean turbulence, a field in which the accurate "zippers" are microscale profilers. While such profilers have become somewhat more common during the last decade, they remain relatively rare; are expensive to maintain and run; and in operation are often restricted by adverse conditions of weather, surface waves, or oceanic velocity shears.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Ferrari2009">Ferrari2009</a>
  </p>
  <blockquote>
  <p>
  That turbulent mixing processes in the ocean are extremely important in determining the oceanic general circulation, and are major limiting factors in the ability to calculate future climate states, is a cliche in oceanography and climate dynamics. Unlike some other hackneyed statements, this one does retain much of its validity.
  </p>
  </blockquote>
  <p>
  And
  </p>
  <blockquote>
  <p>
  We have gone from the situation described in Wunsch &amp; Ferrari (2004) of being unable to account for the dissipation of geostrophic turbulence to the opposite case—there are now too many candidates.
  </p>
  </blockquote></li>
  <li><p>
  <a class='org-ref-reference' href="#Armi1983">Armi1983</a>
  </p>
  <blockquote>
  <p>
  We are in effect bragging about the results of a high-resolution yet wide-angle (10°) telescope in the sense of an astronomer looking at the sky. We have only used the new telescope four times in one portion of the ocean.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Ferrari2008">Ferrari2008</a>
  </p>
  <blockquote>
  <p>
  V Canuto and M Dubovikov were included as coauthors during the review process, because they contributed to resolving some inconsistencies in the original expressions for the eddy-induced streamfunction and the residual fluxes.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Hughes2016">Hughes2016</a>
  </p>


  <div class="figure">
  <p><img src="../static/hughes-2016.png" alt="hughes-2016.png" style="width:90%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Munk2007">Munk2007</a>
  </p>
  <blockquote>
  <p>
  The obliquity modulation of tidal mixing by a few percent and the associated  modulation in the meridional overturning circulation (MOC) may play a role comparable to the obliquity modulation of the incoming solar radiation (insolation), a cornerstone of the Milanković theory of ice ages. This speculation involves even more than the usual number of uncertainties found in climate speculations.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Polzin2014">Polzin2014</a>
  </p>


  <div class="figure">
  <p><img src="../static/polzin-2014-schematic.png" alt="polzin-2014-schematic.png" style="width:75%" />
  </p>
  </div></li>

  <li><p>
  John Lumley, quoted in <a class='org-ref-reference' href="#Leibovich2018">Leibovich2018</a>
  </p>
  <blockquote>
  <p>
  Turbulence is rent by factionalism. Traditional approaches in the field are under attack, and one hears intemperate statements against long time averaging, Reynolds decomposition, and so forth. Some of these are reminiscent of the Einstein-Heisenberg controversy over quantum mechanics, and smack of a mistrust of any statistical approach. Coherent structure people sound like <i>The Emperor’s New Clothes</i> when they say that all turbulent flows consist primarily of coherent structures, in the face of visual evidence to the contrary. Dynamical systems theory people are sure that turbulence is chaos. Simulators have convinced many that we will be able to compute <i>anything</i> within a decade. Modeling is thus attacked as unnecessary, or irrelevant because it starts with Reynolds stress averaging or ignores coherent structures. The card-carrying physicists dismiss everything that has been done on turbulence from Osborne Reynolds until the last decade. Cellular Automata were hailed on their appearance as the answer to a maiden’s prayer, so far as turbulence was concerned. It is no wonder that funding agencies are confused. (quoted in Cantwell 1990, p. 97)
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Penland1995">Penland1995</a> throw down a challenge:
  </p>

  <div class="figure">
  <p><img src="../static/penland-sardeshmukh.png" alt="penland-sardeshmukh.png" style="width:90%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Vallis1993">Vallis1993</a> :
  </p>
  <blockquote>
  <p>
  A factor of 2 sometimes finds itself, rather arbitrarily, in the denominator.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Flierl1978">Flierl1978</a> quotes Karl Marx:
  </p>
  <blockquote>
  <p>
  A second and, in my opinion, more persuasive argument for our studies is that, in sensitive systems, a small quantitative error may lead to large qualitative errors<sup>1</sup>.
  </p>

  <p>
  ⋮
  </p>

  <p>
  [1] "Quantitative changes suddenly become qualitative changes" (Karl Marx)
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Holte2009">Holte2009</a>
  </p>
  <blockquote>
  <p>
  Most floats sampled at regular pressure levels, though the Canadian Argo floats often sampled at irregular pressures and required substantial editing.
  </p>
  </blockquote></li>

  <li><p>
  <a class='org-ref-reference' href="#Sutyrin1994">Sutyrin1994</a> note insufficient printer resolution in their Figure 2.
  </p>

  <div class="figure">
  <p><img src="../static/sutyrin-flierl-fig2.png" alt="sutyrin-flierl-fig2.png" style="width:70%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#MacKinnon2017">MacKinnon2017</a> summarize
  </p>
  <blockquote>
  <p>
  A frequently asked question related to this work is “Which mixing processes matter most for climate?”. As with many alluringly comprehensive sounding questions, the answer is “it depends”.
  </p>
  </blockquote>
  <p>
  and then end on an inspiring note
  </p>
  <blockquote>
  <p>
  At the same time, the epiphanies, new ideas and novel observations that fundamentally drive the field forward frequently come not from big science, but from a cornucopia of much smaller exploratory efforts and the continued small-scale development of innovative observing technology and numerical techniques.  We must not lose the ability to be surprised.
  </p>
  </blockquote>

  <p>
  Also note the author order:
  </p>

  <div class="figure">
  <p><img src="../static/cpt-authors.png" alt="cpt-authors.png" style="width:80%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Wunsch2016">Wunsch2016</a> cites the Bible
  </p>
  <blockquote>
  <p>
  That which is far off, and exceeding deep, who can find it out?
  — Ecclesiastes 7:24 (King James Version)
  </p>
  </blockquote></li>

  <li><p>
  Enrico Fermi quotes John von Neumann to Freeman Dyson, critizing the latter's model <a class='org-ref-reference' href="#Dyson2004">Dyson2004</a>:
  </p>
  <blockquote>
  <p>
  "I remember my friend Johnny von Neumann used to say, with four parameters I can fit an elephant, and with five I can make him wiggle his trunk." — Enrico Fermi
  </p>
  </blockquote>


  <div class="figure">
  <p><img src="../static/elephant.png" alt="elephant.png" style="float:right;width:40%" />
  </p>
  </div>

  <p>
  <a class='org-ref-reference' href="#Mayer2010">Mayer2010</a> take on the challenge yielding:
  </p>
  <blockquote>
  <p>
  The resulting shape is schematic and cartoonlike but is still recognizable as an elephant. Although the use of the Fourier coordinate expansion is not new, our approach clearly demonstrates its usefulness in reducing the number of parameters needed to describe a two-dimensional contour. In the special case of fitting an elephant, it is even possible to lower it to four complex parameters and therein implement a well-known saying.
  </p>
  </blockquote>
  <p>
  With five, they give the elephant an eye and make it's trunk wiggle!
  </p>

  <p>
  Python implementation <a href="https://www.johndcook.com/blog/2011/06/21/how-to-fit-an-elephant/">here</a>.
  </p></li>

  <li><p>
  ...
  </p>

  <div class="figure">
  <p><img src="../static/obama-author.png" alt="obama-author.png" style="width:100%" />
  </p>
  </div></li>

  <li><p>
  <a class='org-ref-reference' href="#Lindzen1988">Lindzen1988</a>
  </p>
  <blockquote>
  <p>
  As it turns out, the observations provide a clue to the problem.
  </p>
  </blockquote></li>
  </ul>

  </div>
  <p>
  <h1 class='org-ref-bib-h1'>Bibliography</h1>
  <ul class='org-ref-bib'><li><a id="Griffies2014">[Griffies2014]</a> <a name="Griffies2014"></a>Griffies, Yin, Durack, Goddard, Bates, Behrens, Bentsen, Bi, Biastoch, Böning, Bozec, Chassignet, Danabasoglu, Danilov, Domingues, Drange, Farneti, Fernandez, Greatbatch, Holland, Ilicak, Large, Lorbacher, Lu, Marsland, Mishra, George Nurser, Salas y Mélia, Palter, Samuels, Schröter, Schwarzkopf, Sidorenko, Treguier, Tseng, Tsujino, Uotila, Valcke, Voldoire, Wang, Winton & Zhang, An Assessment of Global and Regional Sea Level for Years 1993–2007 in a Suite of Interannual CORE-II Simulations, <i>Ocean Model.</i>, <b>78</b>, 35-89 (2014). <a href="http://dx.doi.org/10/ggsnnb">doi</a>.</li>
  <li><a id="Lien1995">[Lien1995]</a> <a name="Lien1995"></a>Lien, Caldwell, Gregg & Moum, Turbulence Variability at the Equator in the Central Pacific at the Beginning of the 1991–1993 El Niño, <i>J. Geophys. Res.</i>, <b>100(C4)</b>, 6881 (1995). <a href="http://dx.doi.org/10.1029/94JC03312">doi</a>.</li>
  <li><a id="Peters1994">[Peters1994]</a> <a name="Peters1994"></a>Peters, Gregg & Sanford, The Diurnal Cycle of the Upper Equatorial Ocean: Turbulence, Fine-Scale Shear, and Mean Shear, <i>J. Geophys. Res.</i>, <b>99(C4)</b>, 7707 (1994). <a href="http://dx.doi.org/10/bmh9bm">doi</a>.</li>
  <li><a id="Moum1985">[Moum1985]</a> <a name="Moum1985"></a>Moum & Caldwell, Local Influences on Shear-Flow Turbulence in the Equatorial Ocean, <i>Science</i>, <b>230(4723)</b>, 315-316 (1985). <a href="http://dx.doi.org/10/cxrxwt">doi</a>.</li>
  <li><a id="Appen2015">[Appen2015]</a> <a name="Appen2015"></a>von Appen, Correction of ADCP Compass Errors Resulting from Iron in the Instrument’s Vicinity*, <i>J. Atmospheric Ocean. Technol.</i>, <b>32(3)</b>, 591-602 (2015). <a href="http://dx.doi.org/10/f654w8">doi</a>.</li>
  <li><a id="Ruddick1983">[Ruddick1983]</a> <a name="Ruddick1983"></a>Ruddick, A Practical Indicator of the Stability of the Water Column to Double-Diffusive Activity, <i>Deep Sea Res. Part Oceanogr. Res. Pap.</i>, <b>30(10)</b>, 1105-1107 (1983). <a href="http://dx.doi.org/10/bmp3xm">doi</a>.</li>
  <li><a id="Gregg1986">[Gregg1986]</a> <a name="Gregg1986"></a>Gregg, D'Asaro, Shay & Larson, Observations of Persistent Mixing and Near-Inertial Internal Waves, <i>J. Phys. Oceanogr.</i>, <b>16(5)</b>, 856-885 (1986). <a href="http://dx.doi.org/10.1175/1520-0485(1986)016<0856:OOPMAN>2.0.CO;2">doi</a>.</li>
  <li><a id="Stommel1966">[Stommel1966]</a> <a name="Stommel1966"></a>@incollectionStommel1966,
  title = The Large-Scale Oceanic Circulation,
  booktitle = Advances in Earth Science,
  author = Stommel, H.M.,
  year = 1966,
  pages = 175-184,
  publisher = MIT Press,
  address = Cambridge
  </li>
  <li><a id="Jain2017">[Jain2017]</a> <a name="Jain2017"></a>Jain, Shankar, Vinayachandran, Kankonkar, Chatterjee, Amol, Almeida, Michael, Mukherjee, Chatterjee, Fernandes, Luis, Kamble, Hegde, Chatterjee, Das & Neema, Evidence for the Existence of Persian Gulf Water and Red Sea Water in the Bay of Bengal, <i>Clim. Dyn.</i>, <b>48(9-10)</b>, 3207-3226 (2017). <a href="http://dx.doi.org/10.1007/s00382-016-3259-4">doi</a>.</li>
  <li><a id="Pierrehumbert2010">[Pierrehumbert2010]</a> <a name="Pierrehumbert2010"></a>Pierrehumbert, Principles of Planetary Climate, Cambridge University Press (2010).</li>
  <li><a id="Gregg2012">[Gregg2012]</a> <a name="Gregg2012"></a>Gregg, Alford, Kontoyiannis, Zervakis & Winkel, Mixing over the Steep Side of the Cycladic Plateau in the Aegean Sea, <i>J. Mar. Syst.</i>, <b>89(1)</b>, 30-47 (2012). <a href="http://dx.doi.org/10/chjrbk">doi</a>.</li>
  <li><a id="Pollard1972">[Pollard1972]</a> <a name="Pollard1972"></a>Pollard, Rhines & Thompson, The Deepening of the Wind-Mixed Layer, <i>Geophys. Fluid Dyn.</i>, <b>4(1)</b>, 381-404 (1972). <a href="http://dx.doi.org/10.1080/03091927208236105">doi</a>.</li>
  <li><a id="Hovmoller1949">[Hovmoller1949]</a> <a name="Hovmoller1949"></a>Hovmöller, The Trough-and-Ridge Diagram, <i>Tellus</i>, <b>1(2)</b>, 62-66 (1949). <a href="http://dx.doi.org/10.1111/j.2153-3490.1949.tb01260.x">doi</a>.</li>
  <li><a id="Groeskamp2019">[Groeskamp2019]</a> <a name="Groeskamp2019"></a>Groeskamp, Griffies, Iudicone, Marsh, Nurser & Zika, The Water Mass Transformation Framework for Ocean Physics and Biogeochemistry, <i>Annu. Rev. Mar. Sci.</i>, <b>11(1)</b>, 271-305 (2019). <a href="http://dx.doi.org/10/gfs9nw">doi</a>.</li>
  <li><a id="Levine1999a">[Levine1999a]</a> <a name="Levine1999a"></a>Levine, Internal Waves on the Continental Shelf, in in: Proc. ’Aha Huliko’a Hawaiian Winter Workshop, edited by (1999)</li>
  <li><a id="Colosi2016">[Colosi2016]</a> <a name="Colosi2016"></a>Colosi, The Enigma of the Ocean Internal Wave Spectrum: Can Acoustics Help Solve the Enigma?, <i>J. Acoust. Soc. Am.</i>, <b>140(4)</b>, 2976-2976 (2016). <a href="http://dx.doi.org/10.1121/1.4969213">doi</a>.</li>
  <li><a id="Winters1994">[Winters1994]</a> <a name="Winters1994"></a>Winters & D’Asaro, Three-Dimensional Wave Instability near a Critical Level, <i>J. Fluid Mech.</i>, <b>272(-1)</b>, 255 (1994). <a href="http://dx.doi.org/10.1017/S0022112094004465">doi</a>.</li>
  <li><a id="Munk1981">[Munk1981]</a> <a name="Munk1981"></a>@incollectionMunk1981,
  title = Internal Waves and Small-Scale Processes,
  booktitle = Evolution of Physical Oceanography,
  author = Munk, W.,
  year = 1981,
  publisher = MIT Press,
  file = /home/deepak/Papers/Munk-1981-Internal_Waves_and_Small-Scale_Processes.pdf
  </li>
  <li><a id="Wunsch2009">[Wunsch2009]</a> <a name="Wunsch2009"></a>Wunsch, Heimbach, Ponte & Fukumori, The Global General Circulation of the Ocean Estimated by the ECCO-Consortium, <i>Oceanography</i>, <b>22(2)</b>, 88-103 (2009). <a href="http://dx.doi.org/10.5670/oceanog.2009.41">doi</a>.</li>
  <li><a id="Richardson1948">[Richardson1948]</a> <a name="Richardson1948"></a>Richardson & Stommel, Note on Eddy Diffusion in the Sea, <i>J. Meteorol.</i>, <b>5(5)</b>, 238-240 (1948). <a href="http://dx.doi.org/10.1175/1520-0469(1948)005<0238:NOEDIT>2.0.CO;2">doi</a>.</li>
  <li><a id="Hughes2010">[Hughes2010]</a> <a name="Hughes2010"></a>Hughes & Williams, The Color of Sea Level: Importance of Spatial Variations in Spectral Shape for Assessing the Significance of Trends, <i>J. Geophys. Res.</i>, <b>115(C10)</b>, (2010). <a href="http://dx.doi.org/10.1029/2010JC006102">doi</a>.</li>
  <li><a id="Gargett1999">[Gargett1999]</a> <a name="Gargett1999"></a>Gargett, Velcro Measurement of Turbulence Kinetic Energy Dissipation Rate ε, <i>J. Atmospheric Ocean. Technol.</i>, <b>16(12)</b>, 1973-1993 (1999). <a href="http://dx.doi.org/10.1175/1520-0426(1999)016<1973:VMOTKE>2.0.CO;2">doi</a>.</li>
  <li><a id="Ferrari2009">[Ferrari2009]</a> <a name="Ferrari2009"></a>Ferrari & Wunsch, Ocean Circulation Kinetic Energy: Reservoirs, Sources, and Sinks, <i>Annu. Rev. Fluid Mech.</i>, <b>41(1)</b>, 253-282 (2009). <a href="http://dx.doi.org/10.1146/annurev.fluid.40.111406.102139">doi</a>.</li>
  <li><a id="Armi1983">[Armi1983]</a> <a name="Armi1983"></a>Armi & Stommel, Four Views of a Portion of the North Atlantic Subtropical Gyre, <i>J. Phys. Oceanogr.</i>, <b>13(5)</b>, 828-857 (1983). <a href="http://dx.doi.org/10.1175/1520-0485(1983)013<0828:FVOAPO>2.0.CO;2">doi</a>.</li>
  <li><a id="Ferrari2008">[Ferrari2008]</a> <a name="Ferrari2008"></a>Ferrari, McWilliams, Canuto & Dubovikov, Parameterization of Eddy Fluxes near Oceanic Boundaries, <i>J. Clim.</i>, <b>21(12)</b>, 2770-2789 (2008). <a href="http://dx.doi.org/10.1175/2007JCLI1510.1">doi</a>.</li>
  <li><a id="Hughes2016">[Hughes2016]</a> <a name="Hughes2016"></a>Hughes, Williams, Hibbert, Boening & Oram, A Rossby Whistle: A Resonant Basin Mode Observed in the Caribbean Sea, <i>Geophys. Res. Lett.</i>, <b>43(13)</b>, 7036-7043 (2016). <a href="http://dx.doi.org/10.1002/2016GL069573">doi</a>.</li>
  <li><a id="Munk2007">[Munk2007]</a> <a name="Munk2007"></a>Munk & Bills, Tides and the Climate: Some Speculations, <i>J. Phys. Oceanogr.</i>, <b>37(2)</b>, 135-147 (2007). <a href="http://dx.doi.org/10.1175/JPO3002.1">doi</a>.</li>
  <li><a id="Polzin2014">[Polzin2014]</a> <a name="Polzin2014"></a>Polzin, Naveira Garabato, Huussen, Sloyan & Waterman, Finescale Parameterizations of Turbulent Dissipation, <i>J. Geophys. Res. Oceans</i>, <b>119(2)</b>, 1383-1419 (2014). <a href="http://dx.doi.org/10.1002/2013JC008979">doi</a>.</li>
  <li><a id="Leibovich2018">[Leibovich2018]</a> <a name="Leibovich2018"></a>Leibovich & Warhaft, John Leask Lumley: Whither Turbulence?, <i>Annu. Rev. Fluid Mech.</i>, <b>50(1)</b>, 1-23 (2018). <a href="http://dx.doi.org/10.1146/annurev-fluid-122316-044524">doi</a>.</li>
  <li><a id="Penland1995">[Penland1995]</a> <a name="Penland1995"></a>Penland & Sardeshmukh, The Optimal Growth of Tropical Sea Surface Temperature Anomalies, <i>J. Clim.</i>, <b>8(8)</b>, 1999-2024 (1995). <a href="http://dx.doi.org/10.1175/1520-0442(1995)008<1999:TOGOTS>2.0.CO;2">doi</a>.</li>
  <li><a id="Vallis1993">[Vallis1993]</a> <a name="Vallis1993"></a>Vallis & Maltrud, Generation of Mean Flows and Jets on a Beta Plane and over Topography, <i>J. Phys. Oceanogr.</i>, <b>23(7)</b>, 1346-1362 (1993). <a href="http://dx.doi.org/10.1175/1520-0485(1993)023<1346:GOMFAJ>2.0.CO;2">doi</a>.</li>
  <li><a id="Flierl1978">[Flierl1978]</a> <a name="Flierl1978"></a>Flierl, Models of Vertical Structure and the Calibration of Two-Layer Models, <i>Dyn. Atmospheres Oceans</i>, <b>2(4)</b>, 341-381 (1978). <a href="http://dx.doi.org/10.1016/0377-0265(78)90002-7">doi</a>.</li>
  <li><a id="Holte2009">[Holte2009]</a> <a name="Holte2009"></a>Holte & Talley, A New Algorithm for Finding Mixed Layer Depths with Applications to Argo Data and Subantarctic Mode Water Formation*, <i>J. Atmospheric Ocean. Technol.</i>, <b>26(9)</b>, 1920-1939 (2009). <a href="http://dx.doi.org/10.1175/2009JTECHO543.1">doi</a>.</li>
  <li><a id="Sutyrin1994">[Sutyrin1994]</a> <a name="Sutyrin1994"></a>Sutyrin & Flierl, Intense Vortex Motion on the Beta Plane: Development of the Beta Gyres, <i>J. Atmospheric Sci.</i>, <b>51(5)</b>, 773-790 (1994). <a href="http://dx.doi.org/10.1175/1520-0469(1994)051<0773:IVMOTB>2.0.CO;2">doi</a>.</li>
  <li><a id="MacKinnon2017">[MacKinnon2017]</a> <a name="MacKinnon2017"></a>MacKinnon, Zhao, Whalen, Waterhouse, Trossman, Sun, Laurent, Simmons, Polzin, Pinkel, Pickering, Norton, Nash, Musgrave, Merchant, Melet, Mater, Legg, Large, Kunze, Klymak, Jochum, Jayne, Hallberg, Griffies, Diggs, Danabasoglu, Chassignet, Buijsman, Bryan, Briegleb, Barna, Arbic, Ansong & Alford, Climate Process Team on Internal Wave-Driven Ocean Mixing, <i>Bull. Am. Meteorol. Soc.</i>, <b>98(11)</b>, 2429-2454 (2017). <a href="http://dx.doi.org/10.1175/BAMS-D-16-0030.1">doi</a>.</li>
  <li><a id="Wunsch2016">[Wunsch2016]</a> <a name="Wunsch2016"></a>Wunsch, Global Ocean Integrals and Means, with Trend Implications, <i>Annu. Rev. Mar. Sci.</i>, <b>8(1)</b>, 1-33 (2016). <a href="http://dx.doi.org/10.1146/annurev-marine-122414-034040">doi</a>.</li>
  <li><a id="Dyson2004">[Dyson2004]</a> <a name="Dyson2004"></a>Dyson, A Meeting with Enrico Fermi, <i>Nature</i>, <b>427(6972)</b>, 297-297 (2004). <a href="http://dx.doi.org/10.1038/427297a">doi</a>.</li>
  <li><a id="Mayer2010">[Mayer2010]</a> <a name="Mayer2010"></a>Mayer, Khairy & Howard, Drawing an Elephant with Four Complex Parameters, <i>Am. J. Phys.</i>, <b>78(6)</b>, 648 (2010). <a href="http://dx.doi.org/10.1119/1.3254017">doi</a>.</li>
  <li><a id="Lindzen1988">[Lindzen1988]</a> <a name="Lindzen1988"></a>Lindzen & Hou, Hadley Circulations for Zonally Averaged Heating Centered off the Equator, <i>J. Atmospheric Sci.</i>, <b>45(17)</b>, 2416-2427 (1988). <a href="http://dx.doi.org/10.1175/1520-0469(1988)045<2416:HCFZAH>2.0.CO;2">doi</a>.</li>
  </ul>
  </p>
  ]]></description>
</item>

<item>
  <title>"Death in the Gulf Stream" - A Hemingway cocktail</title>
  <link>http://www.cherian.net/rss.html#orgdce9383</link>
  <author>deepak@cherian.net (Deepak Cherian)</author>
  <guid isPermaLink="false">http://www.cherian.net/rss.html#orgdce9383</guid>
  <pubDate>Sun, 17 Sep 2017 12:36:00 -0600</pubDate>

  <description><![CDATA[<p>
  From <a href="http://kottke.org/17/01/ernest-hemingways-cocktail-recipe-for-bad-times">Kottke</a> who got it from <a href="https://qz.com/889794/trump-inauguration-ernest-hemingway-has-a-cocktail-recipe-for-days-when-youve-had-just-enough-of-the-world/">Quartz</a>, a cocktail recipe created by Ernest Hemingway in 1937.
  </p>
  <blockquote>
  <p>
  Take a tall thin water tumbler and fill it with finely cracked ice.
  </p>

  <p>
  Lace this broken debris with 4 good purple splashes of Angostura, add the juice and crushed peel of 1 green lime, and fill glass almost full with Holland gin…
  </p>

  <p>
  No sugar, no fancying. It’s strong, it’s bitter—but so is English ale strong and bitter, in many cases.
  </p>

  <p>
  We don’t add sugar to ale, and we don’t need sugar in a “Death in the Gulf Stream”—or at least not more than 1 tsp. Its tartness and its bitterness are its chief charm.
  </p>
  </blockquote>
  ]]></description>
</item>
<item>
  <title>A setup for reproducible research</title>
  <link>http://www.cherian.net/rss.html#org8e4344f</link>
  <author>deepak@cherian.net (Deepak Cherian)</author>
  <guid isPermaLink="false">http://www.cherian.net/rss.html#org8e4344f</guid>
  <pubDate>Sun, 17 Sep 2017 12:34:00 -0600</pubDate>

  <description><![CDATA[
  <div id="outline-container-org58babce" class="outline-3">
  <h3 id="org58babce"><span class="section-number-3">5.1</span> Update</h3>
  <div class="outline-text-3" id="text-5-1">
  <p>
  <a href="https://www.researchgate.net/profile/Andre_Paloczy">André Palóczy</a> has implemented some of <a href="https://github.com/apaloczy/reproducibility">these ideas in Python</a>.
  </p>
  </div>
  </div>
  <div id="outline-container-org223bd6d" class="outline-3">
  <h3 id="org223bd6d"><span class="section-number-3">5.2</span> Software</h3>
  <div class="outline-text-3" id="text-5-2">
  <ul class="org-ul">
  <li>Version control system to track content. I use <a href="http://www.git-scm.org"><code>git</code></a>.</li>
  <li><a href="http://www.sno.phy.queensu.ca/~phil/exiftool/"><code>exiftool</code></a> to read and write metadata to images</li>
  <li>I have some code below for MATLAB but the principles could be extended to any other software package.</li>
  </ul>
  </div>
  </div>
  <div id="outline-container-org25ec859" class="outline-3">
  <h3 id="org25ec859"><span class="section-number-3">5.3</span> Strategy</h3>
  <div class="outline-text-3" id="text-5-3">
  <p>
  The approach is simple: use <code>git</code> to track files that generate output.
  </p>

  <p>
  <code>git</code> automatically assigns a unique 40 character alphanumeric string (a &ldquo;hash&rdquo;) that identifies the state of a repository.
  </p>

  <p>
  By saving the value of the hash when a certain output file is created, we know what code created the output.
  </p>

  <p>
  With data files, it is simple to add an extra variable containing the hash.
  </p>

  <p>
  With figures, I use the metadata fields to save the hash value.
  </p>
  </div>
  </div>
  <div id="outline-container-org379b4dd" class="outline-3">
  <h3 id="org379b4dd"><span class="section-number-3">5.4</span> Getting the current hash in MATLAB</h3>
  <div class="outline-text-3" id="text-5-4">
  <p>
  The following MATLAB function <code>githash</code> will return the hash of the last commit that modified the file in <code>fname</code>. If not provided with <code>fname</code> it returns the hash of the last commit in the repository.
  </p>

  <div class="org-src-container">
  <pre class="src src-matlab">   function [hash] = githash(fname, gitdir)

  if ~exist('fname', 'var')
  fname = '.';
  end

  if ~exist('gitdir', 'var')
  gitdir = '';
  else
  gitdir = ['--git-dir=' gitdir];
  end

  [~, hashout] = system(['TERM=xterm git ' gitdir ...
  ' log -n 1 --no-color --pretty=format:''%H'' ''' ...
  fname ''' &lt; /dev/null']);

  % remove bash escape characters
  hash = hashout(9:48)
  end
  </pre>
  </div>

  <p>
  Using it in a MATLAB script requires the incantation
  </p>
  <div class="org-src-container">
  <pre class="src src-matlab">  hash = githash([mfilename('fullpath') '.m']);
  </pre>
  </div>
  <p>
  This provides <code>githash</code> with the path to the current mfile that is calling <code>githash</code>.
  </p>

  <p>
  Quite frequently, I calculate diagnostics that take a while which means that rerunning them every time I make an image is not feasible. I save the <code>hash</code> variable to the file containing diagnostic output. This lets me know what version of the code created that version of the saved output.
  </p>
  </div>
  </div>

  <div id="outline-container-org6891c23" class="outline-3">
  <h3 id="org6891c23"><span class="section-number-3">5.5</span> Using the hash</h3>
  <div class="outline-text-3" id="text-5-5">
  <p>
  MATLAB&rsquo;s FileExchange has a couple of useful scripts <a href="https://www.mathworks.com/matlabcentral/fileexchange/43179-insert-annotation-in-figure-s-metadata"><code>insertAnnotation</code> &amp; <code>getAnnotation</code></a> that insert and recover metadata in MATLAB figure windows.
  </p>

  <p>
  An obvious choice is to save the hash. More importantly, one can save the exact function call that generated a figure. Then, you know two things:
  </p>
  <ol class="org-ol">
  <li>the version of the code that created the figure, and</li>
  <li>all parameters provided to the code;</li>
  </ol>
  <p>
  both of which are saved in the metadata of the figure <i>itself</i>.
  </p>

  <p>
  <code>getAnnotation</code> can then recover the saved metadata when saving a figure to file.
  </p>
  </div>
  </div>

  <div id="outline-container-org4c2ab29" class="outline-3">
  <h3 id="org4c2ab29"><span class="section-number-3">5.6</span> Saving the hash in an image file</h3>
  <div class="outline-text-3" id="text-5-6">
  <p>
  Once you have a hash value, or any metadata in general, it needs to be saved when the image is saved. I have modified <code>export_fig</code> (<a href="https://github.com/altmany/export_fig">original</a>, <a href="https://github.com/dcherian/export_fig">my fork</a>) to do this for me.
  </p>

  <p>
  In general, all you need is a line that looks like
  </p>
  <div class="org-src-container">
  <pre class="src src-matlab">  system(['exiftool -overwrite_original -Producer=' ...
  hash ' ' pdf_nam]);
  </pre>
  </div>
  <p>
  The above tells exiftool to save the contents of variable <code>hash</code> in the metadata field <code>Producer</code> of the file named <code>pdf_nam</code>. The slight complication here is that the metadata field names are not standardized among different image formats.
  </p>

  <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  <caption class="t-above"><span class="table-number">Table 1:</span> Metadata fields for various image formats that I use to save hashes.</caption>

  <colgroup>
  <col  class="org-left" />

  <col  class="org-left" />

  <col  class="org-left" />

  <col  class="org-left" />

  <col  class="org-left" />
  </colgroup>
  <tbody>
  <tr>
  <td class="org-left"><b>format</b></td>
  <td class="org-left">pdf, eps</td>
  <td class="org-left">png</td>
  <td class="org-left">jpg</td>
  <td class="org-left">tif</td>
  </tr>

  <tr>
  <td class="org-left"><b>metadata field</b></td>
  <td class="org-left">Producer</td>
  <td class="org-left">Software</td>
  <td class="org-left">Comment</td>
  <td class="org-left">Description</td>
  </tr>
  </tbody>
  </table>

  <p>
  <code>exiftool</code> is only required to modify the metadata fields of PDF and EPS files. MATLAB&rsquo;s <code>imwrite</code> can write metadata to bitmap files (e.g. PNG).
  </p>

  <p>
  Searching for <code>hash</code> in my fork of <a href="https://github.com/dcherian/export_fig/blob/master/export_fig.m"><code>export_fig.m</code></a> will show you how <code>imwrite</code> can be used.
  </p>
  </div>
  </div>

  <div id="outline-container-org7ea2499" class="outline-3">
  <h3 id="org7ea2499"><span class="section-number-3">5.7</span> Extracting commit hash from image metadata</h3>
  <div class="outline-text-3" id="text-5-7">
  <p>
  To recover the recorded hash, it suffices to call <code>exiftool FILENAME</code> which will print all metadata stored in the image; not just the hash. <code>grep</code> can then find the recorded hash:
  </p>
  <div class="org-src-container">
  <pre class="src src-bash">  <span style="color: #6f7787;">#</span><span style="color: #6f7787;">!/bin/bash</span>
  <span style="color: #6f7787;"># </span><span style="color: #6f7787;">displays saved </span><span style="color: #6f7787;">git</span><span style="color: #6f7787;"> hash of a provided file using exiftool</span>

  <span style="color: #D8DEE9;">file</span>=$<span style="color: #B48EAD; font-weight: bold;">1</span>
  <span style="color: #D8DEE9;">hash</span>=$<span style="color: #81A1C1;">(</span><span style="color: #81A1C1; font-weight: bold;">exiftool</span> $<span style="color: #D8DEE9;">file</span> | <span style="color: #8FBCBB;">grep</span> -i <span style="color: #A3BE8C;">"hash:"</span><span style="color: #81A1C1;">)</span>

  <span style="color: #8FBCBB;">echo</span> $<span style="color: #D8DEE9;">hash</span>
  </pre>
  </div>
  </div>
  </div>
  ]]></description>
</item>
</channel>
</rss>
