/
curve2mask.1
112 lines (112 loc) · 4.25 KB
/
curve2mask.1
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
.\" Automatically generated by Pandoc 2.17.1.1
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "curve2mask" "1" "2021-02-15" "Fortran 95" "SHTOOLS 4.10"
.hy
.SH Curve2Mask
.PP
Given a set of latitude and longitude coordinates representing a closed
curve, output a gridded binary mask.
.SH Usage
.PP
call Curve2Mask (\f[V]mask_dh\f[R], \f[V]n\f[R], \f[V]sampling\f[R],
\f[V]profile\f[R], \f[V]nprofile\f[R], \f[V]np\f[R], \f[V]extend\f[R],
\f[V]exitstatus\f[R])
.SH Parameters
.TP
\f[V]dh_mask\f[R] : output, integer(int32), dimension (nlat, nlong)
A Driscoll and Healy (1994) sampled grid representing a mask denoted by
a closed curve.
All elements will either be 1 (for inside the curve) or 0 (for outside
the curve).
If \f[V]sampling\f[R] is 1, the grid is equally sampled and is
dimensioned as (\f[V]n\f[R] by \f[V]n\f[R]), where \f[V]n\f[R] is
\f[V]2lmax+2\f[R].
If sampling is 2, the grid is equally spaced and is dimensioned as
(\f[V]n\f[R] by 2\f[V]n\f[R]).
The first latitudinal band of the grid corresponds to 90 N, the
latitudinal sampling interval is 180/\f[V]n\f[R] degrees, and the
default behavior is to exclude the latitudinal band for 90 S.
The first longitudinal band of the grid is 0 E, by default the
longitudinal band for 360 E is not included, and the longitudinal
sampling interval is 360/\f[V]n\f[R] for an equally sampled and
180/\f[V]n\f[R] for an equally spaced grid, respectively.
If \f[V]extend\f[R] is 1, the longitudinal band for 360 E and the
latitudinal band for 90 S will be included, which increases each of the
dimensions of the grid by 1.
.TP
\f[V]n\f[R] : input, integer
The number of latitudinal samples in \f[V]dh_mask\f[R].
The effective spherical harmonic bandwidth of this grid is
\f[V]L=n/2-1\f[R].
.TP
\f[V]sampling\f[R] : input, integer(int32)
For 1, \f[V]dh_mask\f[R] is dimensioned as (\f[V]n\f[R], \f[V]n\f[R]),
whereas for 2, \f[V]dh_mask\f[R] is dimensioned as (\f[V]n\f[R],
\f[V]2n\f[R]).
.TP
\f[V]profile\f[R] : input, real(dp), dimension (\f[V]nprofile\f[R], 2)
List of latitude (:,1) and longitude (:,2) coordinates in degrees
specifying a single closed curve.
.TP
\f[V]nprofile\f[R] : input, integer(int32)
The number of coordinates in the curve \f[V]profile\f[R].
.TP
\f[V]np\f[R] : input, integer(int32)
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.
.TP
\f[V]extend\f[R] : input, optional, integer(int32), default = 0
If 1, compute the longitudinal band for 360 E and the latitudinal band
for 90 S.
This increases each of the dimensions of \f[V]dh_mask\f[R] by 1.
.TP
\f[V]exitstatus\f[R] : output, optional, integer(int32)
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.
.SH Description
.PP
\f[V]Curve2Mask\f[R] will take a list of latitude and longitude
coordinates that represent a single closed curve, and output a mask
\f[V]mask_dh\f[R] that contains ones and zeros where the grid nodes are
inside and outside of the curve, respectively.
\f[V]mask_dh\f[R] must be sampled according to the Driscoll and Healy
(1994) sampling theorem with \f[V]n\f[R] samples in latitude, and either
possess \f[V]n\f[R] samples in longitude (\f[V]sampling=1\f[R]) or
\f[V]2n\f[R] samples in longitude (\f[V]sampling=2\f[R]).
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.
.PP
Longitudes of the curve can span the range from -360 to 720 degrees.
If the longitudes of two adjacent points differ by more than 180
degrees, it will be assumed that the curve passes from 360 to 0 degrees,
or from -180 to 180 degrees.
.SH Reference
.PP
Driscoll, J.R.
and D.M.
Healy, Computing Fourier transforms and convolutions on the 2-sphere,
Adv.
Appl.
Math., 15, 202-250, 1994.
.SH See also
.PP
shreturntapersmap, computedmap