|
3 | 3 | using Downloads: download |
4 | 4 |
|
5 | 5 | # First load a FITS file of interest |
6 | | -herca = load(download("https://www.chandra.harvard.edu/photo/2014/archives/fits/herca/herca_radio.fits"))</code></pre><img src="32a538cb.png" alt="Example block output"/><p>Create a contour plot</p><pre><code class="language-julia hljs">contour(herca)</code></pre><img src="ec9e5156.svg" alt="Example block output"/><p>Create a filled contour plot</p><pre><code class="language-julia hljs">contourf(herca)</code></pre><img src="fc434c36.svg" alt="Example block output"/><p>Specify the number of levels</p><pre><code class="language-julia hljs">contour(herca; levels = 5)</code></pre><img src="64691018.svg" alt="Example block output"/><p>Specify specific levels</p><pre><code class="language-julia hljs">contour(herca; levels = [1, 1000, 5000])</code></pre><img src="91066521.svg" alt="Example block output"/><p>Overplot contours on image:</p><pre><code class="language-julia hljs">implot(herca) |
7 | | -contour!(herca; levels = 4, color = :cyan)</code></pre><img src="dfe92b9b.svg" alt="Example block output"/><h2 id="Using-Contour.jl"><a class="docs-heading-anchor" href="#Using-Contour.jl">Using Contour.jl</a><a id="Using-Contour.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Using-Contour.jl" title="Permalink"></a></h2><p>For more control over how contours are calculated and plotted, you can use the <a href="https://juliageometry.github.io/Contour.jl/stable/">Contour.jl</a> package:</p><pre><code class="language-julia hljs">using Contour |
| 6 | +herca = load(download("https://www.chandra.harvard.edu/photo/2014/archives/fits/herca/herca_radio.fits"))</code></pre><img src="32a538cb.png" alt="Example block output"/><p>Create a contour plot</p><pre><code class="language-julia hljs">contour(herca)</code></pre><img src="b0df6c5e.svg" alt="Example block output"/><p>Create a filled contour plot</p><pre><code class="language-julia hljs">contourf(herca)</code></pre><img src="a62871ac.svg" alt="Example block output"/><p>Specify the number of levels</p><pre><code class="language-julia hljs">contour(herca; levels = 5)</code></pre><img src="146bc24e.svg" alt="Example block output"/><p>Specify specific levels</p><pre><code class="language-julia hljs">contour(herca; levels = [1, 1000, 5000])</code></pre><img src="46383177.svg" alt="Example block output"/><p>Overplot contours on image:</p><pre><code class="language-julia hljs">implot(herca) |
| 7 | +contour!(herca; levels = 4, color = :cyan)</code></pre><img src="4a643bf0.svg" alt="Example block output"/><h2 id="Using-Contour.jl"><a class="docs-heading-anchor" href="#Using-Contour.jl">Using Contour.jl</a><a id="Using-Contour.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Using-Contour.jl" title="Permalink"></a></h2><p>For more control over how contours are calculated and plotted, you can use the <a href="https://juliageometry.github.io/Contour.jl/stable/">Contour.jl</a> package:</p><pre><code class="language-julia hljs">using Contour |
8 | 8 |
|
9 | 9 | p = implot(herca; cmap = nothing, colorbar = false) |
10 | 10 |
|
|
18 | 18 | end |
19 | 19 | end |
20 | 20 |
|
21 | | -p</code></pre><img src="b78decf8.svg" alt="Example block output"/><p>Here we plot just the contours, now in world coordinates:</p><pre><code class="language-julia hljs">p = plot(xlabel = "RA", ylabel = "DEC") |
| 21 | +p</code></pre><img src="bb3fca27.svg" alt="Example block output"/><p>Here we plot just the contours, now in world coordinates:</p><pre><code class="language-julia hljs">p = plot(xlabel = "RA", ylabel = "DEC") |
22 | 22 |
|
23 | 23 | for cl in levels(contours(dims(herca)..., float.(herca))) |
24 | 24 | lvl = level(cl) # the z-value of this contour level |
|
31 | 31 | end |
32 | 32 | end |
33 | 33 |
|
34 | | -p</code></pre><img src="b74b8b2b.svg" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../photometry/">« Extracting Photometry</a><a class="docs-footer-nextpage" href="../../api/">API »</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.17.0 on <span class="colophon-date" title="Friday 8 May 2026 14:56">Friday 8 May 2026</span>. Using Julia version 1.12.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
| 34 | +p</code></pre><img src="53b732e8.svg" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../photometry/">« Extracting Photometry</a><a class="docs-footer-nextpage" href="../../api/">API »</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.17.0 on <span class="colophon-date" title="Friday 8 May 2026 17:15">Friday 8 May 2026</span>. Using Julia version 1.12.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
0 commit comments