gl_space.html 21.1 KB
Newer Older
Philipp Frank's avatar
Philipp Frank committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467

<!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>The GLSpace class – Gauss-Legendre pixelization of the sphere &#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="next" title="The LMSpace class – Spherical Harmonics components" href="lm_space.html" />
    <link rel="prev" title="The HPSpace class – HEALPix discretization of the sphere" href="hp_space.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">
            
  <div class="section" id="the-glspace-class-gauss-legendre-pixelization-of-the-sphere">
<h1>The <code class="docutils literal"><span class="pre">GLSpace</span></code> class – Gauss-Legendre pixelization of the sphere<a class="headerlink" href="#the-glspace-class-gauss-legendre-pixelization-of-the-sphere" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="nifty.GLSpace">
<em class="property">class </em><code class="descclassname">nifty.</code><code class="descname">GLSpace</code><a class="reference internal" href="_modules/nifty/spaces/gl_space/gl_space.html#GLSpace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nifty.GLSpace" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">nifty.spaces.space.space.Space</span></code></p>
<p>NIFTY subclass for Gauss-Legendre pixelizations <a class="footnote-reference" href="#id3" id="id1">[1]</a> of the two-sphere.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>nlat</strong> : int</p>
<blockquote>
<div><p>Number of latitudinal bins (or rings) that are used for this
pixelization.</p>
</div></blockquote>
<p><strong>nlon</strong> : int, <em>optional</em></p>
<blockquote>
<div><p>Number of longditudinal bins that are used for this pixelization.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>ValueError</strong></p>
<blockquote>
<div><p>If input <cite>nlat</cite> or <cite>nlon</cite> is invalid.</p>
</div></blockquote>
<p><strong>ImportError</strong></p>
<blockquote class="last">
<div><p>If the pyHealpix module is not available</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><code class="xref py py-obj docutils literal"><span class="pre">hp_space</span></code></dt>
<dd>A class for the HEALPix discretization of the sphere <a class="footnote-reference" href="#id4" id="id2">[2]</a>.</dd>
<dt><code class="xref py py-obj docutils literal"><span class="pre">lm_space</span></code></dt>
<dd>A class for spherical harmonic components.</dd>
</dl>
</div>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>M. Reinecke and D. Sverre Seljebotn, 2013, “Libsharp - spherical
harmonic transforms revisited”;
<a class="reference external" href="http://www.arxiv.org/abs/1303.4945">arXiv:1303.4945</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>K.M. Gorski et al., 2005, “HEALPix: A Framework for
High-Resolution Discretization and Fast Analysis of Data
Distributed on the Sphere”, <em>ApJ</em> 622..759G.</td></tr>
</tbody>
</table>
<p class="rubric">Attributes</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#nifty.GLSpace.dim" title="nifty.GLSpace.dim"><code class="xref py py-obj docutils literal"><span class="pre">dim</span></code></a></td>
<td>Returns the number of pixel-dimensions the object has.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#nifty.GLSpace.harmonic" title="nifty.GLSpace.harmonic"><code class="xref py py-obj docutils literal"><span class="pre">harmonic</span></code></a></td>
<td>Returns True if this space is a harmonic space.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#nifty.GLSpace.nlat" title="nifty.GLSpace.nlat"><code class="xref py py-obj docutils literal"><span class="pre">nlat</span></code></a></td>
<td>Number of latitudinal bins (or rings) that are used for this pixelization.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#nifty.GLSpace.nlon" title="nifty.GLSpace.nlon"><code class="xref py py-obj docutils literal"><span class="pre">nlon</span></code></a></td>
<td>Number of longditudinal bins that are used for this pixelization.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#nifty.GLSpace.total_volume" title="nifty.GLSpace.total_volume"><code class="xref py py-obj docutils literal"><span class="pre">total_volume</span></code></a></td>
<td>Returns the total volume of the space.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#nifty.GLSpace.shape" title="nifty.GLSpace.shape"><code class="xref py py-obj docutils literal"><span class="pre">shape</span></code></a></td>
<td>The domain-object’s shape contribution to the underlying array.</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#nifty.GLSpace.copy" title="nifty.GLSpace.copy"><code class="xref py py-obj docutils literal"><span class="pre">copy</span></code></a>()</td>
<td>Returns a copy of this Space instance.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#nifty.GLSpace.get_distance_array" title="nifty.GLSpace.get_distance_array"><code class="xref py py-obj docutils literal"><span class="pre">get_distance_array</span></code></a>(distribution_strategy)</td>
<td>The distances of the pixel to zero.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#nifty.GLSpace.get_fft_smoothing_kernel_function" title="nifty.GLSpace.get_fft_smoothing_kernel_function"><code class="xref py py-obj docutils literal"><span class="pre">get_fft_smoothing_kernel_function</span></code></a>(sigma)</td>
<td>This method returns a smoothing kernel function.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#nifty.GLSpace.weight" title="nifty.GLSpace.weight"><code class="xref py py-obj docutils literal"><span class="pre">weight</span></code></a>(x[,&nbsp;power,&nbsp;axes,&nbsp;inplace])</td>
<td>Weights the field on this domain with the space’s volume-weights.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="nifty.GLSpace.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/nifty/spaces/gl_space/gl_space.html#GLSpace.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nifty.GLSpace.copy" title="Permalink to this definition"></a></dt>
<dd><p>Returns a copy of this Space instance.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Space</p>
<blockquote class="last">
<div><p>A copy of this instance.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="nifty.GLSpace.get_distance_array">
<code class="descname">get_distance_array</code><span class="sig-paren">(</span><em>distribution_strategy</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nifty/spaces/gl_space/gl_space.html#GLSpace.get_distance_array"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nifty.GLSpace.get_distance_array" title="Permalink to this definition"></a></dt>
<dd><p>The distances of the pixel to zero.</p>
<p>This returns an array that gives for each pixel its distance to the
center of the manifolds grid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>distribution_strategy</strong> : str</p>
<blockquote>
<div><p>The distribution_strategy which shall be used the returned
distributed_data_object.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">distributed_data_object</p>
<blockquote>
<div><p>A d2o containing the distances</p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="nifty.GLSpace.get_fft_smoothing_kernel_function">
<code class="descname">get_fft_smoothing_kernel_function</code><span class="sig-paren">(</span><em>sigma</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nifty/spaces/gl_space/gl_space.html#GLSpace.get_fft_smoothing_kernel_function"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nifty.GLSpace.get_fft_smoothing_kernel_function" title="Permalink to this definition"></a></dt>
<dd><p>This method returns a smoothing kernel function.</p>
<p>This method, which is only implemented for harmonic spaces, helps
smoothing fields that live in a position space that has this space as
its harmonic space. The returned function multiplies field values of a
field with a zero centered Gaussian which corresponds to a convolution
with a Gaussian kernel and sigma standard deviation in position space.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>sigma</strong> : float</p>
<blockquote>
<div><p>A real number representing a physical scale on which the smoothing
takes place. The smoothing is defined with respect to the real
physical field and points that are closer together than one sigma
are blurred together. Mathematically sigma is the standard
deviation of a convolution with a normalized, zero-centered
Gaussian that takes place in position space.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">function (array-like -&gt; array-like)</p>
<blockquote>
<div><p>A smoothing operation that multiplies values with a Gaussian
kernel.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError :</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="nifty.GLSpace.weight">
<code class="descname">weight</code><span class="sig-paren">(</span><em>x</em>, <em>power=1</em>, <em>axes=None</em>, <em>inplace=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nifty/spaces/gl_space/gl_space.html#GLSpace.weight"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nifty.GLSpace.weight" title="Permalink to this definition"></a></dt>
<dd><p>Weights the field on this domain with the space’s volume-weights.</p>
<p>Weights hereby refer to integration weights, as they appear in
discretized integrals. Per default, this function mutliplies each bin
of the field x by its volume, which lets it behave like a density
(top form). However, different powers of the volume can be applied
with the power parameter. The axes parameter specifies which of the
field array’s indices correspond to this domain.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : distributed_data_object</p>
<blockquote>
<div><p>The fields data array.</p>
</div></blockquote>
<p><strong>power</strong> : int, <em>optional</em></p>
<blockquote>
<div><p>The power to which the volume-weight is raised (default: 1).</p>
</div></blockquote>
<p><strong>axes</strong> : {int, tuple}, <em>optional</em></p>
<blockquote>
<div><p>Specifies the axes of x which represent this domain
(default: None).
If axes==None:</p>
<blockquote>
<div><p>weighting is applied with respect to all axes</p>
</div></blockquote>
</div></blockquote>
<p><strong>inplace</strong> : bool, <em>optional</em></p>
<blockquote>
<div><p>If this is True, the weighting is done on the values of x,
if it is False, x is not modified and this method returns a
weighted copy of x (default: False).</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">distributed_data_object</p>
<blockquote>
<div><p>A weighted version of x, with volume-weights raised to the
given power.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.dim">
<code class="descname">dim</code><a class="headerlink" href="#nifty.GLSpace.dim" title="Permalink to this definition"></a></dt>
<dd><p>Returns the number of pixel-dimensions the object has.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">int</p>
<blockquote>
<div><p>An Integer representing the number of pixels the discretized
manifold has.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.harmonic">
<code class="descname">harmonic</code><a class="headerlink" href="#nifty.GLSpace.harmonic" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if this space is a harmonic space.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.nlat">
<code class="descname">nlat</code><a class="headerlink" href="#nifty.GLSpace.nlat" title="Permalink to this definition"></a></dt>
<dd><p>Number of latitudinal bins (or rings) that are used for this
pixelization.</p>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.nlon">
<code class="descname">nlon</code><a class="headerlink" href="#nifty.GLSpace.nlon" title="Permalink to this definition"></a></dt>
<dd><p>Number of longditudinal bins that are used for this pixelization.</p>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.shape">
<code class="descname">shape</code><a class="headerlink" href="#nifty.GLSpace.shape" title="Permalink to this definition"></a></dt>
<dd><p>The domain-object’s shape contribution to the underlying array.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">tuple of ints</p>
<blockquote>
<div><p>The shape of the underlying array-like object.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="nifty.GLSpace.total_volume">
<code class="descname">total_volume</code><a class="headerlink" href="#nifty.GLSpace.total_volume" title="Permalink to this definition"></a></dt>
<dd><p>Returns the total volume of the space.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">float</p>
<blockquote>
<div><p>A real number representing the sum of all pixel volumes.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>NotImplementedError</strong></p>
<blockquote class="last">
<div><p>If called for this abstract class.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</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="spaces.html">Spaces</a><ul>
      <li>Previous: <a href="hp_space.html" title="previous chapter">The <code class="docutils literal"><span class="pre">HPSpace</span></code> class – HEALPix discretization of the sphere</a></li>
      <li>Next: <a href="lm_space.html" title="next chapter">The <code class="docutils literal"><span class="pre">LMSpace</span></code> class – Spherical Harmonics components</a></li>
  </ul></li>
  </ul></li>
</ul>
</div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/gl_space.rst.txt"
            rel="nofollow">Show Source</a></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>
      
      |
      <a href="_sources/gl_space.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>