-
Notifications
You must be signed in to change notification settings - Fork 103
/
curve2mask.html
87 lines (76 loc) · 5.43 KB
/
curve2mask.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SHTOOLS - Localized spectral analysis</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/sh.css">
<link rel="icon" type="image/vnd.microsoft.icon" href="../../images/favicon.ico">
</head>
<body>
<div class="main">
<p class="centeredimage"><img src="../../images/logo.jpg" width=894 height=135 alt="SHTOOLS --- Tools for working with spherical harmonics"></p>
<table class="menu">
<tbody>
<tr>
<td><a href="../../../index.html">HOME</a></td>
<td><a href="https://github.com/SHTOOLS/SHTOOLS/releases">DOWNLOAD</a></td>
<td class="selected"><a href="../../documentation.html">DOCUMENTATION</a></td>
<td><a href="../../faq.html">FAQ</a> </td>
</tr>
</tbody>
</table>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../localized.html" class="dir">Localized Spectral Analysis</a></p>
<h1 id="curve2mask">Curve2Mask</h1>
<p>Given a set of latitude and longitude coordinates representing a closed curve, output a gridded binary mask.</p>
<h1 id="usage">Usage</h1>
<p>call Curve2Mask (<code>mask_dh</code>, <code>n</code>, <code>sampling</code>, <code>profile</code>, <code>nprofile</code>, <code>np</code>, <code>centralmeridian</code>, <code>exitstatus</code>)</p>
<h1 id="parameters">Parameters</h1>
<dl>
<dt><code>dh_mask</code> : output, integer, dimension (<code>n</code>, <code>n</code>*<code>sampling</code>)</dt>
<dd>A Driscoll and Healy (1994) sampled grid describing the concentration region R. All elements on output will either be 1 (for inside the concentration region) or 0 (for outside R).
</dd>
<dt><code>n</code> : input, integer</dt>
<dd>The number of latitudinal samples in <code>dh_mask</code>. The effective spherical harmonic bandwidth of this grid is <code>L=n/2-1</code>.
</dd>
<dt><code>sampling</code> : input, integer</dt>
<dd>For 1, <code>dh_mask</code> has <code>n</code> x <code>n</code> samples. For 2, <code>dh_mask</code> has <code>n</code> x <code>2n</code> samples.
</dd>
<dt><code>profile</code> : input, real*8, dimension (<code>nprofile</code>, 2)</dt>
<dd>List of latitude (:,1) and longitude (:,2) coordinates in degrees specifying a single closed curve.
</dd>
<dt><code>nprofile</code> : input, integer</dt>
<dd>The number of coordinates in the curve <code>profile</code>.
</dd>
<dt><code>np</code> : input, integer</dt>
<dd>The value of the returned mask at the North pole (90N, 0E). If the North pole is outside of the concentration region, set this to 0; if it is inside the concentration region, set this to 1.
</dd>
<dt><code>centralmeridian</code> : input, optional, integer, default = 0</dt>
<dd>If 1, the curve is assumed to pass through the central meridian: passing from < 360 degrees to > 0 degrees. The curve makes a complete circle about the planet in longitude.
</dd>
<dt><code>exitstatus</code> : output, optional, integer</dt>
<dd>If present, instead of executing a STOP when an error is encountered, the variable exitstatus will be returned describing the error. 0 = No errors; 1 = Improper dimensions of input array; 2 = Improper bounds for input variable; 3 = Error allocating memory; 4 = File IO error.
</dd>
</dl>
<h1 id="description">Description</h1>
<p><code>Curve2Mask</code> will take a list of latitude and longitude coordinates that represent a single closed curve, and output a mask <code>mask_dh</code> that contains 1s and 0s where the grid nodes are inside and outside of the curve, respectively. <code>mask_dh</code> must be sampled according to the Driscoll and Healy (1994) sampling theorem with <code>n</code> samples in latitude, and either possess <code>n</code> samples in longitude (<code>sampling=1</code>) or <code>2n</code> samples in longitude (<code>sampling=2</code>). It is necessary to specify a single point as being inside or outside of the curve, and for this the value at the North pole (90N, 0E) must be specified as either 0 or 1.</p>
<p>This routine saves the three-term recursion factors and square roots of the integers the first time being called. If subsequent calls possess the same value of <code>lmax</code>, these will not be recomputed. If you wish to deallocate this memory, which is an array of length <code>(lmax+1)*(lmax+2)</code>, recall this routine with <code>lmax=-1</code>.</p>
<h1 id="references">References</h1>
<p>Driscoll, J.R. and D.M. Healy, Computing Fourier transforms and convolutions on the 2-sphere, Adv. Appl. Math., 15, 202-250, 1994.</p>
<h1 id="see-also">See also</h1>
<p><a href="shreturntapersmap.html">shreturntapersmap</a>, <a href="computedmap.html">computedmap</a></p>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../localized.html" class="dir">Localized Spectral Analysis</a></p>
<table class="footer2">
<tbody>
<tr>
<td class="c1"><a href="https://lagrange.oca.eu/?lang=en">Laboratoire Lagrange</a></td>
<td class="c2"><a href="https://www.oca.eu/?lang=en">Observatoire de la Côte d'Azur</a></td>
<td class="c3">© 2017 <a href="https://github.com/SHTOOLS">SHTOOLS</a></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>