Skip to content

Commit

Permalink
build based on 23fd8f3
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptodoctor committed Nov 20, 2023
1 parent 19c254d commit 1aa6074
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
7 changes: 5 additions & 2 deletions dev/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · Batsrus.jl</title><link rel="canonical" href="https://henry2004y.github.io/Batsrus.jl/"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Batsrus.jl</span></div><form class="docs-search" action="search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#Overview-1"><span>Overview</span></a></li><li><a class="tocitem" href="#Installation-1"><span>Installation</span></a></li><li><a class="tocitem" href="#Benchmark-1"><span>Benchmark</span></a></li><li><a class="tocitem" href="#Calling-From-Python-1"><span>Calling From Python</span></a></li><li><a class="tocitem" href="#Developers-1"><span>Developers</span></a></li><li><a class="tocitem" href="#Acknowledgments-1"><span>Acknowledgments</span></a></li></ul></li><li><a class="tocitem" href="man/examples/">Example</a></li><li><a class="tocitem" href="man/internal/">Internal</a></li><li><a class="tocitem" href="man/log/">Log</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/henry2004y/Batsrus.jl/blob/master/docs/src/index.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Batsrus.jl-1"><a class="docs-heading-anchor" href="#Batsrus.jl-1">Batsrus.jl</a><a class="docs-heading-anchor-permalink" href="#Batsrus.jl-1" title="Permalink"></a></h1><h2 id="Overview-1"><a class="docs-heading-anchor" href="#Overview-1">Overview</a><a class="docs-heading-anchor-permalink" href="#Overview-1" title="Permalink"></a></h2><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This package is still under development, so be careful for any future breaking changes!</p></div></div><p><a href="https://github.com/MSTEM-QUDA/BATSRUS">BATSRUS</a> and <a href="https://github.com/MSTEM-QUDA/SWMF">SWMF</a> data reading, converting, visualizing and analyzing in Julia.</p><p>This package provides the following functionalities:</p><ul><li>simulation data reader</li><li>run log plots</li><li>2D/3D region cut from the whole data</li><li>phase space distribution plots</li><li>interpolation from unstructured to structured data</li><li>data format conversion to VTK</li><li>simulation data visualization</li></ul><p>The ultimate goal is to build a convenient tool of reading and analyzing simulation outputs which is easy to install and easy to use.</p><div class="admonition is-success"><header class="admonition-header">Ready to use?</header><div class="admonition-body"><p>Feel free to contact the author for any help or collaboration!</p></div></div><h2 id="Installation-1"><a class="docs-heading-anchor" href="#Installation-1">Installation</a><a class="docs-heading-anchor-permalink" href="#Installation-1" title="Permalink"></a></h2><p>Install VisAna from the <code>julia REPL</code> prompt with</p><pre><code class="language-julia">using Pkg
Pkg.add(&quot;Batsrus&quot;)</code></pre><p>Or in the Pkg REPL</p><pre><code class="language-julia">julia&gt; ]
pkg&gt; add Batsrus</code></pre><h2 id="Benchmark-1"><a class="docs-heading-anchor" href="#Benchmark-1">Benchmark</a><a class="docs-heading-anchor-permalink" href="#Benchmark-1" title="Permalink"></a></h2><p>Data loading speed of a 2.4GB 3D binary file, 317MB 3D binary file, and 65KB 2D binary file on Macbook Pro with quad core 2.2 GHz Intel i7 and 16 GB 1600 MHz DDR3:</p><table><tr><th style="text-align: left">2.4GB</th><th style="text-align: center">tmax [s]</th><th style="text-align: center">tmean [s]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">2.73</td><td style="text-align: center">1.32</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">1.35</td><td style="text-align: center">1.34</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">6.18</td><td style="text-align: center">6.08</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">16.02</td><td style="text-align: center">10.60</td></tr></table><table><tr><th style="text-align: left">317MB</th><th style="text-align: center">tmean [ms]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">180.8</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">179.5</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">453.5</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">698.4</td></tr></table><table><tr><th style="text-align: left">65KB</th><th style="text-align: center">tmean [μs]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">163.36</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">4390.95</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">1970.29</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">19273.25</td></tr></table><p>The Julia, IDL, and MATLAB version all shares the same kernel design. The timings are obtained for Julia v1.3.1, Python 3.7.6 + Numpy 1.18.1, IDL 8.5, and MATLAB R2018b. For dynamic languages with JIT, the first time when function gets executed is also the slowest due to runtime compilation, as can be seen from tmax in the tables. <a href="https://github.com/spacepy/spacepy">spacepy</a> reaches the same level of performance as Batsruls.jl because of the well-optimized numpy library written in C. However, for small data sizes Batsrus.jl is much faster than packages written in other languages.</p><h2 id="Calling-From-Python-1"><a class="docs-heading-anchor" href="#Calling-From-Python-1">Calling From Python</a><a class="docs-heading-anchor-permalink" href="#Calling-From-Python-1" title="Permalink"></a></h2><p>In Python, you can easily take advantage of this package with the aid of <a href="https://pyjulia.readthedocs.io/en/latest/">PyJulia</a>. After the installation, in the Python REPL:</p><pre><code class="language-python">from julia import Batsrus
pkg&gt; add Batsrus</code></pre><h2 id="Benchmark-1"><a class="docs-heading-anchor" href="#Benchmark-1">Benchmark</a><a class="docs-heading-anchor-permalink" href="#Benchmark-1" title="Permalink"></a></h2><p>Data loading speed of a 2.4GB 3D binary file, 317MB 3D binary file, and 65KB 2D binary file on Macbook Pro with quad core 2.2 GHz Intel i7 and 16 GB 1600 MHz DDR3:</p><table><tr><th style="text-align: left">2.4GB</th><th style="text-align: center">tmax [s]</th><th style="text-align: center">tmean [s]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">2.73</td><td style="text-align: center">1.32</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">1.35</td><td style="text-align: center">1.34</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">6.18</td><td style="text-align: center">6.08</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">16.02</td><td style="text-align: center">10.60</td></tr></table><table><tr><th style="text-align: left">317MB</th><th style="text-align: center">tmean [ms]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">180.8</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">179.5</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">453.5</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">698.4</td></tr></table><table><tr><th style="text-align: left">65KB</th><th style="text-align: center">tmean [μs]</th></tr><tr><td style="text-align: left">Julia</td><td style="text-align: center">163.36</td></tr><tr><td style="text-align: left">Python</td><td style="text-align: center">4390.95</td></tr><tr><td style="text-align: left">IDL</td><td style="text-align: center">1970.29</td></tr><tr><td style="text-align: left">MATLAB</td><td style="text-align: center">19273.25</td></tr></table><p>The Julia, IDL, and MATLAB version all shares the same kernel design. The timings are obtained for Julia v1.3.1, Python 3.7.6 + Numpy 1.18.1, IDL 8.5, and MATLAB R2018b. For dynamic languages with JIT, the first time when function gets executed is also the slowest due to runtime compilation, as can be seen from tmax in the tables. <a href="https://github.com/spacepy/spacepy">spacepy</a> reaches the same level of performance as Batsruls.jl because of the well-optimized numpy library written in C. However, for small data sizes Batsrus.jl is much faster than packages written in other languages.</p><h2 id="Calling-From-Python-1"><a class="docs-heading-anchor" href="#Calling-From-Python-1">Calling From Python</a><a class="docs-heading-anchor-permalink" href="#Calling-From-Python-1" title="Permalink"></a></h2><p>In Python, you can easily take advantage of this package with the aid of <a href="https://juliapy.github.io/PythonCall.jl/dev/juliacall/">JuliaCall</a> or <a href="https://pyjulia.readthedocs.io/en/latest/">PyJulia</a>.</p><p>With JuliaCall:</p><pre><code class="language-python">from juliacall import Main as jl
jl.seval(&quot;using Batsrus&quot;)
file = &#39;example.out&#39;
data = Batsrus.load(file, dir=&#39;test&#39;)</code></pre><p>With PyJulia:</p><pre><code class="language-python">from julia import Batsrus
dir = &#39;test&#39;
file = &#39;1d__raw_2_t25.60000_n00000258.out&#39;
data = Batsrus.load(file, dir=dir)</code></pre><p>There you have it! Enjoy!</p><div class="admonition is-warning"><header class="admonition-header">Python dependency</header><div class="admonition-body"><p><code>PyPlot</code> package backend may be affected by the settings of <code>PyJulia</code> dependencies. If you want to set it back properly, you need to recompile the <code>PyCall</code> package in Julia.</p></div></div><h2 id="Developers-1"><a class="docs-heading-anchor" href="#Developers-1">Developers</a><a class="docs-heading-anchor-permalink" href="#Developers-1" title="Permalink"></a></h2><p>This package inherits the ideas and code structures from its predecessor in <a href="https://github.com/MSTEM-QUDA/share/tree/stable/IDL">IDL</a> (developed by Gábor Tóth) and <a href="https://github.com/henry2004y/VisAnaMatlab">MATLAB</a>.</p><p>Batsrus.jl is developed and maintained by <a href="https://github.com/henry2004y">Hongyang Zhou</a>.</p><h2 id="Acknowledgments-1"><a class="docs-heading-anchor" href="#Acknowledgments-1">Acknowledgments</a><a class="docs-heading-anchor-permalink" href="#Acknowledgments-1" title="Permalink"></a></h2><ul><li>All the nice guys who share their codes!</li></ul></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="man/examples/">Example »</a></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Monday 20 November 2023 03:20">Monday 20 November 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
data = Batsrus.load(file, dir=dir)</code></pre><div class="admonition is-warning"><header class="admonition-header">Python dependency</header><div class="admonition-body"><p><code>PyPlot</code> package backend may be affected by the settings of <code>PyJulia</code> dependencies. If you want to set it back properly, you need to recompile the <code>PyCall</code> package in Julia.</p></div></div><h2 id="Developers-1"><a class="docs-heading-anchor" href="#Developers-1">Developers</a><a class="docs-heading-anchor-permalink" href="#Developers-1" title="Permalink"></a></h2><p>This package inherits the ideas and code structures from its predecessor in <a href="https://github.com/MSTEM-QUDA/share/tree/stable/IDL">IDL</a> (developed by Gábor Tóth) and <a href="https://github.com/henry2004y/VisAnaMatlab">MATLAB</a>.</p><p>Batsrus.jl is developed and maintained by <a href="https://github.com/henry2004y">Hongyang Zhou</a>.</p><h2 id="Acknowledgments-1"><a class="docs-heading-anchor" href="#Acknowledgments-1">Acknowledgments</a><a class="docs-heading-anchor-permalink" href="#Acknowledgments-1" title="Permalink"></a></h2><ul><li>All the nice guys who share their codes!</li></ul></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="man/examples/">Example »</a></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Monday 20 November 2023 03:33">Monday 20 November 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 1aa6074

Please sign in to comment.