Commit 43553c57 authored by Philipp Frank's avatar Philipp Frank

removed html and docktree files and added short titles for class pages

parent c40c8571
Pipeline #12663 passed with stage
in 4 minutes and 25 seconds
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &#8212; NIFTY 3.0.x documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.0.x',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>All modules for which code is available</h1>
<ul><li><a href="abc.html">abc</a></li>
<li><a href="nifty/field.html">nifty.field</a></li>
<li><a href="nifty/minimization/conjugate_gradient.html">nifty.minimization.conjugate_gradient</a></li>
<li><a href="nifty/minimization/descent_minimizer.html">nifty.minimization.descent_minimizer</a></li>
<li><a href="nifty/operators/composed_operator/composed_operator.html">nifty.operators.composed_operator.composed_operator</a></li>
<li><a href="nifty/operators/diagonal_operator/diagonal_operator.html">nifty.operators.diagonal_operator.diagonal_operator</a></li>
<li><a href="nifty/operators/fft_operator/fft_operator.html">nifty.operators.fft_operator.fft_operator</a></li>
<li><a href="nifty/operators/fft_operator/transformations/gllmtransformation.html">nifty.operators.fft_operator.transformations.gllmtransformation</a></li>
<li><a href="nifty/operators/fft_operator/transformations/hplmtransformation.html">nifty.operators.fft_operator.transformations.hplmtransformation</a></li>
<li><a href="nifty/operators/fft_operator/transformations/lmgltransformation.html">nifty.operators.fft_operator.transformations.lmgltransformation</a></li>
<li><a href="nifty/operators/fft_operator/transformations/lmhptransformation.html">nifty.operators.fft_operator.transformations.lmhptransformation</a></li>
<li><a href="nifty/operators/fft_operator/transformations/rgrgtransformation.html">nifty.operators.fft_operator.transformations.rgrgtransformation</a></li>
<li><a href="nifty/operators/invertible_operator_mixin/invertible_operator_mixin.html">nifty.operators.invertible_operator_mixin.invertible_operator_mixin</a></li>
<li><a href="nifty/operators/linear_operator/linear_operator.html">nifty.operators.linear_operator.linear_operator</a></li>
<li><a href="nifty/operators/projection_operator/projection_operator.html">nifty.operators.projection_operator.projection_operator</a></li>
<li><a href="nifty/operators/propagator_operator/propagator_operator.html">nifty.operators.propagator_operator.propagator_operator</a></li>
<li><a href="nifty/operators/response_operator/response_operator.html">nifty.operators.response_operator.response_operator</a></li>
<li><a href="nifty/operators/smoothing_operator/smoothing_operator.html">nifty.operators.smoothing_operator.smoothing_operator</a></li>
<li><a href="nifty/spaces/gl_space/gl_space.html">nifty.spaces.gl_space.gl_space</a></li>
<li><a href="nifty/spaces/hp_space/hp_space.html">nifty.spaces.hp_space.hp_space</a></li>
<li><a href="nifty/spaces/lm_space/lm_space.html">nifty.spaces.lm_space.lm_space</a></li>
<li><a href="nifty/spaces/power_space/power_space.html">nifty.spaces.power_space.power_space</a></li>
<li><a href="nifty/spaces/rg_space/rg_space.html">nifty.spaces.rg_space.rg_space</a></li>
<li><a href="nifty/spaces/space/space.html">nifty.spaces.space.space</a></li>
</ul>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/nifty_logo_black.png" alt="Logo"/>
</a></p><div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2017, Theo Steininger.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>nifty.operators.fft_operator.transformations.gllmtransformation &#8212; NIFTY 3.0.x documentation</title>
<link rel="stylesheet" href="../../../../../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../../../',
VERSION: '3.0.x',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
<link rel="stylesheet" href="../../../../../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for nifty.operators.fft_operator.transformations.gllmtransformation</h1><div class="highlight"><pre>
<span></span><span class="c1"># NIFTy</span>
<span class="c1"># Copyright (C) 2017 Theo Steininger</span>
<span class="c1">#</span>
<span class="c1"># Author: Theo Steininger</span>
<span class="c1">#</span>
<span class="c1"># This program is free software: you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation, either version 3 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">nifty.config</span> <span class="k">import</span> <span class="n">dependency_injector</span> <span class="k">as</span> <span class="n">gdi</span>
<span class="kn">from</span> <span class="nn">nifty</span> <span class="k">import</span> <span class="n">GLSpace</span><span class="p">,</span> <span class="n">LMSpace</span>
<span class="kn">from</span> <span class="nn">slicing_transformation</span> <span class="k">import</span> <span class="n">SlicingTransformation</span>
<span class="kn">import</span> <span class="nn">lm_transformation_helper</span>
<span class="n">pyHealpix</span> <span class="o">=</span> <span class="n">gdi</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;pyHealpix&#39;</span><span class="p">)</span>
<div class="viewcode-block" id="GLLMTransformation"><a class="viewcode-back" href="../../../../../gllm_transformation.html#nifty.GLLMTransformation">[docs]</a><span class="k">class</span> <span class="nc">GLLMTransformation</span><span class="p">(</span><span class="n">SlicingTransformation</span><span class="p">):</span>
<span class="c1"># ---Overwritten properties and methods---</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">if</span> <span class="n">module</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">module</span> <span class="o">=</span> <span class="s1">&#39;pyHealpix&#39;</span>
<span class="k">if</span> <span class="n">module</span> <span class="o">!=</span> <span class="s1">&#39;pyHealpix&#39;</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Unsupported SHT module.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;pyHealpix&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">gdi</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ImportError</span><span class="p">(</span>
<span class="s2">&quot;The module pyHealpix is needed but not available.&quot;</span><span class="p">)</span>
<span class="nb">super</span><span class="p">(</span><span class="n">GLLMTransformation</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="p">,</span> <span class="n">module</span><span class="p">)</span>
<span class="c1"># ---Mandatory properties and methods---</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">unitary</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">False</span>
<div class="viewcode-block" id="GLLMTransformation.get_codomain"><a class="viewcode-back" href="../../../../../gllm_transformation.html#nifty.GLLMTransformation.get_codomain">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">get_codomain</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">domain</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Generates a compatible codomain to which transformations are</span>
<span class="sd"> reasonable, i.e.\ an instance of the :py:class:`lm_space` class.</span>
<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> domain: GLSpace</span>
<span class="sd"> Space for which a codomain is to be generated</span>
<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> codomain : LMSpace</span>
<span class="sd"> A compatible codomain.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">GLSpace</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;domain needs to be a GLSpace&quot;</span><span class="p">)</span>
<span class="n">nlat</span> <span class="o">=</span> <span class="n">domain</span><span class="o">.</span><span class="n">nlat</span>
<span class="n">lmax</span> <span class="o">=</span> <span class="n">nlat</span> <span class="o">-</span> <span class="mi">1</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">LMSpace</span><span class="p">(</span><span class="n">lmax</span><span class="o">=</span><span class="n">lmax</span><span class="p">)</span>
<span class="k">return</span> <span class="n">result</span></div>
<span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">check_codomain</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">GLSpace</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;domain is not a GLSpace&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">codomain</span><span class="p">,</span> <span class="n">LMSpace</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;codomain must be a LMSpace.&quot;</span><span class="p">)</span>
<span class="n">nlat</span> <span class="o">=</span> <span class="n">domain</span><span class="o">.</span><span class="n">nlat</span>
<span class="n">nlon</span> <span class="o">=</span> <span class="n">domain</span><span class="o">.</span><span class="n">nlon</span>
<span class="n">lmax</span> <span class="o">=</span> <span class="n">codomain</span><span class="o">.</span><span class="n">lmax</span>
<span class="n">mmax</span> <span class="o">=</span> <span class="n">codomain</span><span class="o">.</span><span class="n">mmax</span>
<span class="k">if</span> <span class="n">lmax</span> <span class="o">!=</span> <span class="n">mmax</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Unrecommended: codomain has lmax != mmax.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">lmax</span> <span class="o">!=</span> <span class="n">nlat</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Unrecommended: codomain has lmax != nlat - 1.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">nlon</span> <span class="o">!=</span> <span class="mi">2</span><span class="o">*</span><span class="n">nlat</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Unrecommended: domain has nlon != 2*nlat - 1.&quot;</span><span class="p">)</span>
<span class="nb">super</span><span class="p">(</span><span class="n">GLLMTransformation</span><span class="p">,</span> <span class="bp">cls</span><span class="p">)</span><span class="o">.</span><span class="n">check_codomain</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_transformation_of_slice</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inp</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">inp</span><span class="o">.</span><span class="n">dtype</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">complex</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;The input array has dtype: </span><span class="si">%s</span><span class="s2">. The FFT will &quot;</span>
<span class="s2">&quot;be performed at double precision.&quot;</span> <span class="o">%</span>
<span class="nb">str</span><span class="p">(</span><span class="n">inp</span><span class="o">.</span><span class="n">dtype</span><span class="p">))</span>
<span class="n">nlat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">nlat</span>
<span class="n">nlon</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">nlon</span>
<span class="n">lmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">codomain</span><span class="o">.</span><span class="n">lmax</span>
<span class="n">mmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">codomain</span><span class="o">.</span><span class="n">mmax</span>
<span class="n">sjob</span> <span class="o">=</span> <span class="n">pyHealpix</span><span class="o">.</span><span class="n">sharpjob_d</span><span class="p">()</span>
<span class="n">sjob</span><span class="o">.</span><span class="n">set_Gauss_geometry</span><span class="p">(</span><span class="n">nlat</span><span class="p">,</span> <span class="n">nlon</span><span class="p">)</span>
<span class="n">sjob</span><span class="o">.</span><span class="n">set_triangular_alm_info</span><span class="p">(</span><span class="n">lmax</span><span class="p">,</span> <span class="n">mmax</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">issubclass</span><span class="p">(</span><span class="n">inp</span><span class="o">.</span><span class="n">dtype</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">complexfloating</span><span class="p">):</span>
<span class="p">[</span><span class="n">resultReal</span><span class="p">,</span> <span class="n">resultImag</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">sjob</span><span class="o">.</span><span class="n">map2alm</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="p">(</span><span class="n">inp</span><span class="o">.</span><span class="n">real</span><span class="p">,</span> <span class="n">inp</span><span class="o">.</span><span class="n">imag</span><span class="p">)]</span>
<span class="p">[</span><span class="n">resultReal</span><span class="p">,</span>
<span class="n">resultImag</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">lm_transformation_helper</span><span class="o">.</span><span class="n">buildIdx</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">lmax</span><span class="o">=</span><span class="n">lmax</span><span class="p">)</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="p">[</span><span class="n">resultReal</span><span class="p">,</span> <span class="n">resultImag</span><span class="p">]]</span>
<span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_combine_complex_result</span><span class="p">(</span><span class="n">resultReal</span><span class="p">,</span> <span class="n">resultImag</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">sjob</span><span class="o">.</span><span class="n">map2alm</span><span class="p">(</span><span class="n">inp</span><span class="p">)</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">lm_transformation_helper</span><span class="o">.</span><span class="n">buildIdx</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">lmax</span><span class="o">=</span><span class="n">lmax</span><span class="p">)</span>
<span class="k">return</span> <span class="n">result</span></div>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../../../index.html">
<img class="logo" src="../../../../../_static/nifty_logo_black.png" alt="Logo"/>
</a></p><div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../../../../../index.html">Documentation overview</a><ul>
<li><a href="../../../../index.html">Module code</a><ul>
</ul></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../../../../../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2017, Theo Steininger.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>nifty.operators.fft_operator.transformations.hplmtransformation &#8212; NIFTY 3.0.x documentation</title>
<link rel="stylesheet" href="../../../../../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../../../',
VERSION: '3.0.x',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
<link rel="stylesheet" href="../../../../../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for nifty.operators.fft_operator.transformations.hplmtransformation</h1><div class="highlight"><pre>
<span></span><span class="c1"># NIFTy</span>
<span class="c1"># Copyright (C) 2017 Theo Steininger</span>
<span class="c1">#</span>
<span class="c1"># Author: Theo Steininger</span>
<span class="c1">#</span>
<span class="c1"># This program is free software: you can redistribute it and/or modify</span>
<span class="c1"># it under the terms of the GNU General Public License as published by</span>
<span class="c1"># the Free Software Foundation, either version 3 of the License, or</span>
<span class="c1"># (at your option) any later version.</span>
<span class="c1">#</span>
<span class="c1"># This program is distributed in the hope that it will be useful,</span>
<span class="c1"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="c1"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span class="c1"># GNU General Public License for more details.</span>
<span class="c1">#</span>
<span class="c1"># You should have received a copy of the GNU General Public License</span>
<span class="c1"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">nifty.config</span> <span class="k">import</span> <span class="n">dependency_injector</span> <span class="k">as</span> <span class="n">gdi</span>
<span class="kn">from</span> <span class="nn">nifty</span> <span class="k">import</span> <span class="n">HPSpace</span><span class="p">,</span> <span class="n">LMSpace</span>
<span class="kn">from</span> <span class="nn">slicing_transformation</span> <span class="k">import</span> <span class="n">SlicingTransformation</span>
<span class="kn">import</span> <span class="nn">lm_transformation_helper</span>
<span class="n">pyHealpix</span> <span class="o">=</span> <span class="n">gdi</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;pyHealpix&#39;</span><span class="p">)</span>
<div class="viewcode-block" id="HPLMTransformation"><a class="viewcode-back" href="../../../../../hplm_transformation.html#nifty.HPLMTransformation">[docs]</a><span class="k">class</span> <span class="nc">HPLMTransformation</span><span class="p">(</span><span class="n">SlicingTransformation</span><span class="p">):</span>
<span class="c1"># ---Overwritten properties and methods---</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">module</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">if</span> <span class="n">module</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">module</span> <span class="o">=</span> <span class="s1">&#39;pyHealpix&#39;</span>
<span class="k">if</span> <span class="n">module</span> <span class="o">!=</span> <span class="s1">&#39;pyHealpix&#39;</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Unsupported SHT module.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;pyHealpix&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">gdi</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ImportError</span><span class="p">(</span>
<span class="s2">&quot;The module pyHealpix is needed but not available&quot;</span><span class="p">)</span>
<span class="nb">super</span><span class="p">(</span><span class="n">HPLMTransformation</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">codomain</span><span class="p">,</span> <span class="n">module</span><span class="p">)</span>
<span class="c1"># ---Mandatory properties and methods---</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">unitary</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">False</span>
<div class="viewcode-block" id="HPLMTransformation.get_codomain"><a class="viewcode-back" href="../../../../../hplm_transformation.html#nifty.HPLMTransformation.get_codomain">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">get_codomain</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">domain</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Generates a compatible codomain to which transformations are</span>
<span class="sd"> reasonable, i.e.\ an instance of the :py:class:`lm_space` class.</span>