Skip to content

Commit

Permalink
split metadata into obs_def and external_FO
Browse files Browse the repository at this point in the history
  • Loading branch information
hkershaw-brown committed Dec 17, 2024
1 parent c83c85e commit ea68901
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 19 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/obs_sequence.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/plots.doctree
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ <h2 id="S">S</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="obs_sequence.html#obs_sequence.select_failed_qcs">select_failed_qcs() (in module obs_sequence)</a>
</li>
<li><a href="obs_sequence.html#obs_sequence.obs_sequence.split_metadata">split_metadata() (obs_sequence.obs_sequence static method)</a>
</li>
</ul></td>
</tr></table>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
23 changes: 23 additions & 0 deletions docs/build/html/obs_sequence.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h3>Navigation</h3>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.copie_names"><code class="docutils literal notranslate"><span class="pre">obs_sequence.copie_names</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.create_all_obs"><code class="docutils literal notranslate"><span class="pre">obs_sequence.create_all_obs()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.obs_to_list"><code class="docutils literal notranslate"><span class="pre">obs_sequence.obs_to_list()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.split_metadata"><code class="docutils literal notranslate"><span class="pre">obs_sequence.split_metadata()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.generate_linked_list_pattern"><code class="docutils literal notranslate"><span class="pre">obs_sequence.generate_linked_list_pattern()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.write_obs_seq"><code class="docutils literal notranslate"><span class="pre">obs_sequence.write_obs_seq()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#obs_sequence.obs_sequence.column_headers"><code class="docutils literal notranslate"><span class="pre">obs_sequence.column_headers()</span></code></a></li>
Expand Down Expand Up @@ -235,6 +236,28 @@ <h3 id="searchlabel">Quick search</h3>
<p>discards obs_def</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="obs_sequence.obs_sequence.split_metadata">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">split_metadata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">metadata</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#obs_sequence.obs_sequence.split_metadata" title="Link to this definition"></a></dt>
<dd><p>Split the metadata list at the first occurrence of an element starting with ‘externalF0’.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>metadata</strong> (<em>list</em><em> of </em><em>str</em>) – The metadata list to be split.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>Two sublists, the first containing elements before ‘externalF0’, and the second</dt><dd><p>containing ‘externalF0’ and all elements after it. If ‘externalF0’ is not found,
the first sublist contains the entire metadata list, and the second is empty.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="obs_sequence.obs_sequence.generate_linked_list_pattern">
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">generate_linked_list_pattern</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#obs_sequence.obs_sequence.generate_linked_list_pattern" title="Link to this definition"></a></dt>
Expand Down
43 changes: 26 additions & 17 deletions docs/build/html/plots.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,41 +132,50 @@ <h3 id="searchlabel">Quick search</h3>

<dl class="py function">
<dt class="sig sig-object py" id="plots.plot_profile">
<span class="sig-prename descclassname"><span class="pre">plots.</span></span><span class="sig-name descname"><span class="pre">plot_profile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">levels</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#plots.plot_profile" title="Link to this definition"></a></dt>
<dd><p>Plots RMSE and Bias profiles for different observation types across specified pressure levels.</p>
<span class="sig-prename descclassname"><span class="pre">plots.</span></span><span class="sig-name descname"><span class="pre">plot_profile</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">df</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">levels</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verticalUnit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'pressure</span> <span class="pre">(Pa)'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#plots.plot_profile" title="Link to this definition"></a></dt>
<dd><p>Plots RMSE, bias, and total spread profiles for different observation types across specified vertical levels.</p>
<p>This function takes a DataFrame containing observational data and model predictions, categorizes
the data into specified pressure levels, and calculates the RMSE and Bias for each level and
observation type. It then plots two line charts: one for RMSE and another for Bias, both as functions
of pressure level. The pressure levels are plotted on the y-axis in reversed order to represent
the vertical profile in the atmosphere correctly.</p>
the data into specified vertical levels, and calculates the RMSE, bias and total spread for each level and
observation type. It then plots three line charts: one for RMSE, one for bias, one for total spread, as functions
of vertical level. The vertical levels are plotted on the y-axis in reversed order to represent
the vertical profile in the atmosphere correctly if the vertical units are pressure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>df</strong> (<em>pd.DataFrame</em>) – The input DataFrame containing at least the ‘vertical’ column for pressure levels,</p></li>
<li><p><strong>Bias.</strong> (<em>and other columns required by the rmse_bias function for calculating RMSE and</em>)</p></li>
<li><p><strong>levels</strong> (<em>array-like</em>) – The bin edges for categorizing the ‘vertical’ column values into pressure levels.</p></li>
<li><p><strong>df</strong> (<em>pd.DataFrame</em>) – The input DataFrame containing at least the ‘vertical’ column for vertical levels,</p></li>
<li><p><strong>column</strong> (<em>the vert_unit</em>)</p></li>
<li><p><strong>and</strong> (<em>and other columns required by the rmse_bias function for calculating RMSE</em>)</p></li>
<li><p><strong>Bias.</strong></p></li>
<li><p><strong>levels</strong> (<em>array-like</em>) – The bin edges for categorizing the ‘vertical’ column values into the desired</p></li>
<li><p><strong>levels.</strong> (<em>vertical</em>)</p></li>
<li><p><strong>verticalUnit</strong> (<em>string</em><em>) </em><em>(</em><em>optional</em>) – The vertical unit to be used. Only observations in df which have this</p></li>
<li><p><strong>'pressure</strong> (<em>string in the vert_unit column will be plotted. Defaults to</em>)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A tuple containing the DataFrame with RMSE and Bias calculations, the RMSE plot figure, and the
Bias plot figure. The DataFrame includes a ‘plevels’ column representing the categorized pressure levels
and ‘hPa’ column representing the midpoint of each pressure level bin.</p>
<dd class="field-even"><p>A tuple containing the DataFrame with RMSE, bias and total spread calculations,
The DataFrame includes a ‘vlevels’ column representing the categorized vertical levels
and ‘midpoint’ column representing the midpoint of each vertical level bin. And the three figures.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>ValueError</strong> – If there are missing values in the ‘vertical’ column of the input DataFrame.</p>
<dd class="field-even"><ul class="simple">
<li><p><strong>ValueError</strong> – If there are missing values in the ‘vertical’ column of the input DataFrame.</p></li>
<li><p><strong>ValueError</strong> – If none of the input obs have ‘verticalUnit’ in the ‘vert_unit’ column of the input DataFrame.</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>The function modifies the input DataFrame by adding ‘plevels’ and ‘hPa’ columns.</p></li>
<li><p>The ‘hPa’ values are calculated as half the midpoint of each pressure level bin, which may need
adjustment based on the specific requirements for pressure level representation.</p></li>
<li><p>The function modifies the input DataFrame by adding ‘vlevels’ and ‘midpoint’ columns.</p></li>
<li><p>The ‘midpoint’ values are calculated as half the midpoint of each vertical level bin, which may need
adjustment based on the specific requirements for vertical level representation.</p></li>
<li><p>The plots are generated using Plotly Express and are displayed inline. The y-axis of the plots is
reversed to align with standard atmospheric pressure level representation.</p></li>
reversed to align with standard atmospheric pressure level representation if the vertical units
are atmospheric pressure.</p></li>
</ul>
</div>
</dd></dl>
Expand Down
Loading

0 comments on commit ea68901

Please sign in to comment.