OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ias_geo.h
Go to the documentation of this file.
1 #ifndef IAS_GEO_H
2 #define IAS_GEO_H
3 
4 #include "ias_const.h"
5 #include "ias_structures.h"
6 
7 /* Define a zone number for all projections except State Plane and UTM. */
8 #define NULLZONE 62
9 
10 #define WGS84_SPHEROID 12
11 
12 /* Type defines for projection related structures */
13 typedef struct ias_geo_proj_transformation IAS_GEO_PROJ_TRANSFORMATION;
14 /* The ias_projection structure matches the gctp_projection structure
15  definition. The gctp_projection structure is not included here to prevent
16  needing to modify the build to find gctp.h everywhere ias_geo.h is used. */
17 typedef struct ias_projection
18 {
19  int proj_code; /* Projection code */
20  int zone; /* Projection zone number - only has meaning for
21  projections like UTM and stateplane */
22  int units; /* Units of coordinates */
23  int spheroid; /* Spheroid code for the projection */
25  /* Array of projection parameters */
26 } IAS_PROJECTION;
27 
29 (
30  double deg, /* I: Angle in seconds, minutes, or degrees */
31  double *dms, /* O: Angle converted to DMS */
32  const char *check /* I: Angle usage type (LAT, LON, or DEGREES) */
33 );
34 
36 (
37  double angle_dms, /* I: Angle in DMS (DDDMMMSSS) format */
38  double *angle_degrees,/* O: Angle in decimal degrees */
39  const char *type /* I: Angle usage type (LAT, LON, or DEGREES) */
40 );
41 
43 (
44  double latitude, /* I: Lat of geodetic coordinates in radians */
45  double longitude, /* I: Long of geodetic coordinates in radians*/
46  double height, /* I: Height (elevation) of geodetic coord in meters */
47  double semimajor, /* I: Reference ellipsoid semi-major axis in meters */
48  double flattening, /* I: Flattening of the ellipsoid
49  (semimajor-semiminor)/semimajor */
50  IAS_VECTOR *cart /* O: Cartesian vector for the coord */
51 );
52 
54 (
55  double angle, /* I: Angle in total degrees */
56  int *degree /* O: Degree portion of the angle */
57 );
58 
59 
60 void ias_geo_find_min
61 (
62  double angle, /* I: Angle in total degrees */
63  int *minute /* O: Minute portion of the angle */
64 );
65 
66 void ias_geo_find_sec
67 (
68  double angle, /* I: Angle in total degrees */
69  double *second /* O: Second portion of the angle */
70 );
71 
73 (
74  const char *unit_name, /* I: Units name */
75  int *unit_num /* O: Units number */
76 );
77 
79 (
80  int unit, /* I: The angular unit of the angles passed in */
81  double const corner_longitudes[4]
82  /* I: The longitude for each corner of the scene */
83 );
84 
86 (
87  int unit, /* I: The angular unit to use to interpret lon */
88  double *lon /* I/O: The angle to be adjusted */
89 );
90 
91 
93 (
94  const double *seconds_from_ref, /* I: Array of n_pts reference times */
95  const IAS_VECTOR *position, /* I: Array of n_pts position vectors */
96  const IAS_VECTOR *velocity, /* I: Array of n_pts velocity vectors */
97  int n_pts, /* I: Number of points to use in interpolation */
98  double delta_time, /* I: Delta time from the reference time */
99  IAS_VECTOR *interpolated_position,
100  /* O: New satellite position at delta_time */
101  IAS_VECTOR *interpolated_velocity
102  /* O: New satellite velocity at delta_time */
103 );
104 
106 (
107  int err /* I: Error returned from the GCTP call */
108 );
109 
111 (
112  int inproj, /* I: Input projection code */
113  int inunit, /* I: Input projection units code */
114  int inzone, /* I: Input projection zone code */
115  const double *inparm, /* I: Array of 15 projection parameters--input */
116  int inspheroid, /* I: Input spheroid code */
117  int outproj, /* I: Output projection code */
118  int outunit, /* I: Output projection units code */
119  int outzone, /* I: Output projection zone code */
120  const double *outparm, /* I: Array of 15 projection parameters--output */
121  int outspheroid, /* I: Output spheroid code */
122  double inx, /* I: Input X projection coordinate */
123  double iny, /* I: Input Y projection coordinate */
124  double *outx, /* O: Output X projection coordinate */
125  double *outy /* O: Output Y projection coordinate */
126 );
127 
128 IAS_GEO_PROJ_TRANSFORMATION *ias_geo_create_proj_transformation
129 (
130  const IAS_PROJECTION *source_projection, /* I: source projection */
131  const IAS_PROJECTION *target_projection /* I: target projection */
132 );
133 
135 (
136  IAS_GEO_PROJ_TRANSFORMATION *trans
137 );
138 
140 
142 (
143  const IAS_GEO_PROJ_TRANSFORMATION *trans, /* I: transformation to use */
144  double inx, /* I: Input X projection coordinate */
145  double iny, /* I: Input Y projection coordinate */
146  double *outx, /* O: Output X projection coordinate */
147  double *outy /* O: Output Y projection coordinate */
148 );
149 
151 (
152  int proj_code, /* I: input projection code */
153  int zone, /* I: input zone */
154  int units, /* I: input units */
155  int spheroid, /* I: input spheroid */
156  const double *parms, /* I: input projection parameters */
157  IAS_PROJECTION *proj /* I: target projection structure */
158 );
159 
160 #endif
int ias_geo_report_proj_err(int err)
void ias_geo_set_projection(int proj_code, int zone, int units, int spheroid, const double *parms, IAS_PROJECTION *proj)
int ias_geo_transform_projection(int inproj, int inunit, int inzone, const double *inparm, int inspheroid, int outproj, int outunit, int outzone, const double *outparm, int outspheroid, double inx, double iny, double *outx, double *outy)
real(single), dimension(:,:), allocatable longitude
int spheroid
Definition: ias_geo.h:23
#define flattening
Definition: vincenty.c:24
real(single), dimension(:,:), allocatable latitude
int proj_code
Definition: ias_geo.h:19
double parameters[IAS_PROJ_PARAM_SIZE]
Definition: ias_geo.h:24
void ias_geo_find_deg(double angle, int *degree)
void ias_geo_destroy_proj_transformation(IAS_GEO_PROJ_TRANSFORMATION *trans)
int ias_geo_add_once_around(int unit, double *lon)
int ias_geo_convert_dms2deg(double angle_dms, double *angle_degrees, const char *type)
void ias_geo_find_min(double angle, int *minute)
int ias_geo_transform_coordinate(const IAS_GEO_PROJ_TRANSFORMATION *trans, double inx, double iny, double *outx, double *outy)
void ias_geo_find_sec(double angle, double *second)
int ias_geo_convert_deg2dms(double deg, double *dms, const char *check)
#define semimajor
Definition: vincenty.c:25
void ias_geo_only_allow_threadsafe_transforms()
void ias_geo_lagrange_interpolate(const double *seconds_from_ref, const IAS_VECTOR *position, const IAS_VECTOR *velocity, int n_pts, double delta_time, IAS_VECTOR *interpolated_position, IAS_VECTOR *interpolated_velocity)
int ias_geo_does_cross_180(int unit, double const corner_longitudes[4])
float * lon
int ias_geo_get_units(const char *unit_name, int *unit_num)
void ias_geo_convert_geod2cart(double latitude, double longitude, double height, double semimajor, double flattening, IAS_VECTOR *cart)
#define IAS_PROJ_PARAM_SIZE
Definition: ias_const.h:61
IAS_GEO_PROJ_TRANSFORMATION * ias_geo_create_proj_transformation(const IAS_PROJECTION *source_projection, const IAS_PROJECTION *target_projection)