-
Notifications
You must be signed in to change notification settings - Fork 375
/
Copy pathgmt_sph.h
63 lines (53 loc) · 2.41 KB
/
gmt_sph.h
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
/*--------------------------------------------------------------------
*
* Copyright (c) 2008-2025 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
* See LICENSE.TXT file for copying and redistribution conditions.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3 or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* Contact info: www.generic-mapping-tools.org
*--------------------------------------------------------------------*/
/* Include file for sph supplement */
/*!
* \file gmt_sph.h
* \brief Include file for sph supplement.
*/
#define DELAUNAY 0
#define VORONOI 1
#define INTERPOLATE 2
#define TRI_NROW 6 /* Don't request arc indices from STRIPACK */
/* PW note: We largely use int64_t since it is too hard to determine which variables
* in the FORTRAN-translated code could make unsigned. */
struct STRIPACK_DELAUNAY { /* Information about Delaunay triangulation */
uint64_t n; /* Number of Delaunay triangles */
int64_t *tri; /* Delaunay triplet node numbers and more */
};
struct STRIPACK_VORONOI { /* Information about Voronoi polygons */
double *lon, *lat; /* Voronoi polygon vertices */
uint64_t n; /* Number of boundary nodes for Voronoi */
int64_t *lend, *listc, *lptr; /* Voronoi vertex lists and pointers */
int64_t *list; /* Additional list from trmesh */
};
struct STRIPACK_INTERPOLATE { /* Information about triangles */
int64_t *lend, *list, *lptr; /* lists and pointers */
};
struct STRIPACK {
unsigned int mode; /* VORONOI, DELAUNAY, or INTERPOLATE */
struct STRIPACK_DELAUNAY D;
struct STRIPACK_VORONOI V;
struct STRIPACK_INTERPOLATE I;
};
struct STRPACK_ARC {
uint64_t begin, end;
};
/* Export these functions */
EXTERN_MSC int gmt_stripack_lists (struct GMT_CTRL *GMT, uint64_t n, double *x, double *y, double *z, struct STRIPACK *T);
EXTERN_MSC double gmt_stripack_areas (double *V1, double *V2, double *V3);
EXTERN_MSC int gmt_ssrfpack_grid (struct GMT_CTRL *GMT, double *x, double *y, double *z, double *w, uint64_t n, unsigned int mode, double *par, bool vartens, struct GMT_GRID_HEADER *h, double *f);