isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuProjections.h
1 
6 #pragma once
7 
8 #include <cmath>
9 #include <iostream>
10 #include <vector>
11 
12 #include <isce3/core/Ellipsoid.h>
13 #include <isce3/core/forward.h>
14 
15 namespace isce3 { namespace cuda { namespace core {
16 
23  struct ProjectionBase {
24  typedef isce3::core::Vec3 Vec3;
25 
30  int _epsgcode;
31 
33  CUDA_HOSTDEV ProjectionBase(int code) : ellipse(6378137.,.0066943799901), _epsgcode(code) {}
34  CUDA_HOSTDEV virtual ~ProjectionBase() {}
35 
40  CUDA_HOST int forward_h(const Vec3& llh, Vec3& xyz) const;
41 
46  CUDA_DEV virtual int forward(const Vec3& llh, Vec3& xyz) const = 0;
47 
52  CUDA_HOST int inverse_h(const Vec3& xyz, Vec3& llh) const;
53 
58  CUDA_DEV virtual int inverse(const Vec3& xyz, Vec3& llh) const = 0 ;
59  };
60 
62  struct LonLat: public ProjectionBase {
63  // Value Constructor
64  CUDA_HOSTDEV LonLat() : ProjectionBase(4326) {}
65  // Radians to Degrees pass through
66  CUDA_DEV int forward(const Vec3&, Vec3&) const;
67  // Degrees to Radians pass through
68  CUDA_DEV int inverse(const Vec3&, Vec3&) const;
69  };
70 
72  struct Geocent: public ProjectionBase {
73  // Value Constructor
74  CUDA_HOSTDEV Geocent():ProjectionBase(4978){};
76  CUDA_DEV int forward(const Vec3&, Vec3&) const;
77 
79  CUDA_DEV int inverse(const Vec3&, Vec3&) const;
80  };
81 
86  struct UTM : public ProjectionBase {
87  // Constants related to the projection system
88  double lon0;
89  int zone;
90  bool isnorth;
91  // Parameters from Proj.4
92  double cgb[6], cbg[6], utg[6], gtu[6];
93  double Qn, Zb;
94 
95  // Value constructor
96  CUDA_HOSTDEV UTM(int);
97 
99  CUDA_DEV int forward(const Vec3&, Vec3&) const;
100 
102  CUDA_DEV int inverse(const Vec3&, Vec3&) const;
103  };
104 
109  struct PolarStereo: public ProjectionBase {
110 
111  // Constants related to projection system
112  double lon0, lat_ts, akm1, e;
113  bool isnorth;
114 
115  // Value constructor
116  CUDA_HOSTDEV PolarStereo(int);
118  CUDA_DEV int forward(const Vec3&, Vec3&) const;
120  CUDA_DEV int inverse(const Vec3&, Vec3&) const;
121  };
122 
126  struct CEA: public ProjectionBase {
127  // Constants related to projection system
128  double apa[3];
129  double lat_ts, k0, e, one_es, qp;
130 
131  // Value constructor
132  CUDA_HOSTDEV CEA();
133 
135  CUDA_DEV int forward(const Vec3&, Vec3&) const;
136 
138  CUDA_DEV int inverse(const Vec3&, Vec3&) const;
139  };
140 
141  // This is to transform a point from one coordinate system to another
142  CUDA_DEV int projTransform(ProjectionBase* in,
143  ProjectionBase *out,
144  const double *inpts,
145  double *outpts);
146 
147  //Projection Factory using EPSG code
148  CUDA_HOSTDEV ProjectionBase* createProj(int epsg);
149 
150  CUDA_DEV int projInverse(int code, const double* in, double* out_llh);
151  CUDA_DEV int projInverse(int code, const isce3::core::Vec3& in, isce3::core::Vec3& out_llh);
152 }}}
isce3::core::Ellipsoid ellipse
Ellipsoid object for projections - currently only WGS84.
Definition: gpuProjections.h:27
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Same as Ellipsoid::xyzTolonLat.
virtual CUDA_DEV int forward(const Vec3 &llh, Vec3 &xyz) const =0
Device function for transform from LLH.
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transform from llh (rad) to UTM (m)
Data structure to store Ellipsoid information.
Definition: Ellipsoid.h:20
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Device function for transform from LLH.
CUDA_HOST int forward_h(const Vec3 &llh, Vec3 &xyz) const
Host function for transforming from LLH.
Abstract base class for individual projections.
Definition: gpuProjections.h:23
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from CEA (m) to LLH (rad)
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Device function for tranforming to LLH.
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from UTM(m) to llh (rad)
Standard WGS84 ECEF coordinates - EPSG:4978.
Definition: gpuProjections.h:72
int _epsgcode
Type of projection system.
Definition: gpuProjections.h:30
virtual CUDA_DEV int inverse(const Vec3 &xyz, Vec3 &llh) const =0
Device function for tranforming to LLH.
Geodetic Lon/Lat projection - EPSG:4326.
Definition: gpuProjections.h:62
CUDA_HOSTDEV ProjectionBase(int code)
Value constructor with EPSG code as input.
Definition: gpuProjections.h:33
Polar stereographic coordinate system.
Definition: gpuProjections.h:109
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Same as Ellipsoid::lonLatToXyz.
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from Polar Stereo to LLH.
Equal Area Projection extension of ProjBase.
Definition: gpuProjections.h:126
CUDA_HOST int inverse_h(const Vec3 &xyz, Vec3 &llh) const
Host function for transforming to LLH.
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transform from llh (rad) to CEA (m)
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transfrom from LLH to Polar Stereo.
UTM coordinate extension of ProjectionBase.
Definition: gpuProjections.h:86

Generated for ISCE3.0 by doxygen 1.8.5.