Skip to content

Commit

Permalink
build based on 6d2d4c3
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 25, 2024
1 parent fd44550 commit e61713c
Show file tree
Hide file tree
Showing 44 changed files with 9,937 additions and 9,937 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.11.1","generation_timestamp":"2024-10-25T13:31:03","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-25T13:31:30","documenter_version":"1.7.0"}}
4 changes: 2 additions & 2 deletions dev/datasets/datasets/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dev/examples/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

flux = invokemodel(energy, model)

plot(energy[1:end-1], flux)</code></pre><img src="235acfcc.svg" alt="Example block output"/><p>Note this energy grid may be arbitrarily spaced, but, like XSPEC, assumes the bins are contiguous, i.e. that the high energy limit of one bin is the low energy limit of the next.</p><p>The full model library of available models is listed in <a href="../../models/models/#Model-index">Model index</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../walkthrough/">« Walkthrough</a><a class="docs-footer-nextpage" href="../sherpa-example/">A quick guide »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 13:31">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot(energy[1:end-1], flux)</code></pre><img src="6739ab7a.svg" alt="Example block output"/><p>Note this energy grid may be arbitrarily spaced, but, like XSPEC, assumes the bins are contiguous, i.e. that the high energy limit of one bin is the low energy limit of the next.</p><p>The full model library of available models is listed in <a href="../../models/models/#Model-index">Model index</a>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../walkthrough/">« Walkthrough</a><a class="docs-footer-nextpage" href="../sherpa-example/">A quick guide »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 13:31">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions dev/examples/sherpa-example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

y_noisy = y .+ (0.2 * randn(length(y)))

scatter(x, y_noisy)</code></pre><img src="bdab0056.svg" alt="Example block output"/><p>To make this into a fittable dataset, we observe that our layout is injective (i.e. <code>length(x) == length(y)</code>). This is subtly different from how the majority of spectral models are implemented, which usually assume some kind of binning (<code>length(x) == length(y) + 1</code>). Fortunately, SpectralFitting.jl can track this for us, and do various conversion to make the models work correctly for the data. We need only tell the package what our <a href="../../datasets/datasets/#SpectralFitting.AbstractLayout"><code>AbstractLayout</code></a> is:</p><pre><code class="language-julia hljs">data = InjectiveData(x, y_noisy; name = &quot;example&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr36">InjectiveData</span> with <span class="sgr36">200</span> data points:
scatter(x, y_noisy)</code></pre><img src="89f94673.svg" alt="Example block output"/><p>To make this into a fittable dataset, we observe that our layout is injective (i.e. <code>length(x) == length(y)</code>). This is subtly different from how the majority of spectral models are implemented, which usually assume some kind of binning (<code>length(x) == length(y) + 1</code>). Fortunately, SpectralFitting.jl can track this for us, and do various conversion to make the models work correctly for the data. We need only tell the package what our <a href="../../datasets/datasets/#SpectralFitting.AbstractLayout"><code>AbstractLayout</code></a> is:</p><pre><code class="language-julia hljs">data = InjectiveData(x, y_noisy; name = &quot;example&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr36">InjectiveData</span> with <span class="sgr36">200</span> data points:
│ Name : example
│ . Domain (min/max) : (-5.0000, 5.0)
│ . Codomain (min/max) : (-0.42323, 3.3787)
</code></pre><p>The data prints the <em>data card</em>, which provides us some high level information about our data at a glance. We can plot the data trivially using one of the Plots.jl recipes</p><pre><code class="language-julia hljs">plot(data, markersize = 3)</code></pre><img src="e6cf2779.svg" alt="Example block output"/><p>Next we want to specify a model to fit to this data. Models that are prefixed with <code>XS_</code> are models that are linked from the XSPEC model library, provided via <a href="https://github.com/astro-group-bristol/LibXSPEC_jll.jl">LibXSPEC_jll</a>. For a full list of the models, see <a href="@ref">Models index</a>.</p><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>It is advised to <strong>use the Julia implemented models</strong>. This allows various calculations to benefit from automatic differentiation, efficient multi-threading, GPU offloading, and various other useful things, see <a href="../../why-and-how/#Why-and-how">Why &amp; how</a>.</p></div></div><pre><code class="language-julia hljs">model = GaussianLine(μ = FitParam(0.0))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ GaussianLine
</code></pre><p>The data prints the <em>data card</em>, which provides us some high level information about our data at a glance. We can plot the data trivially using one of the Plots.jl recipes</p><pre><code class="language-julia hljs">plot(data, markersize = 3)</code></pre><img src="dfd3ba37.svg" alt="Example block output"/><p>Next we want to specify a model to fit to this data. Models that are prefixed with <code>XS_</code> are models that are linked from the XSPEC model library, provided via <a href="https://github.com/astro-group-bristol/LibXSPEC_jll.jl">LibXSPEC_jll</a>. For a full list of the models, see <a href="@ref">Models index</a>.</p><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>It is advised to <strong>use the Julia implemented models</strong>. This allows various calculations to benefit from automatic differentiation, efficient multi-threading, GPU offloading, and various other useful things, see <a href="../../why-and-how/#Why-and-how">Why &amp; how</a>.</p></div></div><pre><code class="language-julia hljs">model = GaussianLine(μ = FitParam(0.0))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ GaussianLine
│ K -&gt; 1 ± 0.1 ∈ [ 0, Inf ]<span class="sgr32"> FREE</span>
│ μ -&gt; 0 ± 0 ∈ [ 0, Inf ]<span class="sgr32"> FREE</span>
│ σ -&gt; 1 ± 0.1 ∈ [ 0, Inf ]<span class="sgr32"> FREE</span>
</code></pre><p>We can plot our model over the same domain range quite easily too:</p><pre><code class="language-julia hljs">plot(data.domain[1:end-1], invokemodel(data.domain, model))</code></pre><img src="5c12f761.svg" alt="Example block output"/><p>Note that we&#39;ve had to adjust the domain here. As stated before, most models are implemented for binned data, and therefore return one fewer bin than given.</p><p>SpectralFitting.jl adopts the SciML problem-solver abstraction, so to fit a model to data we specify a <a href="@ref"><code>FittingProblem</code></a>:</p><pre><code class="language-julia hljs">prob = FittingProblem(model =&gt; data)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ FittingProblem:
</code></pre><p>We can plot our model over the same domain range quite easily too:</p><pre><code class="language-julia hljs">plot(data.domain[1:end-1], invokemodel(data.domain, model))</code></pre><img src="d1690db8.svg" alt="Example block output"/><p>Note that we&#39;ve had to adjust the domain here. As stated before, most models are implemented for binned data, and therefore return one fewer bin than given.</p><p>SpectralFitting.jl adopts the SciML problem-solver abstraction, so to fit a model to data we specify a <a href="@ref"><code>FittingProblem</code></a>:</p><pre><code class="language-julia hljs">prob = FittingProblem(model =&gt; data)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ FittingProblem:
│ . Models : 1
│ . Datasets : 1
│ Parameter Summary:
Expand All @@ -36,7 +36,7 @@
│ . σᵤ : [9.2751, 0.071547, 0.071547]
│ . χ² : 7.7600
</code></pre><p>The result card tells us a little bit about how successful the fit was. We further inspect the fit by overplotting result on the data:</p><pre><code class="language-julia hljs">plot(data, markersize = 3)
plot!(result)</code></pre><img src="471aea45.svg" alt="Example block output"/><p>We can create a contour plot of the fit statistic by evaluating the result everywhere on the grid and measuring the statistic:</p><pre><code class="language-julia hljs">amps = range(50, 200, 50)
plot!(result)</code></pre><img src="0d3d0e36.svg" alt="Example block output"/><p>We can create a contour plot of the fit statistic by evaluating the result everywhere on the grid and measuring the statistic:</p><pre><code class="language-julia hljs">amps = range(50, 200, 50)
devs = range(0.5, 1.2, 50)

stats = [
Expand All @@ -54,4 +54,4 @@
xlabel = &quot;K&quot;,
ylabel = &quot;σ&quot;
)
scatter!([result.u[1]], [result.u[3]])</code></pre><img src="d2d5105d.svg" alt="Example block output"/><h2 id="Simultaneous-fits"><a class="docs-heading-anchor" href="#Simultaneous-fits">Simultaneous fits</a><a id="Simultaneous-fits-1"></a><a class="docs-heading-anchor-permalink" href="#Simultaneous-fits" title="Permalink"></a></h2></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../examples/">« Diverse examples</a><a class="docs-footer-nextpage" href="../../models/using-models/">Using models »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 13:31">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
scatter!([result.u[1]], [result.u[3]])</code></pre><img src="ce106354.svg" alt="Example block output"/><h2 id="Simultaneous-fits"><a class="docs-heading-anchor" href="#Simultaneous-fits">Simultaneous fits</a><a id="Simultaneous-fits-1"></a><a class="docs-heading-anchor-permalink" href="#Simultaneous-fits" title="Permalink"></a></h2></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../examples/">« Diverse examples</a><a class="docs-footer-nextpage" href="../../models/using-models/">Using models »</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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 25 October 2024 13:31">Friday 25 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit e61713c

Please sign in to comment.