Due to the lapse in federal government funding, NASA is not updating this website. We sincerely regret this inconvenience.
NASA Logo
Ocean Color Science Software

ocssw V2022
isin.h
Go to the documentation of this file.
1 #ifndef ISIN_H
2 #define ISIN_H
3 
4 /******************************************************************************
5 NAME ISIN.H
6 
7 PURPOSE: Integerized Sinusoidal Library Header - constants, data
8  structures and prototypes for integerized sinusoidal library
9  functions.
10 
11 ******************************************************************************/
12 
13 /* Status returned */
14 #define ISIN_SUCCESS 0 /* Successful return */
15 #define ISIN_ERROR -1 /* Error return */
16 #define ISIN_ERANGE -2 /* Input variable out of range */
17 
18 /* ISIN related defines */
19 #define TWOPI_INV (1.0 / (2.0 * PI))
20 #define NROW_MAX (360 * 3600) /* Maximum number of rows (zones) */
21 #define NZONE_MAX (360 * 3600) /* Maximum number of longitudinal zones */
22 #define EPS_SPHERE (1.0e-10) /* Minimum sphere radius */
23 #define EPS_CNVT 0.01 /* Doubles must be within this of an integer
24  to be valid */
25 #define ISIN_KEY 212589603 /* Key to verify correct data structure */
26 
27 /* Data Structures */
28 
29 /* Row Type; Information for Eash Row (longitudinal band) in Projection */
30 typedef struct
31 {
32  long ncol; /* Number of columns */
33  long icol_cen; /* Column number to left of center of grid */
34  double ncol_inv; /* Number of columns inverse */
35 }
37 
38 /* Handle Type; Values assigned in 'Isin_init' */
39 typedef struct
40 {
41  double false_east; /* Northing at projection origin */
42  double false_north; /* Easting at projection origin */
43  double sphere; /* Sphere radius (user's units) */
44  double sphere_inv; /* Sphere radius inverse (user's units) */
45  double ang_size_inv; /* Grid angular resolution inverse (1/rad) */
46  long nrow; /* Number of rows (longitudinal zones) */
47  long nrow_half; /* Half of number of rows(longitudinal zones) */
48  double ref_lon; /* Zero reference longitude (rad) */
49  double lon_cen_mer; /* Longitude of central meridian (rad) */
50  int ijustify; /* Justify flag (see Isin_init) */
51  double col_dist; /* Distance for one column in projection
52  * (user's units) */
53  double col_dist_inv; /* Distance for one column in projection inverse
54  * (user's units) */
55  Isin_row_t *row; /* Row data structure */
56  long key; /* Data structure key */
57 }
58 Isin_t;
59 
60 /* Error Structure */
61 typedef struct
62 {
63  int num; /* Error number */
64  const char *str; /* Error message */
65 }
66 error_t;
67 
68 /* Initialize integerized sinusoidal forward transformations */
69 long isinusforinit
70 (
71  double sphere,
72  double lon_cen_mer,
73  double false_east,
74  double false_north,
75  double dzone,
76  double djustify
77 );
78 
80 (
81  double sphere,
82  double lon_cen_mer,
83  double false_east,
84  double false_north,
85  long nrow,
86  int ijustify
87 );
88 
89 /* Initialize integerized sinusoidal inverse transformations */
90 long isinusinvinit
91 (
92  double sphere,
93  double lon_cen_mer,
94  double false_east,
95  double false_north,
96  double dzone,
97  double djustify
98 );
99 
101 (
102  double sphere,
103  double lon_cen_mer,
104  double false_east,
105  double false_north,
106  long nrow,
107  int ijustify
108 );
109 
110 /* Forward mapping; converts geographic coordinates ('lon', 'lat')
111  * to map projection coordinates ('x', 'y') */
112 long isinusfor
113 (
114  double lon,
115  double lat,
116  double *x,
117  double *y
118 );
119 
120 int Isin_fwd
121 (
122  const Isin_t * this,
123  double lon,
124  double lat,
125  double *x,
126  double *y
127 );
128 
129 /* Inverse mapping; converts map projection coordinates ('x', 'y') to
130  * geographic coordinates ('lon', 'lat') */
131 long isinusinv( double, double, double *, double * );
132 int Isin_inv( const Isin_t *, double, double, double *, double * );
133 
134 /* Deallocate the 'isin' data structure and array memory */
135 int Isin_for_free
136 (
137  Isin_t * this
138 );
139 
140 int Isin_inv_free
141 (
142  Isin_t * this
143 );
144 
145 #endif
long isinusinv(double, double, double *, double *)
Definition: isininv.c:472
int Isin_inv(const Isin_t *, double, double, double *, double *)
Definition: isininv.c:521
Isin_t * Isin_inv_init(double sphere, double lon_cen_mer, double false_east, double false_north, long nrow, int ijustify)
Definition: isininv.c:255
Definition: isin.h:38
Definition: isin.h:60
long isinusforinit(double sphere, double lon_cen_mer, double false_east, double false_north, double dzone, double djustify)
Definition: isinfor.c:115
int Isin_inv_free(Isin_t *this)
Definition: isininv.c:601
Isin_t * Isin_for_init(double sphere, double lon_cen_mer, double false_east, double false_north, long nrow, int ijustify)
Definition: isinfor.c:242
int Isin_for_free(Isin_t *this)
Definition: isinfor.c:585
long isinusfor(double lon, double lat, double *x, double *y)
Definition: isinfor.c:460
int Isin_fwd(const Isin_t *this, double lon, double lat, double *x, double *y)
Definition: isinfor.c:508
long isinusinvinit(double sphere, double lon_cen_mer, double false_east, double false_north, double dzone, double djustify)
Definition: isininv.c:128
#define str(s)