isce3 0.25.0
Loading...
Searching...
No Matches
gpuProjections.h
1
5
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
15namespace isce3 { namespace cuda { namespace core {
16
24 typedef isce3::core::Vec3 Vec3;
25
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}}}
Data structure to store Ellipsoid information.
Definition Ellipsoid.h:20
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transform from llh (rad) to CEA (m)
Definition gpuProjections.cu:423
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from CEA (m) to LLH (rad)
Definition gpuProjections.cu:433
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Same as Ellipsoid::lonLatToXyz.
Definition gpuProjections.cu:130
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Same as Ellipsoid::xyzTolonLat.
Definition gpuProjections.cu:139
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Device function for transform from LLH.
Definition gpuProjections.cu:108
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Device function for transforming to LLH.
Definition gpuProjections.cu:119
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from Polar Stereo to LLH.
Definition gpuProjections.cu:378
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transform from LLH to Polar Stereo.
Definition gpuProjections.cu:363
Abstract base class for individual projections.
Definition gpuProjections.h:23
virtual CUDA_DEV int inverse(const Vec3 &xyz, Vec3 &llh) const =0
Device function for transforming to LLH.
virtual CUDA_DEV int forward(const Vec3 &llh, Vec3 &xyz) const =0
Device function for transform from LLH.
CUDA_HOSTDEV ProjectionBase(int code)
Value constructor with EPSG code as input.
Definition gpuProjections.h:33
CUDA_HOST int forward_h(const Vec3 &llh, Vec3 &xyz) const
Host function for transforming from LLH.
Definition gpuProjections.cu:48
isce3::core::Ellipsoid ellipse
Ellipsoid object for projections - currently only WGS84.
Definition gpuProjections.h:27
CUDA_HOST int inverse_h(const Vec3 &xyz, Vec3 &llh) const
Host function for transforming to LLH.
Definition gpuProjections.cu:79
int _epsgcode
Type of projection system.
Definition gpuProjections.h:30
CUDA_DEV int forward(const Vec3 &, Vec3 &) const
Transform from llh (rad) to UTM (m)
Definition gpuProjections.cu:267
CUDA_DEV int inverse(const Vec3 &, Vec3 &) const
Transform from UTM(m) to llh (rad)
Definition gpuProjections.cu:298

Generated for ISCE3.0 by doxygen 1.13.2.