Skip to content

Commit

Permalink
build based on 387d7b7
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Feb 9, 2024
1 parent f56d285 commit de31128
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 62 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2023-10-12T11:13:06","documenter_version":"1.1.1"}}
{"documenter":{"julia_version":"1.6.7","generation_timestamp":"2024-02-09T16:08:49","documenter_version":"1.2.1"}}
4 changes: 2 additions & 2 deletions dev/HOWTOshowmodelandoutput/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
julia&gt; tmodel_raw = PB.get_data(run.output, &quot;atm.tmodel&quot;) # raw data Array</code></pre><p>(here these are the values and coordinate of the <code>pCO2atm</code> <a href="../PALEOmodelOutput/#PALEOmodel.FieldArray"><code>PALEOmodel.FieldArray</code></a>, ie <code>pCO2atm_raw == pCO2atm.values</code> and <code>tmodel_raw == pCO2atm.dims[1].coords[1].values</code>).</p><h2 id="Plot-model-output"><a class="docs-heading-anchor" href="#Plot-model-output">Plot model output</a><a id="Plot-model-output-1"></a><a class="docs-heading-anchor-permalink" href="#Plot-model-output" title="Permalink"></a></h2><p>The output can be plotted using the Julia Plots.jl package, see <a href="../PALEOmodelOutput/#Plotting-output">Plotting output</a>. Plot recipes are defined for <a href="../PALEOmodelOutput/#PALEOmodel.FieldArray"><code>PALEOmodel.FieldArray</code></a>, so output data can be plotted directly using the <code>plot</code> command:</p><pre><code class="nohighlight hljs">julia&gt; using Plots
julia&gt; plot(run.output, &quot;atm.pCO2atm&quot;) # plot output variable as a single command
julia&gt; plot(pCO2atm) # a PALEOmodel.FieldArray can be plotted
julia&gt; plot!(tmodel_raw, pCO2atm_raw, label=&quot;some raw data&quot;) # overlay data from standard Julia Vectors</code></pre><h2 id="Spatial-or-wavelength-dependent-output"><a class="docs-heading-anchor" href="#Spatial-or-wavelength-dependent-output">Spatial or wavelength-dependent output</a><a id="Spatial-or-wavelength-dependent-output-1"></a><a class="docs-heading-anchor-permalink" href="#Spatial-or-wavelength-dependent-output" title="Permalink"></a></h2><p>To analyze spatial or eg wavelength-dependent output (eg time series from a 1D column or 3D general circulation model, or quantities that are a function of wavelength or frequency), <a href="../PALEOmodelOutput/#PALEOmodel.get_array-Tuple{PALEOmodel.AbstractOutputWriter, AbstractString}"><code>PALEOmodel.get_array</code></a> takes an additional <code>selectargs::NamedTuple</code> argument to take 1D or 2D slices from the spatial, spectral and timeseries data. The <a href="../PALEOmodelOutput/#PALEOmodel.FieldArray"><code>PALEOmodel.FieldArray</code></a> returned includes default coordinates to plot column (1D) and heatmap (2D) data, these can be overridden by supplying the optional <code>coords</code> keyword argument.</p><h3 id="Examples-for-a-column-based-model"><a class="docs-heading-anchor" href="#Examples-for-a-column-based-model">Examples for a column-based model</a><a id="Examples-for-a-column-based-model-1"></a><a class="docs-heading-anchor-permalink" href="#Examples-for-a-column-based-model" title="Permalink"></a></h3><p>Visualisation of spatial and wavelength-dependent output from the PALEOdev.jl ozone photochemistry example (a single 1D atmospheric column):</p><h4 id="D-column-data"><a class="docs-heading-anchor" href="#D-column-data">1D column data</a><a id="D-column-data-1"></a><a class="docs-heading-anchor-permalink" href="#D-column-data" title="Permalink"></a></h4><pre><code class="nohighlight hljs">julia&gt; plot(title=&quot;O3 mixing ratio&quot;, output, &quot;atm.O3_mr&quot;, (tmodel=[0.0, 0.1, 1.0, 10.0, 100.0, 1000.0], column=1),
julia&gt; plot!(tmodel_raw, pCO2atm_raw, label=&quot;some raw data&quot;) # overlay data from standard Julia Vectors</code></pre><h2 id="Spatial-or-wavelength-dependent-output"><a class="docs-heading-anchor" href="#Spatial-or-wavelength-dependent-output">Spatial or wavelength-dependent output</a><a id="Spatial-or-wavelength-dependent-output-1"></a><a class="docs-heading-anchor-permalink" href="#Spatial-or-wavelength-dependent-output" title="Permalink"></a></h2><p>To analyze spatial or eg wavelength-dependent output (eg time series from a 1D column or 3D general circulation model, or quantities that are a function of wavelength or frequency), <a href="../PALEOmodelOutput/#PALEOmodel.get_array-Tuple{PALEOmodel.AbstractOutputWriter, AbstractString}"><code>PALEOmodel.get_array</code></a> takes an additional <code>selectargs::NamedTuple</code> argument to take 1D or 2D slices from the spatial, spectral and timeseries data. The <a href="../PALEOmodelOutput/#PALEOmodel.FieldArray"><code>PALEOmodel.FieldArray</code></a> returned includes default coordinates to plot column (1D) and heatmap (2D) data, these can be overridden by supplying the optional <code>coords</code> keyword argument.</p><h3 id="Examples-for-a-column-based-model"><a class="docs-heading-anchor" href="#Examples-for-a-column-based-model">Examples for a column-based model</a><a id="Examples-for-a-column-based-model-1"></a><a class="docs-heading-anchor-permalink" href="#Examples-for-a-column-based-model" title="Permalink"></a></h3><p>Visualisation of spatial and wavelength-dependent output from the PALEOdev.jl ozone photochemistry example (a single 1D atmospheric column):</p><h4 id="1D-column-data"><a class="docs-heading-anchor" href="#1D-column-data">1D column data</a><a id="1D-column-data-1"></a><a class="docs-heading-anchor-permalink" href="#1D-column-data" title="Permalink"></a></h4><pre><code class="nohighlight hljs">julia&gt; plot(title=&quot;O3 mixing ratio&quot;, output, &quot;atm.O3_mr&quot;, (tmodel=[0.0, 0.1, 1.0, 10.0, 100.0, 1000.0], column=1),
swap_xy=true, xscale=:log10, labelattribute=:filter_records) # plots O3 vs default height coordinate</code></pre><p>Here the optional <code>labelattribute=:filter_records</code> keyword argument is used to generate plot labels from the <code>:filter_records</code> FieldArray attribute, which contains the <code>tmodel</code> values used to select the timeseries records. The plot recipe expands the Vector-valued <code>tmodel</code> argument to overlay a sequence of plots.</p><p>This is equivalent to first creating and then plotting a sequence of <code>FieldArray</code> objects:</p><pre><code class="nohighlight hljs">julia&gt; O3_mr = PALEOmodel.get_array(run.output, &quot;atm.O3_mr&quot;, (tmodel=0.0, column=1))
julia&gt; plot(title=&quot;O3 mixing ratio&quot;, O3_mr, swap_xy=true, xscale=:log10, labelattribute=:filter_records)
julia&gt; O3_mr = PALEOmodel.get_array(run.output, &quot;atm.O3_mr&quot;, (tmodel=0.1, column=1))
Expand All @@ -29,4 +29,4 @@
swap_xy=true, xscale=:log10) # plot current value of O2, O3 vs height</code></pre><h4 id="Wavelength-dependent-data"><a class="docs-heading-anchor" href="#Wavelength-dependent-data">Wavelength-dependent data</a><a id="Wavelength-dependent-data-1"></a><a class="docs-heading-anchor-permalink" href="#Wavelength-dependent-data" title="Permalink"></a></h4><pre><code class="nohighlight hljs">julia&gt; plot(title=&quot;direct transmittance&quot;, output, [&quot;atm.direct_trans&quot;], (tmodel=1e12, column=1, cell=[1, 80]),
ylabel=&quot;fraction&quot;, labelattribute=:filter_region) # plots vs wavelength</code></pre><p>Here <code>tmodel=1e12</code> selects the last model time output, and <code>column=1, cell=[1, 80]</code> selects the top and bottom cells within the first (only) 1D column. The <code>labelattribute=:filter_region</code> keyword argument is used to generate plot labels from the <code>:filter_region</code> FieldArray attribute, which contains the <code>column</code> and <code>cell</code> values used to select the spatial region.</p><h3 id="Examples-for-a-3D-GCM-based-model"><a class="docs-heading-anchor" href="#Examples-for-a-3D-GCM-based-model">Examples for a 3D GCM-based model</a><a id="Examples-for-a-3D-GCM-based-model-1"></a><a class="docs-heading-anchor-permalink" href="#Examples-for-a-3D-GCM-based-model" title="Permalink"></a></h3><p>Visualisation of spatial output from the 3D GENIE transport-matrix example (PALEOdev.jl repository)</p><h3 id="Horizontal-slices-across-levels"><a class="docs-heading-anchor" href="#Horizontal-slices-across-levels">Horizontal slices across levels</a><a id="Horizontal-slices-across-levels-1"></a><a class="docs-heading-anchor-permalink" href="#Horizontal-slices-across-levels" title="Permalink"></a></h3><pre><code class="nohighlight hljs">julia&gt; heatmap(run.output, &quot;ocean.O2_conc&quot;, (tmodel=1e12, k=1), swap_xy=true)</code></pre><p>Here <code>k=1</code> selects a horizontal level corresponding to model grid cells with index k=1, which is the ocean surface in the GENIE grid.</p><h3 id="Vertical-section-at-constant-longitude"><a class="docs-heading-anchor" href="#Vertical-section-at-constant-longitude">Vertical section at constant longitude</a><a id="Vertical-section-at-constant-longitude-1"></a><a class="docs-heading-anchor-permalink" href="#Vertical-section-at-constant-longitude" title="Permalink"></a></h3><pre><code class="nohighlight hljs">julia&gt; heatmap(run.output, &quot;ocean.O2_conc&quot;, (tmodel=1e12, i=10), swap_xy=true, mult_y_coord=-1.0)</code></pre><p>Here <code>i=10</code> selects a section at longitude corresponding to model grid cells with index i=10.</p><h2 id="Save-and-load-output"><a class="docs-heading-anchor" href="#Save-and-load-output">Save and load output</a><a id="Save-and-load-output-1"></a><a class="docs-heading-anchor-permalink" href="#Save-and-load-output" title="Permalink"></a></h2><p>Model output can be saved and loaded using the <a href="../PALEOmodelOutput/#PALEOmodel.OutputWriters.save_netcdf"><code>PALEOmodel.OutputWriters.save_netcdf</code></a> and <a href="../PALEOmodelOutput/#PALEOmodel.OutputWriters.load_netcdf!"><code>PALEOmodel.OutputWriters.load_netcdf!</code></a> methods.</p><p>The <a href="../PALEOmodelOutput/#PALEOmodel.OutputWriters.save_jld2"><code>PALEOmodel.OutputWriters.save_jld2</code></a> and <a href="../PALEOmodelOutput/#PALEOmodel.OutputWriters.load_jld2!"><code>PALEOmodel.OutputWriters.load_jld2!</code></a> methods are still available as these files will not remain compatible with future PALEO versions.</p><h2 id="Export-output-to-a-CSV-file"><a class="docs-heading-anchor" href="#Export-output-to-a-CSV-file">Export output to a CSV file</a><a id="Export-output-to-a-CSV-file-1"></a><a class="docs-heading-anchor-permalink" href="#Export-output-to-a-CSV-file" title="Permalink"></a></h2><p>To write Model output from a single Domain to a CSV file:</p><pre><code class="nohighlight hljs">julia&gt; import CSV
julia&gt; CSV.write(&quot;copse_land.csv&quot;, PB.get_table(run.output, &quot;land&quot;)) # all Variables from land Domain
julia&gt; CSV.write(&quot;copse_atm.csv&quot;, PB.get_table(run.output, &quot;atm&quot;)[!, [:tmodel, :pCO2atm, :pO2atm]]) # subset of Variables from atm Domain</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../MathematicalFormulation/">« Mathematical formulation of the reaction-transport problem</a><a class="docs-footer-nextpage" href="../HOWTOsmallnegativevalues/">Managing small and negative values »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.1 on <span class="colophon-date" title="Thursday 12 October 2023 11:13">Thursday 12 October 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
julia&gt; CSV.write(&quot;copse_atm.csv&quot;, PB.get_table(run.output, &quot;atm&quot;)[!, [:tmodel, :pCO2atm, :pO2atm]]) # subset of Variables from atm Domain</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../MathematicalFormulation/">« Mathematical formulation of the reaction-transport problem</a><a class="docs-footer-nextpage" href="../HOWTOsmallnegativevalues/">Managing small and negative values »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 9 February 2024 16:08">Friday 9 February 2024</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit de31128

Please sign in to comment.