Skip to content

Commit

Permalink
deploy: ff7e4bd
Browse files Browse the repository at this point in the history
  • Loading branch information
iancze committed Dec 9, 2023
1 parent d5ca210 commit a337d08
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 28 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 28 additions & 10 deletions _modules/mpol/gridding.html
Original file line number Diff line number Diff line change
Expand Up @@ -888,22 +888,40 @@ <h1>Source code for mpol.gridding</h1><div class="highlight"><pre>
<span class="c1"># make sure we still fit into the grid</span>
<span class="bp">self</span><span class="o">.</span><span class="n">coords</span><span class="o">.</span><span class="n">check_data_fit</span><span class="p">(</span><span class="n">uu</span><span class="p">,</span> <span class="n">vv</span><span class="p">)</span>

<span class="c1"># expand the vectors to include complex conjugates</span>
<span class="n">uu_full</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="n">uu</span><span class="p">,</span> <span class="o">-</span><span class="n">uu</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="n">vv_full</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="n">vv</span><span class="p">,</span> <span class="o">-</span><span class="n">vv</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="c1"># initialize base objects </span>
<span class="c1"># Hermitian conjugates taken care of by @property below</span>
<span class="bp">self</span><span class="o">.</span><span class="n">uu_base</span> <span class="o">=</span> <span class="n">uu</span>
<span class="bp">self</span><span class="o">.</span><span class="n">vv_base</span> <span class="o">=</span> <span class="n">vv</span>
<span class="bp">self</span><span class="o">.</span><span class="n">weight_base</span> <span class="o">=</span> <span class="n">weight</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data_re_base</span> <span class="o">=</span> <span class="n">data_re</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data_im_base</span> <span class="o">=</span> <span class="n">data_im</span>

<span class="c1"># make sure we still fit into the grid (with expansion)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">coords</span><span class="o">.</span><span class="n">check_data_fit</span><span class="p">(</span><span class="n">uu_full</span><span class="p">,</span> <span class="n">vv_full</span><span class="p">)</span>

<span class="bp">self</span><span class="o">.</span><span class="n">uu</span> <span class="o">=</span> <span class="n">uu_full</span>
<span class="bp">self</span><span class="o">.</span><span class="n">vv</span> <span class="o">=</span> <span class="n">vv_full</span>
<span class="bp">self</span><span class="o">.</span><span class="n">weight</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="n">weight</span><span class="p">,</span> <span class="n">weight</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data_re</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="n">data_re</span><span class="p">,</span> <span class="n">data_re</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data_im</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="n">data_im</span><span class="p">,</span> <span class="o">-</span><span class="n">data_im</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">coords</span><span class="o">.</span><span class="n">check_data_fit</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uu</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">vv</span><span class="p">)</span>

<span class="c1"># and register cell indices against data</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_create_cell_indices</span><span class="p">()</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">uu</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">uu_base</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">uu_base</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">vv</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">vv_base</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">vv_base</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">weight</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">weight_base</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">weight_base</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">data_re</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">data_re_base</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_re_base</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">data_im</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">concatenate</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">data_im_base</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">data_im_base</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_grid_visibilities</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">weighting</span><span class="o">=</span><span class="s2">&quot;uniform&quot;</span><span class="p">,</span>
Expand Down
2 changes: 1 addition & 1 deletion ci-tutorials/crossvalidation.html
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ <h2>Choosing the K-folds<a class="headerlink" href="#choosing-the-k-folds" title
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>650160 visibilities total
</pre></div>
</div>
<img alt="../_images/958bb523be930d0f282c5151c2aebdcf029039966e12db8b01114a1ef58c18f6.png" src="../_images/958bb523be930d0f282c5151c2aebdcf029039966e12db8b01114a1ef58c18f6.png" />
<img alt="../_images/f34fbea9dcc11ccb0a3d62949b861df7b302c57efd98182a0c9ae528bfc6e48a.png" src="../_images/f34fbea9dcc11ccb0a3d62949b861df7b302c57efd98182a0c9ae528bfc6e48a.png" />
</div>
</div>
<p>As you can see, this training set looks very similar to the full dataset, with the same holes in <span class="math notranslate nohighlight">\(u\)</span>,<span class="math notranslate nohighlight">\(v\)</span> coverage and similar sampling densities.</p>
Expand Down
14 changes: 7 additions & 7 deletions ci-tutorials/fakedata.html
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ <h2>Exporting to a Numpy array and setting flux scale<a class="headerlink" href=
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.image.AxesImage at 0x7f72b4bef9d0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.image.AxesImage at 0x7f4db56f7a60&gt;
</pre></div>
</div>
<img alt="../_images/be79b995a2a50bbef7c7e91994d8e1236259a969198edba72563cf87593c642d.png" src="../_images/be79b995a2a50bbef7c7e91994d8e1236259a969198edba72563cf87593c642d.png" />
Expand All @@ -617,7 +617,7 @@ <h2>Exporting to a Numpy array and setting flux scale<a class="headerlink" href=
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.image.AxesImage at 0x7f72b44b3f70&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.image.AxesImage at 0x7f4db46d7f40&gt;
</pre></div>
</div>
<img alt="../_images/a44fc2c19d14ce07c780c6b36d662170cba0b55b28bb6fd0f4cf9182abdda2e6.png" src="../_images/a44fc2c19d14ce07c780c6b36d662170cba0b55b28bb6fd0f4cf9182abdda2e6.png" />
Expand Down Expand Up @@ -795,9 +795,9 @@ <h2>Making the mock dataset<a class="headerlink" href="#making-the-mock-dataset"
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(1, 325080)
(1, 325080)
[[-1.79780438-1.73162319j 7.41403178+1.48131263j 0.68172034+3.21586958j
... -0.76935132+2.93928442j -1.29920788+1.4254061j
-0.10100563-0.94763065j]]
[[-0.01159151+0.54318067j 10.20341834+1.01167639j 0.58416785-0.59098923j
... -3.12557631-4.09652898j 1.35956506-0.89833262j
0.35132852-0.67053683j]]
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -874,7 +874,7 @@ <h2>Verifying the mock dataset<a class="headerlink" href="#verifying-the-mock-da
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/327db68e1d4d4b4d965c7e18d081e6120380c8b926fe53ca3b8e692d2ca84d04.png" src="../_images/327db68e1d4d4b4d965c7e18d081e6120380c8b926fe53ca3b8e692d2ca84d04.png" />
<img alt="../_images/33e005eedf3c86303b60ae3ccf56b98469b1250e7d344c10af2bb5e025fd6405.png" src="../_images/33e005eedf3c86303b60ae3ccf56b98469b1250e7d344c10af2bb5e025fd6405.png" />
</div>
</div>
<p>We can even subtract this on a pixel-by-pixel basis and compare to the original image.</p>
Expand Down Expand Up @@ -905,7 +905,7 @@ <h2>Verifying the mock dataset<a class="headerlink" href="#verifying-the-mock-da
</div>
</div>
<div class="cell_output docutils container">
<img alt="../_images/a335e7ad6e2a175ba8494222554780269dd83932816468a35135aea7bd8bc995.png" src="../_images/a335e7ad6e2a175ba8494222554780269dd83932816468a35135aea7bd8bc995.png" />
<img alt="../_images/a031f9fd3d18e906c836a4d8b761cb577797ecd73b9b672fe683d8d9edc24641.png" src="../_images/a031f9fd3d18e906c836a4d8b761cb577797ecd73b9b672fe683d8d9edc24641.png" />
</div>
</div>
<p>The subtraction revears some interesting artefacts.</p>
Expand Down
6 changes: 3 additions & 3 deletions ci-tutorials/initializedirtyimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ <h2>Image Setup<a class="headerlink" href="#image-setup" title="Permalink to thi
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fcba0f30bb0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7f3b1917fd90&gt;
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;Figure size 1920x1440 with 0 Axes&gt;
Expand Down Expand Up @@ -558,7 +558,7 @@ <h2>Training Loop<a class="headerlink" href="#training-loop" title="Permalink to
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fcb94fda130&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7f3b14243310&gt;
</pre></div>
</div>
<img alt="../_images/a7b01ee208da2c6850766253588c09728455a336b72ac0c4de5e5c174cb84e61.png" src="../_images/a7b01ee208da2c6850766253588c09728455a336b72ac0c4de5e5c174cb84e61.png" />
Expand Down Expand Up @@ -593,7 +593,7 @@ <h2>Training Loop<a class="headerlink" href="#training-loop" title="Permalink to
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fcb94f21a90&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7f3b14188c70&gt;
</pre></div>
</div>
<img alt="../_images/34a9a9c0db71dffeacf1b63ae79ae4de46f83d8aae46be3d698bf6ff318d6791.png" src="../_images/34a9a9c0db71dffeacf1b63ae79ae4de46f83d8aae46be3d698bf6ff318d6791.png" />
Expand Down
12 changes: 6 additions & 6 deletions ci-tutorials/optimization.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ <h2>Gradient descent<a class="headerlink" href="#gradient-descent" title="Permal
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fd9d8dba6d0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7efbc6c3bd60&gt;
</pre></div>
</div>
<img alt="../_images/a22504f6df41e5156e9d931c07df951232ae52bc8134c7f62371b347bbeabf5e.png" src="../_images/a22504f6df41e5156e9d931c07df951232ae52bc8134c7f62371b347bbeabf5e.png" />
Expand Down Expand Up @@ -671,7 +671,7 @@ <h2>Gradient descent<a class="headerlink" href="#gradient-descent" title="Permal
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fd9d459cca0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7efbc43731c0&gt;
</pre></div>
</div>
<img alt="../_images/cc08ac013e4d1302828d6182b0cbdc8e1bd0b754c201d23e801394ac99050b6e.png" src="../_images/cc08ac013e4d1302828d6182b0cbdc8e1bd0b754c201d23e801394ac99050b6e.png" />
Expand Down Expand Up @@ -728,7 +728,7 @@ <h2>Gradient descent<a class="headerlink" href="#gradient-descent" title="Permal
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fd9d446ba90&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7efbc4287040&gt;
</pre></div>
</div>
<img alt="../_images/87d3f9f450266b13d76a233cc18fdbd414d36639350fafb5d5dce309c3cee5c5.png" src="../_images/87d3f9f450266b13d76a233cc18fdbd414d36639350fafb5d5dce309c3cee5c5.png" />
Expand Down Expand Up @@ -765,8 +765,8 @@ <h2>Iterating the training Loop<a class="headerlink" href="#iterating-the-traini
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 18.7 s, sys: 2.68 s, total: 21.4 s
Wall time: 11.4 s
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>CPU times: user 18.3 s, sys: 2.77 s, total: 21 s
Wall time: 11.2 s
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -811,7 +811,7 @@ <h2>Visualizing the image<a class="headerlink" href="#visualizing-the-image" tit
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7fd9d6fd0be0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;matplotlib.colorbar.Colorbar at 0x7efbc4def2b0&gt;
</pre></div>
</div>
<img alt="../_images/d6504f8658d9cebd116783bd607d36f77ef3f2041afe8be9145eaa160a5afcd9.png" src="../_images/d6504f8658d9cebd116783bd607d36f77ef3f2041afe8be9145eaa160a5afcd9.png" />
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit a337d08

Please sign in to comment.