Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 10, 2024
1 parent 3c8b7b9 commit 8bf10ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions latest/_modules/compass/ocean/mesh/remap_topography.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
<h1>Source code for compass.ocean.mesh.remap_topography</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">os</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">xarray</span> <span class="k">as</span> <span class="nn">xr</span>
<span class="kn">from</span> <span class="nn">mpas_tools.io</span> <span class="kn">import</span> <span class="n">write_netcdf</span>
<span class="kn">from</span> <span class="nn">pyremap</span> <span class="kn">import</span> <span class="n">LatLonGridDescriptor</span><span class="p">,</span> <span class="n">MpasCellMeshDescriptor</span><span class="p">,</span> <span class="n">Remapper</span>
Expand Down Expand Up @@ -264,6 +265,11 @@ <h1>Source code for compass.ocean.mesh.remap_topography</h1><div class="highligh
<span class="n">out_var</span> <span class="o">=</span> <span class="n">rename</span><span class="p">[</span><span class="n">option</span><span class="p">]</span>
<span class="n">ds_out</span><span class="p">[</span><span class="n">out_var</span><span class="p">]</span> <span class="o">=</span> <span class="n">ds_in</span><span class="p">[</span><span class="n">in_var</span><span class="p">]</span>

<span class="c1"># make sure fractions don&#39;t exceed 1</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;landIceFracObserved&#39;</span><span class="p">,</span> <span class="s1">&#39;landIceGroundedFracObserved&#39;</span><span class="p">,</span>
<span class="s1">&#39;oceanFracObserved&#39;</span><span class="p">]:</span>
<span class="n">ds_out</span><span class="p">[</span><span class="n">var</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">minimum</span><span class="p">(</span><span class="n">ds_out</span><span class="p">[</span><span class="n">var</span><span class="p">],</span> <span class="mf">1.</span><span class="p">)</span>

<span class="c1"># renormalize elevation variables</span>
<span class="n">norm</span> <span class="o">=</span> <span class="n">ds_out</span><span class="o">.</span><span class="n">oceanFracObserved</span>
<span class="n">valid</span> <span class="o">=</span> <span class="n">norm</span> <span class="o">&gt;</span> <span class="n">renorm_threshold</span>
Expand Down

0 comments on commit 8bf10ad

Please sign in to comment.